コード例 #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
コード例 #3
0
 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