lxml etree question
Adam Tauno Williams
awilliam at whitemice.org
Fri Dec 24 13:17:01 EST 2010
On Fri, 2010-12-24 at 20:48 +0530, Nitin Pawar wrote:
> On Fri, Dec 24, 2010 at 8:40 PM, Jim <jim.hefferon at gmail.com> wrote:
> Hello, I wonder if someone knows about lxml.etree and
> namespaces?
Yes, and don't.
> I want to build an ElementTree where some of the sub-elements have
> attributes that serialize this way.
> <comment xml:lang='de'>..</comment>
> I've tried just comment_elet.set('xml:lang','de') and it didn't like
> that at all (although it takes comment_elet.set('auth:id','jones')
> just fine). I've also spelunked the docs and googled but have not hit
> on the right invocation. If someone knows, I'd be grateful.
I'd *strongly* recommend using ElementFlow for building XML documents
(over ElementTree), especially if namespaces are involved. ElementFlow
is far more intuitive.
<http://pypi.python.org/pypi/elementflow>
More information about the Python-list
mailing list