ChildItem Method
Returns an XMLElement object that is a child element of this element. If this element has more than one sub-elements of the type with the given name the optional Index parameter can be used to specify the subelement. If Index is omitted Text Control returns the first sub-element with the given name.
Syntax
XMLElement.ChildItem ElementName[, Index]
Parameters
| Parameter | Description |
|---|---|
| ElementName | Specifies the name of the sub-element. |
| Index | Optional. Specifies the number of the subelement. If this value does not match any existing sub-element, an error occurs. |
Return Value
The method returns an XMLElement object.
Examples
The following Basic example gets the Telephone element from the second address in an XML document that contains addresses consisting of the sub-elements Name, Street, City and Telephone:
Dim Telephone As String
Set Addresses = TXTextControl1.XMLElements("Address")
Telephone = Addresses(2).ChildItem("Telephone")