PROPERTY:  ParseError::errorCode

This property is a Microsoft extension to the W3C DOM.


The errorCode property is read-only and returns a decimal error code of the last parse error.

In the following example the file 'albums.xml' is loaded which includes an error: the slash (/) is missing from the closing 'category' tag of the first 'Album' element. If a parse error occurs, as it does in this case, an alert displays the error code.

Where no parse error occurs, the errorCode property returns 0.

   <Album ref="CD720">
      <title>Come On Over</title>
      <artist>Shania Twain</artist>
   <Album ref="CD024">
      <title>Red Dirt Girl</title>
      <artist>Emmylou Harris</artist>

Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
Set ParseErr = objXMLDoc.parseError
If ParseErr.errorCode <> 0 Then
   alert("Error Code: " & ParseErr.errorCode)
End If

The alert displays the following message:

Error Code: -1072896659

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information