linepos Property

 

Contains the character position within the line where the error occurred.

Script Syntax

lValue = oXMLDOMParseError.linepos;  

Example

The following script example attempts to load an XML document. If it encounters a parse error, it displays the line and position within that line where the error occurred.

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
  WScript.Echo("A parse error occurred on line " + xmlDoc.parseError.line 
  + " at position " + xmlDoc.parseError.linepos);
} else {
  WScript.Echo(xmlDoc.documentElement.xml);
}

Visual Basic Syntax

lValue = oXMLDOMParseError.linepos  

C/C++ Syntax

HRESULT get_linepos(  
    long *linePosition);  

Parameters

linePosition[out, retval]
The character position within the line 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.

Versioning

Implemented in:

MSXML 3.0, MSXML 6.0

Applies to

IXMLDOMParseError