Microsoft XML SDK 2.6 - XML Reference

reason Property

Explains the reason for the error.

strValue = oXMLDOMParseError.reason

Remarks

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

Example

The following VBScript 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:

Dim xmlDoc
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
If xmlDoc.parseError.errorcode <> 0 Then
   MsgBox xmlDoc.parseError.reason
Else
  MsgBox xmlDoc.documentElement.xml
End If

See Also

Applies To: XMLDOMParseError Object