[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

Ezio Melotti report at bugs.python.org
Fri Nov 18 11:47:05 CET 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

I did some tests, creating an element ('elem') that contains two adjacent text nodes ('text').  With my latest patch the prettyprint is:
<?xml version="1.0" ?>
<elem>
        text
        text
</elem>

Here both the text nodes are printed on a newline and they are indented.

With your patch it should be:
<?xml version="1.0" ?>
<elem>texttext</elem>

I'm not sure there's any reason to prefer the second option though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4147>
_______________________________________


More information about the Python-bugs-list mailing list