GetChildElements function
Prototype: |
function GetChildElements(const ElementPath: string): TScriptXMLElementList; |
|
Description: |
The GetChildElements function returns a list of XML elements which are child elements to the specified XML element passed as an TScriptXMLElement object. To learn how to handle a list of XML elements, see the TScriptXMLElementList members section. |
|
Syntax: |
variable := TScriptXMLElement.GetChildElements(ElementPath); |
|
Part |
Description |
|
variable |
A variable declared as an instance of the TScriptXMLElementList class |
|
TScriptXMLElement |
A variable declared as an instance of the TScriptXMLElement class |
|
ElementPath |
A string parameter specifying the name of the required child elements and their location in the XML structure using the "/" delimiter - see the Example (TScriptXMLElementList). |
|
Return value: |
A list of child elements of the specified XML element as an instance of the TScriptXMLElementList class |
|
Note: This function is available since version X7.
Example:
var
ElementList: TScriptXMLElementList;
Element: TScriptXMLElement;
i: integer;
AttributeName, LayerName: string;
begin
// open XML document and assign Element
ElementList := Element.GetChildElements('');
for i := 0 to ElementList.GetCount - 1 do
begin
with ElementList.GetElement(i) do
begin
if HasAttribute('LAYER') then
LayerName := GetStringAttributeAsString('LAYER');
if HasAttribute('ATTRIBUTE') then
AttributeName := GetStringAttributeAsString('ATTRIBUTE');
end;
end;
end.
See also:
GetRootElement; GetElementName; GetChildElements; GetFirstChildElement; GetElementText; GetElementInteger; GetElementDouble; GetElementBoolean; GetElementCDATA; HasAttribute; HasNoNullAttribute; GetStringAttribute; GetStringAttributeAsString; GetStringAttributeAsDateTime; GetIntegerAttribute; GetIntegerAttributeAsInteger; GetFloatAttribute; GetFloatAttributeAsVariant; GetFloatAttributeAsFloat; GetBooleanAttribute; GetFirstChildElementStringAttribute; GetFirstChildElementStringAttributeAsString; GetFirstChildElementIntegerAttribute; GetFirstChildElementIntegerAttributeAsInteger; GetFirstChildElementFloatAttribute; GetFirstChildElementFloatAttributeAsVariant; GetFirstChildElementFloatAttributeAsFloat; GetFirstChildElementBooleanAttribute; Name; FreeXMLElement; SaveValuesToTable; GetRootElementName; GetFirstChildElementText; GetFirstChildElementinteger; GetFirstChildElementDouble; GetFirstChildElementboolean
© 2024 IFER-Monitoring and Mapping Solutions