Microsoft XML SDK 2.6 - XML Reference

srcText Property

Returns the full text of the line containing the error.

strValue = oXMLDOMParseError.srcText

Remarks

String. The property is read-only. It returns an empty string if an error is caused when the XML is not well-formed and the error cannot be assigned to a specific line.

Example

The following VBScript example attempts to load an XML document. If it encounters a parse error, it displays the text of the line containing the error:

Dim xmlDoc
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
If xmlDoc.parseError.errorcode <> 0 Then
  MsgBox xmlDoc.parseError.srcText
Else
  MsgBox xmlDoc.documentElement.xml
End If

See Also

Applies To: XMLDOMParseError Object