From ed114e15106192b22ebb78ef5bf5bce72b419d13 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Wed, 13 Jul 2005 01:25:57 +0000 Subject: Imported Django from private SVN repository (created from r. 8825) git-svn-id: http://code.djangoproject.com/svn/django/trunk@3 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/xmlutils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 django/utils/xmlutils.py (limited to 'django/utils/xmlutils.py') 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) -- cgit v1.2.1