url Property (IXMLDOMParseError)
Contains the URL of the XML document containing the last error.
strValue = oXMLDOMParseError.url;
Example
The following script example attempts to load an XML document. If it encounters a parse error, it displays the URL of the document containing the error.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0"); xmlDoc.async = false; xmlDoc.load("books.xml"); if (xmlDoc.parseError.errorCode != 0) { var myErr = xmlDoc.parseError; WScript.Echo("You have error " + myErr.reason); } else { if (xmlDoc.parseError.errorCode != 0) { WScript.Echo(xmlDoc.parseError.url); } else { WScript.Echo(xmlDoc.documentElement.xml); } }
strValue = oXMLDOMParseError.url
HRESULT get_url(
BSTR *urlString);
Parameters
urlString[out, retval]
The URL of the XML file containing the error.
C/C++ Return Values
S_OK
The value returned if successful.
S_FALSE
The value returned if no error occurred.
String. The property is read-only.
Implemented in:
MSXML 3.0, MSXML 6.0
Show: