Start serialization -- open the XML document and the root element.
(self)
| 25 | ) |
| 26 | |
| 27 | def start_serialization(self): |
| 28 | """ |
| 29 | Start serialization -- open the XML document and the root element. |
| 30 | """ |
| 31 | # Increment the indent_level before each startElement() and decrement |
| 32 | # it following each endElement(). If the closing tag should appear on |
| 33 | # its own line, use self.indent(self.indent_level) before endElement(). |
| 34 | self.indent_level = 0 |
| 35 | self.xml = SimplerXMLGenerator( |
| 36 | self.stream, self.options.get("encoding", settings.DEFAULT_CHARSET) |
| 37 | ) |
| 38 | self.xml.startDocument() |
| 39 | self.xml.startElement("django-objects", {"version": "1.0"}) |
| 40 | |
| 41 | def end_serialization(self): |
| 42 | """ |
nothing calls this directly
no test coverage detected