version 2003
Get First XML element (elementRef{; childElemName{; childElemValue}}) String
| Parameter | Type | Description | |
| elementRef | String | XML element reference | |
| childElemName | String | Name of selected field | |
| childElemValue | String | Value of selected field | |
| Function result | String | XML reference (16 characters) |
Description
The Get First XML element command returns a reference to the first "child" of the XML element passed in elementRef. This reference can be used with other XML parsing commands.
The childElemName and childElemValue parameters, if they are passed, receive respectively the name and the value of the child element.
Examples
(1) Retrieval of the reference of the first XML element of the parent root. The XML structure (C:\\import.xml) is first loaded into a BLOB:
C_BLOB(myBlobVar)
C_STRING(16;$xml_Parent_Ref;$xml_Child_Ref)
DOCUMENT TO BLOB("c:\\import.xml";myBlobVar)
$xml_Parent_Ref:=Parse XML variable(myBlobVar)
$xml_Child_Ref:=Get First XML element($xml_Parent_Ref)
(2) Retrieval of the reference, name and value of the first XML element of the parent root. The XML structure (C:\\import.xml) is first loaded into a BLOB:
C_BLOB(myBlobVar)
C_STRING(16;$xml_Parent_Ref;$xml_Child_Ref)
C_TEXT($childName;$childValue)
DOCUMENT TO BLOB("c:\\import.xml";myBlobVar)
$xml_Parent_Ref:=Parse XML variable(myBlobVar)
$xml_Child_Ref:=Get First XML element($xml_Parent_Ref;$childName;$childValue)
See also
System Variables or Sets
If the command has been correctly executed, the system variable OK is set to 1. Otherwise, it is set to 0.