fixing xml output format

wadi wadi wadienil at gmail.com
Tue Nov 24 17:14:35 CET 2009


 Hi all,

I am creating some xml output using minidom and saving it to a file using
doc.writexml()
The output however is as follows:

<?xml version="1.0" ?>
<info>
<Author>
        bill catman
</Author>
</info>


Is there a way to save xml output in a file such as xml is formatted the
right way? I mean with the right indentation and the elements values with no
new lines?

<?xml version="1.0" ?>
<info>
  <Author>bill catman</Author>
</info>

Note: writexml() with parameters and toprettyxml() are not giving the
desired output.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091124/dc7a684e/attachment.html>


More information about the Python-list mailing list