This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients danken, ezio.melotti, jgarrison, m-samia, python-dev, r.david.murray, techtonik, thomaslee, tod
Date 2011-10-02.01:14:15
SpamBayes Score 6.94791e-07
Marked as misclassified No
Message-id <1317518056.81.0.194361185901.issue4147@psf.upfronthosting.co.za>
In-reply-to
Content
The patch seems wrong to me:
>>> d = minidom.parseString('<foo><bar>AAA</bar>BBB<bar>CCC</bar></foo>')
>>> print(d.toprettyxml())
<?xml version="1.0" ?>
<foo>
        <bar>AAA        </bar>
BBB     <bar>CCC        </bar>
</foo>

Even if the newlines are gone, the indentation before the closing tag is preserved.  Also a newline is added before the text node BBB.

It would be good to check what the XML standard says about the whitespace.  I'm pretty sure HTML has well defined rules about it, but I don't know if that's the same for XML.

FWIW the link in msg102247 contains a different fix (not sure if it's any better), and also a link to an article about XML and whitespace: http://www.oracle.com/technetwork/articles/wang-whitespace-092897.html (the link seems broken in the page).
History
Date User Action Args
2011-10-02 01:14:16ezio.melottisetrecipients: + ezio.melotti, techtonik, thomaslee, r.david.murray, jgarrison, m-samia, danken, tod, python-dev
2011-10-02 01:14:16ezio.melottisetmessageid: <1317518056.81.0.194361185901.issue4147@psf.upfronthosting.co.za>
2011-10-02 01:14:16ezio.melottilinkissue4147 messages
2011-10-02 01:14:15ezio.melotticreate