Contains the character position within the line where the error occurred.
lValue = oXMLDOMParseError.linepos;
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.5.0"); xmlDoc.async = false; xmlDoc.load("books.xml"); if (xmlDoc.parseError.errorCode != 0) { alert("A parse error occurred on line " + xmlDoc.parseError.line + " at position " + xmlDoc.parseError.linepos); } else { alert(xmlDoc.documentElement.xml); }
lValue = oXMLDOMParseError.linepos
The following Microsoft® Visual Basic® 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.
Dim xmlDoc As New Msxml2.DOMDocument50 xmlDoc.async = False xmlDoc.Load ("books.xml") If xmlDoc.parseError.errorCode <> 0 Then MsgBox ("A parse error occurred on line " & xmlDoc.parseError.Line _ & " at position " & xmlDoc.parseError.linepos) Else MsgBox xmlDoc.documentElement.xml End If
HRESULT get_linepos( long *linePosition);
Long integer. The property is read-only.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button in the upper-left corner of the page.
Applies to: IXMLDOMParseError