Ejemplo n.º 1
0
  def to_string(self, version=1, encoding=None, pretty_print=None):
    """Converts this object to XML."""

    tree_string = ElementTree.tostring(self._to_tree(version, encoding))

    if pretty_print and xmlString is not None:
        return xmlString(tree_string).toprettyxml()
 
    return tree_string
Ejemplo n.º 2
0
    def to_string(self, version=1, encoding=None, pretty_print=None):
        """Converts this object to XML."""

        tree_string = ElementTree.tostring(self._to_tree(version, encoding))

        if pretty_print and xmlString is not None:
            return xmlString(tree_string).toprettyxml()

        return tree_string
Ejemplo n.º 3
0
  def to_string(self, version=1, encoding=None, pretty_print=None):
    """Converts this object to XML."""

    tree_string = ElementTree.tostring(self._to_tree(version, encoding))

    if pretty_print and xmlString is not None:
        return xmlString(tree_string).toprettyxml()
 
    if isinstance(tree_string, str):
      return tree_string
    else:
      # For Python 3
      return tree_string.decode()
Ejemplo n.º 4
0
    def to_string(self, version=1, encoding=None, pretty_print=None):
        """Converts this object to XML."""

        tree_string = ElementTree.tostring(self._to_tree(version, encoding))

        if pretty_print and xmlString is not None:
            return xmlString(tree_string).toprettyxml()

        if isinstance(tree_string, str):
            return tree_string
        else:
            # For Python 3
            return tree_string.decode()