Walter Dörwald wrote:
> Of course the node constructor could append the
> node to the currently active element. However there
> might be cases where you want to do something else
> with the newly created node, so always appending the
> node is IMHO the wrong thing.
Unless you're using it as a temp
Jonas Galvez wrote:
Walter Dörwald wrote:
XIST has been using with blocks since version 3.0.
[...]
with xsc.Frag() as node:
+xml.XML()
+html.DocTypeXHTML10transitional()
with html.html():
[...]
Sweet! I don't like having to use the unary operator tho, I wanted
something as simple as poss
Stefan Behnel wrote:
Hi,
Walter Dörwald wrote:
XIST has been using with blocks since version 3.0.
Take a look at:
http://www.livinglogic.de/Python/xist/Examples.html
from __future__ import with_statement
from ll.xist import xsc
from ll.xist.ns import html, xml, meta
with xsc.Frag() as node
Stefan Behnel wrote:
> Interesting. Is the "+" actually required? Are there other operators
> that make sense here? I do not see what "~" or "-" could mean.
> Or is it just a technical constraint?
> I'm asking because I consider adding such a syntax to lxml as
> a separate module. And I'd prefer co
Hi,
Walter Dörwald wrote:
> XIST has been using with blocks since version 3.0.
>
> Take a look at:
> http://www.livinglogic.de/Python/xist/Examples.html
>
>
> from __future__ import with_statement
>
> from ll.xist import xsc
> from ll.xist.ns import html, xml, meta
>
> with xsc.Frag() as node
Hi, two comments.
Gerard flanagan gmail.com> writes:
> Nice! Here's a version that uses elementtree:
[...]
> def __call__(self, value='', **kargs):
> self.element.text = value
This should spell
def __call__(self, value=None, **kargs):
> class builder(element):
> def
Walter Dörwald wrote:
> XIST has been using with blocks since version 3.0.
> [...]
> with xsc.Frag() as node:
> +xml.XML()
> +html.DocTypeXHTML10transitional()
> with html.html():
> [...]
Sweet! I don't like having to use the unary operator tho, I wanted
something as simple as possible, so I
Stefan Behnel wrote:
Stefan Behnel wrote:
Jonas Galvez wrote:
Not sure if it's been done before, but still...
Obviously ;)
http://codespeak.net/lxml/tutorial.html#the-e-factory
... and tons of other tools that generate XML, check PyPI.
Although it might be the first time I see the with sta
Jonas Galvez wrote:
Not sure if it's been done before, but still...
from __future__ import with_statement
from xmlbuilder import builder, element
xml = builder(version="1.0", encoding="utf-8")
with xml.feed(xmlns='http://www.w3.org/2005/Atom'):
xml.title('Example Feed')
xml.link
Stefan Behnel wrote:
> Jonas Galvez wrote:
>> Not sure if it's been done before, but still...
>
> Obviously ;)
>
> http://codespeak.net/lxml/tutorial.html#the-e-factory
>
> ... and tons of other tools that generate XML, check PyPI.
Although it might be the first time I see the with statement "m
Jonas Galvez wrote:
> Not sure if it's been done before, but still...
Obviously ;)
http://codespeak.net/lxml/tutorial.html#the-e-factory
... and tons of other tools that generate XML, check PyPI.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Not sure if it's been done before, but still...
from __future__ import with_statement
from xmlbuilder import builder, element
xml = builder(version="1.0", encoding="utf-8")
with xml.feed(xmlns='http://www.w3.org/2005/Atom'):
xml.title('Example Feed')
xml.link(None, href='http://ex
12 matches
Mail list logo