[lxml-dev] lxml 2.2 validation question
Piet van Oostrum
piet at cs.uu.nl
Tue May 19 21:36:33 CEST 2009
>>>>> jholg at gmx.de (j) wrote:
>j> Some comments:
>>> nsmap={None: 'http://example.com', 'foo': 'http://example.com'}
>>> rootElem = etree.Element('Foo', {}, nsmap)
>j> Note that this does not put Foo into the http://example.com NS. It creates an element Foo wit no namespace. The nsmap is rather a collection of known namespace prefixes in the context of an element.
But that means that the serialization:
<Foo xmlns="http://example.com">
Contents
</Foo>
that etree.tostring produces is wrong.
--
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org
More information about the lxml-dev
mailing list