Ticket #15936: patch.diff
File patch.diff, 814 bytes (added by , 14 years ago) |
---|
-
django/utils/xmlutils.py
5 5 from xml.sax.saxutils import XMLGenerator 6 6 7 7 class SimplerXMLGenerator(XMLGenerator): 8 def addQuickElement(self, name, contents=None, attrs=None ):8 def addQuickElement(self, name, contents=None, attrs=None, escape=True): 9 9 "Convenience method for adding an element with no children" 10 10 if attrs is None: attrs = {} 11 11 self.startElement(name, attrs) 12 12 if contents is not None: 13 self.characters(contents) 13 if escape: 14 self.characters(contents) 15 else: 16 self._write(contents) 14 17 self.endElement(name)