Name

Document.loadXML( ): populate this Document by parsing a string of XML markup — Internet Explorer:

Synopsis

void loadXML(Stringtext)

Arguments

text

The XML markup to parse.

Description

This IE-specific method parses the specified string of XML text and builds a tree of DOM nodes in the current Document object, discarding any nodes that previously existed in the Document.

This method does not exist on Document objects that represent HTML documents. Before calling loadXML( ), you typically create a new, empty Document to hold the parsed content:

var doc = new ActiveXObject("MSXML2.DOMDocument");
doc.loadXML(markup);

See DOMParser.parseFromString( ) for a non-IE alternative.

See Also

DOMParser.parseFromString( )

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.