Gene Wood added the comment:
One workaround to this is described here :
http://stackoverflow.com/a/4999510/168874
It involves prefixing all of the elements with the namespace like this :
from xml.etree import ElementTree as ET
# build a tree structure
root = ET.Element("{http://www.company.com}STUFF";)
body = ET.SubElement(root, "{http://www.company.com}MORE_STUFF";)
body.text = "STUFF EVERYWHERE!"
# wrap it in an ElementTree instance, and save as XML
tree = ET.ElementTree(root)
tree.write("page.xml",
xml_declaration=True,encoding='utf-8',
method="xml",default_namespace='http://www.company.com')
--
nosy: +gene_wood
___
Python tracker
<http://bugs.python.org/issue17088>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com