Python ElementTree writing multiple namespaces

amediqas

New Member
I have an XML document which I am reading and appending to using ElementTree.This has multiple namespaces declared. From what I can tell, ElementTree will only allow a single global namespace to be declared:\[code\]ET.register_namespace(prefix, uri)\[/code\]I would like to write multiple namespaces out in the resulting file. If I try to manually append them using\[code\]root.set(prefix, uri)\[/code\]Then they are put in the wrong order, and I get \[code\]cElementTree.ParseError: unbound prefix: line 2, column 0\[/code\]Is there a known workaround for this?Thanks!
 
Back
Top