예제 #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)
예제 #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)
예제 #4
0
 def to_xml(self):
     """Convenience method for outputing the DOM as a (byte)string."""
     return etree.tostring(self.dom)
예제 #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)
예제 #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