GetStringAttributeAsString function
Prototype: |
function GetStringAttributeAsString(const AttributeName: string): string; |
|
Description: |
Use the GetStringAttributeAsString function to obtain a string value of the specified attribute as a string. |
|
Syntax: |
variable := TScriptXMLElement.GetStringAttributeAsString(AttributeName); |
|
Part |
Description |
|
variable |
A variable declared as a string |
|
TScriptXMLElement |
A variable declared as an instance of the TScriptXMLElement class |
|
AttributeName |
A string parameter specifying the attribute of the given XML element |
|
Return value: |
A string value of the specified attribute as a string |
|
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