[issue4147] xml.dom.minidom toprettyxml: omit whitespace for text-only elements

Thomas Lee report at bugs.python.org
Sun Oct 19 17:33:24 CEST 2008


New submission from Thomas Lee <tom at vector-seven.com>:

For XML elements containing only text data, it would be nice if
toprettyxml could omit the whitespace it normally injects before & after
the text, e.g.

<person>
    <first-name>
        Bob
    </first-name>
</person>

Becomes:

<person>
    <first-name>Bob</first-name>
</person>

>From what I understand the handling of whitespace within XML elements is
application-defined, so I'm classifying this as a nice-to-have feature.
However it should be noted that in our particular case, the existing
behaviour caused a few problems with a third-party system which treated
whitespace as being significant.

----------
components: Library (Lib), XML
files: minidom-toprettyxml-01.patch
keywords: patch
messages: 74978
nosy: thomas.lee
severity: normal
status: open
title: xml.dom.minidom toprettyxml: omit whitespace for text-only elements
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file11832/minidom-toprettyxml-01.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4147>
_______________________________________


More information about the Python-bugs-list mailing list