Writing XML files with ElementTree

Kent Tenney <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Howdy,

I don't understand how ET provides an
XML Declaration as the file output by ElenemtTree.write()

write() says

    elif encoding != "utf-8" and encoding != "us-ascii":
        file.write("<?xml version='1.0' encoding='%s'?>\n" % encoding)

How do I get the declaration written if I want 
encoding to be utf-8 ?

Do I need to manually paste it into the top of the 
file produced by ET.write()

I haven't found a lot of documentation on using 
ElementTree to produce XML.

Thanks,
Kent

_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.