Contains the error code of the last parse error.
lValue = oXMLDOMParseError.errorCode;
The following script example attempts to load an XML document. If it encounters a parse error, it displays the error code.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
alert(xmlDoc.parseError.errorCode);
} else {
alert(xmlDoc.documentElement.xml);
}
lValue = oXMLDOMParseError.errorCode
The following Microsoft® Visual Basic® example attempts to load an XML document. If it encounters a parse error, it displays the error code.
Dim xmlDoc As New Msxml2.DOMDocument50
xmlDoc.async = False
xmlDoc.Load ("books.xml")
If xmlDoc.parseError.errorCode <> 0 Then
MsgBox xmlDoc.parseError.errorCode
Else
MsgBox xmlDoc.documentElement.xml
End If
HRESULT get_errorCode(
long *errorCode);
Long integer. The property is read-only. It returns the error code in decimal.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
Applies to: IXMLDOMParseError