Message144755
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). |
|
Date |
User |
Action |
Args |
2011-10-02 01:14:16 | ezio.melotti | set | recipients:
+ ezio.melotti, techtonik, thomaslee, r.david.murray, jgarrison, m-samia, danken, tod, python-dev |
2011-10-02 01:14:16 | ezio.melotti | set | messageid: <1317518056.81.0.194361185901.issue4147@psf.upfronthosting.co.za> |
2011-10-02 01:14:16 | ezio.melotti | link | issue4147 messages |
2011-10-02 01:14:15 | ezio.melotti | create | |
|