Nodeto use as the root of the DOM tree or subtree for which to construct an XML representation.
A string containing the XML representation of the specified DOM tree.
Thrown if the tree could not be successfully serialized, probably due to issues with the content's compatibility with XML serialization.
Thrown if a serialization of HTML was requested but could not succeed due to the content not being well-formed.
The following types are also permitted as descendants of the root node, in addition to
If any other type is encountered, a
TypeError exception is thrown.
There are some things worth noting about the XML output by
For XML serializations,
Attrnodes are always serialized with their
namespaceURIintact. This may mean that a previously-specified
prefixor default namespace may be dropped or altered.
- The resulting XML is compatible with the HTML parser.
Elements in the HTML namespace that have no child nodes (thereby representing empty
tags) are serialized with both begin and end tags
"<someelement></someelement>") instead of using the empty-element tag (
|DOM Parsing and Serialization |
BCD tables only load in the browser