summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-10-17 22:46:45 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-10-17 22:46:45 (GMT)
commita90032a3fb526916a95595a7f3f570dadf9d9380 (patch)
tree3e90ad3a775b938b581e7eb49075dc552da22b02 /Doc
parent961aaf5cfa2f5585ab72f940d3329d9f425cbe34 (diff)
downloadcpython-a90032a3fb526916a95595a7f3f570dadf9d9380.zip
cpython-a90032a3fb526916a95595a7f3f570dadf9d9380.tar.gz
cpython-a90032a3fb526916a95595a7f3f570dadf9d9380.tar.bz2
#1343: Add short_empty_elements option to XMLGenerator.
Patch and tests by Neil Muller.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/xml.sax.utils.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/xml.sax.utils.rst b/Doc/library/xml.sax.utils.rst
index 95099f6..ff36fd8 100644
--- a/Doc/library/xml.sax.utils.rst
+++ b/Doc/library/xml.sax.utils.rst
@@ -50,13 +50,19 @@ or as base classes.
using the reference concrete syntax.
-.. class:: XMLGenerator(out=None, encoding='iso-8859-1')
+.. class:: XMLGenerator(out=None, encoding='iso-8859-1', short_empty_elements=False)
This class implements the :class:`ContentHandler` interface by writing SAX
events back into an XML document. In other words, using an :class:`XMLGenerator`
as the content handler will reproduce the original document being parsed. *out*
should be a file-like object which will default to *sys.stdout*. *encoding* is
the encoding of the output stream which defaults to ``'iso-8859-1'``.
+ *short_empty_elements* controls the formatting of elements that contain no
+ content: if *False* (the default) they are emitted as a pair of start/end
+ tags, if set to *True* they are emitted as a single self-closed tag.
+
+ .. versionadded:: 3.2
+ short_empty_elements
.. class:: XMLFilterBase(base)