Ezio Melotti <ezio.melo...@gmail.com> added the comment: 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). ---------- nosy: +ezio.melotti -BreamoreBoy stage: committed/rejected -> test needed status: closed -> open _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4147> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com