XMLElements.Item Method

Returns a specific XML element of an XMLElements collection.

Syntax

   XMLElements.Item Index
Parameter Description
Index

Specifies the position of the XML element in the collection. It must be a number from 1 to the value of the collection's Count property. If this value does not match any existing member of the collection, an error occurs.

Return Value

The method returns an XMLElement object.

Data Types

Index:    Long
Return value:    XMLElement Object

Example

The following Basic example displays the content of the second Address element in an XML document that contains addresses. Because the Item method is the default method of the XMLElements collection and the Text property is the default property of the XMLElement object the three lines of code are equivalent:

MsgBox TXTextControl1.XMLElements("Address").Item(2).Text

MsgBox TXTextControl1.XMLElements("Address")(2).Text

MsgBox TXTextControl1.XMLElements("Address")(2)

See Also