Share via


reason Property1

 

Describes the reason for the error.

Script Syntax

strValue = oXMLDOMParseError.reason;  

Example

The following script example attempts to load an XML document. If it encounters a parse error, it uses the ParseError object's reason property to display the reason the error occurred.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
   WScript.Echo(xmlDoc.parseError.reason);
} else {
   WScript.Echo(xmlDoc.documentElement.xml);
}

Visual Basic Syntax

strValue = oXMLDOMParseError.reason  

C/C++ Syntax

HRESULT get_reason(  
    BSTR *reasonString);  

Parameters

reasonString[out, retval]
The reason for the error. This displays a description of the error. A validation error also includes the URL of the schema and the node within the schema that corresponds to the error.

C/C++ Return Values

S_OK
The value returned if successful.

S_FALSE
The value returned if no error occurred.

Remarks

String. The property is read-only. It displays a description of the error. A validation error also includes the URL of the schema and the node within the schema that corresponds to the error.

Versioning

Implemented in:

MSXML 3.0, MSXML 6.0

Applies to

IXMLDOMParseError