[Tutor] Schema change in ElementTree

justin.mailinglists at gmail.com justin.mailinglists at gmail.com
Mon Aug 16 10:38:11 CEST 2010

# so that ET preserves your namespaces
ET._namespace_map["http://www.w3.org/2001/XMLSchema"] = 'xs'

# open your file explicitly specifying the correct mode
f = open('testing.xml', 'w')
xml_tree.write(f, encoding='UTF-8')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100816/8abf2b27/attachment.html>

More information about the Tutor mailing list