XML DOM loadXML() method
Definition and usage
The loadXML() method of XML DOM 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 constructs a DOM node tree in the current document object, discarding any nodes that existed in the document previously.
This method represents the HTML document Document objectdoes not exist. It is usually created a new, empty Document objectto save the parsed content:
var doc = new ActivexObject("MSXML2.DOMDocument"); doc.loadXML(markup);
See DOMParser.parseFromString() for a non-IE alternative method.