GetChildItem Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Returns an XML Element object that represents a child element of this element.
Syntax
GetChildItem(string)
Returns the first XML child element with the specified name.
public XmlElement GetChildItem(string name);Public Function GetChildItem(name As String) As XmlElement| Parameter | Description |
|---|---|
| name | Specifies the name of the sub-element. |
GetChildItem(string, int)
Returns the XML child element with the specified name and index.
public XmlElement GetChildItem(string name, int index);Public Function GetChildItem(name As String, 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.
Examples
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:
XmlElement element = textControl1.GetXmlElements("Adress").GetItem(2).GetChildItem("Telephone");Dim Element As XmlElement = TextControl1.GetXmlElements("Adress").GetItem(2).GetChildItem("Telephone")The following example retrieves child item from the xml element.
XmlElement result = xmlElement.GetChildItem("CustomerName", 1);
result?.Select();Dim result As XmlElement = xmlElement.GetChildItem("CustomerName", 1)
If result IsNot Nothing Then result.Select()