diff options
Diffstat (limited to 'django/utils/xmlutils.py')
-rw-r--r-- | django/utils/xmlutils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/django/utils/xmlutils.py b/django/utils/xmlutils.py new file mode 100644 index 0000000000..6638573857 --- /dev/null +++ b/django/utils/xmlutils.py @@ -0,0 +1,13 @@ +""" +Utilities for XML generation/parsing. +""" + +from xml.sax.saxutils import XMLGenerator + +class SimplerXMLGenerator(XMLGenerator): + def addQuickElement(self, name, contents=None, attrs={}): + "Convenience method for adding an element with no children" + self.startElement(name, attrs) + if contents is not None: + self.characters(contents) + self.endElement(name) |