Convenience method for adding an element with no children
(self, name, contents=None, attrs=None)
| 12 | |
| 13 | class SimplerXMLGenerator(XMLGenerator): |
| 14 | def addQuickElement(self, name, contents=None, attrs=None): |
| 15 | "Convenience method for adding an element with no children" |
| 16 | if attrs is None: |
| 17 | attrs = {} |
| 18 | self.startElement(name, attrs) |
| 19 | if contents is not None: |
| 20 | self.characters(contents) |
| 21 | self.endElement(name) |
| 22 | |
| 23 | def characters(self, content): |
| 24 | if content and re.search(r"[\x00-\x08\x0B-\x0C\x0E-\x1F]", content): |
no test coverage detected