Export (0) Print
Expand All

errorParameters Method

[This sample code uses features that were implemented only in MSXML 6.0.]

Returns the parameter value for a given index. This parameter value is a string that is used in the construction of the error message. For example, when a validation error is reported on a missing element, the first error parameter, errorParameters(0), shows where the missing element is located and the second error parameter, errorParameters(1), shows which element is missing.

Note Note

The error parameters returned from this method are specific to each error message. An error message might not have any error parameters.

strParam = objXMLDOMParseError2.errorParameters(index);

_bstr_t strParam = objXMLDOMParseError2->errorParameters (index);
HRESULT errorParameters (
    LONG index,
    BSTR *strParam);    

index[in]

A long integer representing the index of an error parameter.

strParam[out,retval]

A BSTR string containing the error parameter of the given index.

S_OK

The error parameter has been retrieved successfully.

E_FAIL

The index is out of bounds and the resultant strParam parameter is NULL.

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 three languages: JScript, Visual Basic, and C++. The output is the same in each language.

Implemented in: MSXML 6.0

Show:
© 2014 Microsoft