[XML-SIG] xml.dom.minidom question

Andrew Clover and at doxdesk.com
Sat Jul 24 04:53:39 CEST 2004

Mehdi Hashemian <mehdi.hashemian at spirentcom.com> wrote:

> I am not sure. Originally, I thought it is the way toprettyxml() works but I
> see the same behavior with toxml().

I don't, with your example code (tested Python 2.2 and PyXML 0.8.3 
variants). For me, the output file when just the normal toxml() is used 
is the same as the input (non-preservable document-level white space 
issues nothwithstanding).

toprettyxml() does seem to insert extra newlines as well as indenting 
white space, and puts in more space than is really necessary IMO. I 
don't know if this can really be said to be 'wrong' though as prettiness 
is in the eye of the beholder, not defined by any standard.

Andrew Clover
mailto:and at doxdesk.com

More information about the XML-SIG mailing list