次の方法で共有


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

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

JScript Syntax

strParam = objXMLDOMParseError2.errorParameters(index);  

C/C++ Syntax Using Smart Pointers

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

Parameters

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.

Return Values

S_OK
The error parameter has been retrieved successfully.

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

Example

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.

Applies to

IXMLDOMParseError2 Interface

Versioning

Implemented in: MSXML 6.0