New submission from Raymond Hettinger:

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))

----------
messages: 239879
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Add xml pretty print option to ElementTree
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23847>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to