tools/xmlparser: implement writer

This commit is contained in:
nemunaire 2017-07-27 20:44:26 +02:00
commit c8afa65dcb
4 changed files with 70 additions and 3 deletions

View file

@ -53,6 +53,14 @@ class ParsingNode:
return item in self.attrs
def saveElement(self, store, tag=None):
store.startElement(tag if tag is not None else self.tag, self.attrs)
for child in self.children:
child.saveElement(store)
store.characters(self.content)
store.endElement(tag if tag is not None else self.tag)
class GenericNode(ParsingNode):
"""Consider all subtags as dictionnary