
May 29, 2006
3:23 p.m.
Stefan Behnel wrote:
What surprises me most is that ElementTree (1.2.6) has a similar bug. It returns this for subelement.attrib after appending:
{'{}id': 'foo'}
that's somewhat surprising, given that ET doesn't do any mangling by itself; that's entirely up to the serialization code. here's what I get on my machine:
e = ET.Element("subelement") e.set("{http://www.w3.org/XML/1998/namespace}id", "foo") e <Element subelement at b42d28> ET.tostring(e) '<subelement xml:id="foo" />' e.attrib {'{http://www.w3.org/XML/1998/namespace}id': 'foo'}
</F>