This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gene_wood
Recipients eli.bendersky, gene_wood, scoder, silverbacknet, wiml
Date 2014-04-14.03:17:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397445439.09.0.102741416779.issue17088@psf.upfronthosting.co.za>
In-reply-to
Content
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')
History
Date User Action Args
2014-04-14 03:17:19gene_woodsetrecipients: + gene_wood, scoder, eli.bendersky, wiml, silverbacknet
2014-04-14 03:17:19gene_woodsetmessageid: <1397445439.09.0.102741416779.issue17088@psf.upfronthosting.co.za>
2014-04-14 03:17:19gene_woodlinkissue17088 messages
2014-04-14 03:17:18gene_woodcreate