Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project











PROPERTY:  ParseError::errorCode

This property is a Microsoft extension to the W3C DOM.

ParseError.errorCode

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.

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

XML:
<Albums>
   <Album ref="CD720">
      <category>Pop<category>
      <title>Come On Over</title>
      <artist>Shania Twain</artist>
   </Album>
   <Album ref="CD024">
      <category>Country</category>
      <title>Red Dirt Girl</title>
      <artist>Emmylou Harris</artist>
   </Album>
</Albums>

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

The alert displays the following message:

Output:
Error Code: -1072896659




 


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