summaryrefslogtreecommitdiff
path: root/django/utils/xmlutils.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-07-13 01:25:57 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-07-13 01:25:57 +0000
commited114e15106192b22ebb78ef5bf5bce72b419d13 (patch)
treef7c27f035cca8d50bd69e2ecbd7497fccec4a35a /django/utils/xmlutils.py
parent07ffc7d605cc96557db28a9e35da69bc0719611b (diff)
downloaddjango-ed114e15106192b22ebb78ef5bf5bce72b419d13.tar.gz
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
Diffstat (limited to 'django/utils/xmlutils.py')
-rw-r--r--django/utils/xmlutils.py13
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)