TXTextControl.XmlElement.GetChildItem Method

Returns an XML Element object that represents a child element of this element.

GetChildItem(String)

Returns the first XML child element with the specified name.

[C#]
public XmlElement GetChildItem(string name);
[Visual Basic]
Public Function GetChildItem(ByVal name As String) As XmlElement
Parameter Description
name

Specifies the name of the sub-element.

GetChildItem(String, Int32)

Returns the XML child element with the specified name and index.

[C#]
public XmlElement GetChildItem(string name, int index);
[Visual Basic]
Public Function GetChildItem(ByVal name As String, ByVal index As Integer) As XmlElement
Parameter Description
name

Specifies the name of the sub-element.

index

Specifies the number of the sub-element beginning with 1. If this value does not match any existing sub-element, an error occurs.

Return Value

The return value is a valid XmlElement object.

Example

The following example gets the Telephone element from the second address in an XML document that contains adresses consisting of the sub-elements Name, Street, City and Telephone:

[C#]
XmlElement element = textControl1.GetXmlElements("Adress").GetItem(2).GetChildItem("Telephone");
[Visual Basic]
Dim Element As XmlElement = TextControl1.GetXmlElements("Adress").GetItem(2).GetChildItem("Telephone")

See Also