def __str__ (self) : tree = ElementTree () tree._setroot (Element ('Header')) r = tree.getroot () for e in self.header ('HUHU') : r.append (e) return tostring (tree, pretty_print = True, encoding = 'unicode')
def prettify_element(elem): xmlbuf = StringIO() et = ElementTree() et._setroot(elem) et.write(xmlbuf, xml_declaration=True, encoding = 'utf-8', method = "xml") return xml.dom.minidom.parseString(xmlbuf.getvalue()).toprettyxml()
def __prettify_element(self, elem): xmlbuf = BytesIO() et = ElementTree() et._setroot(elem) et.write(xmlbuf, xml_declaration=True, encoding='utf-8', method="xml", pretty_print=True) return xmlbuf.getvalue()
def __prettify_element(self, elem): xmlbuf = BytesIO() et = ElementTree() et._setroot(elem) et.write(xmlbuf, xml_declaration=True, encoding="utf-8", method="xml", pretty_print=True) return xmlbuf.getvalue()