PROPERTY:  ParseError::filepos

This property is a Microsoft extension to the W3C DOM.


The filepos property is read-only and contains the absolute file position where the error occurred.

In the following example the file 'albums.xml' is loaded which includes an error: the letter 'y' has been omitted from the end of the opening 'category' tag of the first 'Album' element. If a parse error occurs, as it does in this case, an alert displays its file position.

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 (JavaScript):
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
err = xml_doc.parseError;
if (err.errorCode != 0) alert("File Position: " + err.filepos);

The alert displays the following message:

File Position: 164

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