Class XMLSerializer

java.lang.Object
org.teavm.jso.dom.xml.XMLSerializer
All Implemented Interfaces:
JSObject

public abstract class XMLSerializer extends Object implements JSObject
The XMLSerializer interface provides the ability to construct an XML string representing a DOM tree.
  • Constructor Details

    • XMLSerializer

      public XMLSerializer()
  • Method Details

    • create

      public static XMLSerializer create()
    • serializeToString

      public abstract String serializeToString(Node rootNode)
      Constructs a string representing the specified DOM tree in XML form.
      Parameters:
      rootNode - The Node to use as the root of the DOM tree or subtree for which to construct an XML representation. The root node itself must be either a Node or Attr object.
      Returns:
      A DOMString containing the XML representation of the specified DOM tree.
      Throws:
      TypeError - The specified rootNode is not a compatible node type. The root node must be either Node or Attr.
      InvalidStateError - The tree could not be successfully serialized, probably due to issues with the content's compatibility with XML serialization.
      SyntaxError - A serialization of HTML was requested but could not succeed due to the content not being well-formed.