XML DOM » Document » loadXML

Compability: Internet Explorer

Syntax:
document.loadXML(xmlString)

This method is used to load an XML document using the supplied string.

The loadXML method is used to load an XML document using the supplied string. It returns the boolean value of true if the load was successful; otherwise it returns false and sets the Document object's documentElement property to null.

Calling loadXML on an existing document immediately discards the content of it.

Examples

Code:
XMLString = "<Venues><venue>The Mayflower Theater</venue>" &_
   "<venue>Carnegie Hall</venue></Venues>"

Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.loadXML(XMLString)

Set Root = objXMLDoc.documentElement
response.write(Root.xml)
Output:
The Mayflower TheaterCarnegie Hall
Explanation:

This example creates an XML string, and uses the loadXML method to load it. The XML of the root element is then displayed.

Language(s): VBScript