XML DOM loadXML() method
Definition and usage
The loadXML() method assembles the document by parsing an XML tag string.
Syntax:
loadXML(text)
Parameter | Description |
---|---|
text | The XML tag to be parsed. |
Description
This specific IE method parses the specified XML text string and then builds a DOM node tree in the current document object, discarding any nodes that previously existed in the document.
This method represents the HTML document Document objectdoes not exist. A new, empty Document objectto save the parsed content:
var doc = new ActivexObject("MSXML2.DOMDocument"); doc.loadXML(markup);
See DOMParser.parseFromString() to understand a non-IE alternative method.