Share via

item Property


[This sample code uses features that were first implemented in MSXML 5.0 for Microsoft Office Applications.]

Returns the item from the collection with the specified index. The index starts at zero.

Script Syntax

var objErr = IXMLDOMParseErrorCollection.item(index);  

Visual Basic Syntax

Set objErr = IXMLDOMParseErrorCollection.item(index);  

C/C++ Syntax Using Smart Pointers

IXMLDOMParseError2Ptr objErr=objIXMLDOMParseErrorCollection->item[index];  

C/C++ Syntax

HRESULT get_item(  
    LONG index,  
    IXMLDOMParseError2 **objErr);  


A LONG value specifying a zero-based index as the input.

A pointer to an IXMLDOMParseError2 object corresponding to the specified item index in the error collection.

Return Values

The value returned if successful. The resultant objErr parameter is not NULL.

The value returned if the index is out of bounds.


The following code performs an XSD validation on an XML document that has two invalid <book> nodes. The code then iterates through the resultant error collection, and examines each item retrieved.

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

Applies to

IXMLDOMParseErrorCollection Interface


Implemented in: MSXML 5.0 for Microsoft Office Applications and later

See Also

next Property1
reset Method (IXMLDOMParseErrorCollection)