[Tutor] Schema change in ElementTree

Stefan Behnel stefan_ml at behnel.de
Mon Aug 16 11:20:06 CEST 2010


justin.mailinglists at gmail.com, 16.08.2010 10:38:
> # 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')
> f.close()

Note that it's best to hit "reply" when responding to other people's 
postings. That way, mail readers can see the relation between the original 
posting and the reply and sort the reply into the right thread.

Stefan



More information about the Tutor mailing list