whitespace in xml output

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

whitespace in xml output

wadi wadi
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
white spaces?

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


Thanks for your help.
WN
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: whitespace in xml output

Lutz Horn-4
Hi,

wadi wadi <[hidden email]> wrote:
> I am creating some xml output using minidom and saving it to a file
> using doc.writexml()

Could you please add some code of *how* you add the content "bill
catman" to the "Author" element? It seems as if whitespace is an issue
here.

Lutz
--
http://mail.python.org/mailman/listinfo/python-list