Message239879
The xml.dom.minidom package has as a xml.toprettyxml() function that has the problem of altering the whitespace of the text of elements. The ElementTree module needs a prettify option that works better, perhaps something based of Effbot's code at:
http://effbot.org/zone/element-lib.htm#prettyprint
The lxml package also provides an API for this purpose:
print(etree.tostring(root, pretty_print=True)) |
|
Date |
User |
Action |
Args |
2015-04-02 07:01:50 | rhettinger | set | recipients:
+ rhettinger |
2015-04-02 07:01:50 | rhettinger | set | messageid: <1427958110.33.0.788273316254.issue23847@psf.upfronthosting.co.za> |
2015-04-02 07:01:50 | rhettinger | link | issue23847 messages |
2015-04-02 07:01:49 | rhettinger | create | |
|