Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

item Property

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

[Script]

Script Syntax

var objErr = IXMLDOMParseErrorCollection.item(index);
[Visual Basic]

Visual Basic Syntax

Set objErr = IXMLDOMParseErrorCollection.item(index);
[C/C++]

C/C++ Syntax Using Smart Pointers

IXMLDOMParseError2Ptr objErr=objIXMLDOMParseErrorCollection->item[index];

C/C++ Syntax

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

Parameters

index
A LONG value specifying a zero-based index as the input.
objErr
A pointer to an IXMLDOMParseError2 object corresponding to the specified item index in the error collection.

Return Values

S_OK
The value returned if successful. The resultant objErr parameter is not NULL.
E_FAIL
The value returned if the index is out of bounds.

Example

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

Applies To

IXMLDOMParseErrorCollection Interface

Versioning

MSXML 5.0 and later

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

next Property | reset Method