Package org.teavm.jso.dom.xml
Class XMLSerializer
java.lang.Object
org.teavm.jso.dom.xml.XMLSerializer
- All Implemented Interfaces:
JSObject
The XMLSerializer interface provides the ability to construct an XML string
representing a DOM tree.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XMLSerializer
create()
abstract String
serializeToString(Node rootNode)
Constructs a string representing the specified DOM tree in XML form.
-
Constructor Details
-
XMLSerializer
public XMLSerializer()
-
-
Method Details
-
create
-
serializeToString
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 aNode
orAttr
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.
-