Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
errorXPath Property
Collapse the table of content
Expand the table of content

errorXPath Property

This read-only property returns an XPath expression that locates the node where an error occurred. Currently, this property is set only when an error is encountered in schema validation (using XSD). In all other cases, the returned string will be empty.

If there are multiple validation errors, the returned XPath expression points to the first node in the document where errors occurred.

strXPath = objXMLDOMParseError2.errorXPath;

strXPath = objXMLDOMParseError2.errorXPath;

_bstr_t strXPath = objXMLDOMParseError2->errorXPath;

HRESULT get_errorXPath (
    BSTR *strXPath);


A pointer to a BSTR string that contains an XPath expression, or is empty.


The property was retrieved successfully.


Failed to retrieve the property and the resultant strXPath parameter is an empty string.

This example uses the same two resource files used in the allErrors example, books.xml and books.xsd. We've provided source files for the sample in two languages: JScript, and C++. The output is the same in each language.

Implemented in:


© 2015 Microsoft