[lxml-dev] namespace strangeness in lxml 1.1

Eric Jahn eric at ejahn.net
Sun Aug 24 05:51:04 CEST 2008


On Wed, 2008-08-20 at 09:07 +0200, Stefan Behnel wrote:
>     >>> import lxml.etree as et
>     >>> root = et.XML('<root xmlns:a="http://my/ns"><el/></root>')
>     >>> root[0].set("type", et.QName("{http://my/ns}tname"))
>     >>> et.tostring(root)
>     '<root xmlns:a="http://my/ns"><el type="a:tname"/></root>'

Stefan, this worked, thank you!  -Eric





More information about the lxml-dev mailing list