PROPERTY:  ParseError::url

This property is a Microsoft extension to the W3C DOM.

ParseError.url

The url property is read-only and contains the URL of the XML document containing the last error.

In the following example the file 'vocabulary.xml' is loaded which includes an error: the closing 'Spanish' tag of the first 'Word' element is spelled with a lower case 's'. If a parse error occurs, as it does in this case, an alert displays the URL of the XML file where it occurs.

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

XML:
<Vocabulary>
   <Word type="noun" level="1">
      <English>cat</English>
      <Spanish>gato</spanish>
   </Word>
   <Word type="verb" level="1">
      <English>speak</English>
      <Spanish>hablar</Spanish>
   </Word>
</Vocabulary>

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

The alert displays the following message:

Output:
Error in file:
http://www.devguru.com/somedir/vocabulary.xml



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