Microsoft XML SDK 2.6 - XML Reference

load Method

Loads an XML document from the specified location.

boolValue = oXMLDOMDocument.load(url)

Parameters

url
String containing a URL that specifies the location of the XML file.

Return Value

Boolean. Returns True if the load succeeded; False if the load failed.

Remarks

If the URL cannot be resolved or accessed or does not reference an XML document, this method returns an error and sets the DOMDocument object's documentElement property to null.

The load method can also take any object that supports IStream and the IIS Request object.

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

Note that schemas are not applied when loading XML from a string.

This member is an extension of the W3C DOM.

Example

The following VBScript example creates a DOMDocument object and uses the load method to load a local XML file:

Dim xmlDoc
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")

See Also

Applies To: DOMDocument Object | XML DOM Persistence