@XMLNodeListGetElements
Syntax
@XMLNodeListGetElements(XMLNL);
Description
This @Function retrieves the number of nodes contained in an XML node list.
VSPECHXMLNODELIST XMLNL:
Handle of the XML node list whose number of elements is to be retrieved.
XMLNL must contain a valid VSPECHXMLNODELIST (XMLNL) handle.
Return Value:
On successful execution, the @Function returns the number of nodes contained in the node list as a numeric value.
If the supplied XML node list handle is invalid or the node list has already been released, the @Function returns @ERROR.
Example: @XMLNodeListGetElements(XMLNL);
XML := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<customers>" +
" <customer id=\"1\" />" +
" <customer id=\"2\" />" +
"</customers>";
hXMLD := @XMLParse(XML);
hXMLRoot := @XMLGetRoot(hXMLD);
hXMLNL := @XMLSelectNodes(hXMLRoot;"customer");
Elements := @XMLNodeListGetElements(hXMLNL);
@XMLNodeListRelease(hXMLNL);
@XMLRelease(hXMLD);
The example retrieves the number of "<customer>" elements contained in the node list. Elements then contains the value 2.
Note : This text was machine-translated and may contain inaccuracies.
