Ejemplo n.º 1
0
 def pretty_print(self):
     """A version of the XML document which should be slightly more readable on the command line."""
     return etree.tostring(self.entry, pretty_print=True)
Ejemplo n.º 2
0
 def __str__(self):
     """Export the XML to a bytestring, ready for use"""
     xml_str = etree.tostring(self.entry)
     if not xml_str.startswith('<?xml version="1.0"?>'):
         xml_str = '<?xml version="1.0"?>' + xml_str
     return xml_str
 def to_xml(self):
     """Convenience method for outputing the DOM as a (byte)string."""
     return etree.tostring(self.dom)
Ejemplo n.º 4
0
 def to_xml(self):
     """Convenience method for outputing the DOM as a (byte)string."""
     return etree.tostring(self.dom)
Ejemplo n.º 5
0
 def pretty_print(self):
     """A version of the XML document which should be slightly more readable on the command line."""
     return etree.tostring(self.entry, pretty_print=True)
Ejemplo n.º 6
0
 def __str__(self):
     """Export the XML to a bytestring, ready for use"""
     xml_str = etree.tostring(self.entry)
     if not xml_str.startswith('<?xml version="1.0"?>'):
         xml_str = '<?xml version="1.0"?>' + xml_str
     return xml_str