Compability: Internet Explorer
This property contains the absolute file position where the error occurred.
XML:
<Albums>
<Album
ref="CD720">
<categor>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>
JavaScript:
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("albums.xml");
err = xml_doc.parseError;
if (err.errorCode != 0) alert("File Position: " + err.filepos);
File Position: 164
In this 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.