@XMLGetFirstChild
Syntax
@XMLGetFirstChild(XMLN);
Description
This @Function retrieves the first direct child XML element of an XML node.
Only XML elements are considered. Other node types, such as text, comment, or CDATA nodes, are skipped.
The flags inherited from the supplied XML node handle are also applied to the returned XML node handle.
VSPECHXMLNODE XMLN:
Handle of the XML node whose first child element is to be retrieved.
XMLN must contain a valid VSPECHXMLNODE (XMLN) handle that references an XML node.
Return Value:
If a child XML element is found, the @Function returns a VSPECHXMLNODE (XMLN) handle referencing the first direct child element.
If the XML node has no child XML element or the supplied XML node handle is invalid, the @Function returns @ERROR.
Example: @XMLGetFirstChild(XMLN);
XML := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<customer>" +
" <name>Example GmbH</name>" +
" <city>Berlin</city>" +
"</customer>";
hXMLD := @XMLParse(XML);
hXMLRoot := @XMLGetRoot(hXMLD);
hXMLChild := @XMLGetFirstChild(hXMLRoot);
Name := @XMLGetName(hXMLChild);
@XMLRelease(hXMLD);
The example retrieves the first child XML element of the root element. Name then contains the value "name".
Note : This text was machine-translated and may contain inaccuracies.
