filepos Property

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

filepos Property

Contains the absolute file position where the error occurred.

[Script]

Script Syntax

lValue = oXMLDOMParseError.filepos;

Example

The following script example attempts to load an XML document. If it encounters a parse error, it displays the value of the filepos property.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
   alert(xmlDoc.parseError.filepos);
} else {
   alert(xmlDoc.documentElement.xml);
}
[Visual Basic]

Visual Basic Syntax

lValue = oXMLDOMParseError.filepos

Example

The following example attempts to load an XML document. If it encounters a parse error, it displays the value of the filepos property.

Dim xmlDoc As New Msxml2.DOMDocument50
xmlDoc.async = False
xmlDoc.Load ("books.xml")
If xmlDoc.parseError.errorCode <> 0 Then
   MsgBox xmlDoc.parseError.filepos
Else
   MsgBox xmlDoc.documentElement.xml
End If
[C/C++]

C/C++ Syntax

HRESULT get_filepos(
    long *filePosition);

Parameters

filePosition [out, retval]
The absolute file position where the error occurred.

C/C++ Return Values

S_OK
The value returned if successful.
S_FALSE
The value returned if no error occurred.

Remarks

Long integer. The property is read-only.

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: IXMLDOMParseError