ElementTree write creates large one line XML file ....

robert somerville rbrt.somerville at gmail.com
Thu May 27 19:52:17 EDT 2010


Hi I am using Ubuntu 9.10 and Python 2.6.4 ..

when I create an ElementTree object and the write it out using:

 xml.etree.ElementTree.write() , I get one single long single line files,
instead of something that looks reasonable , what gives ??? (and is it
important ??)

eg: I get :

<root><child>One</child><child>Two</child></root>

instead of :

<root>
<child>One</child>
<child>Two</child>
</root>


i found this example at: ( Listing 4 )
http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/#Listing1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100527/5d1bdc06/attachment.html>


More information about the Python-list mailing list