Skip to main content
Version: Next

DOM Get last child XML element

DOM Get last child XML element ( elementRef {; childElemName {; childElemValue}} ) : Text

ParameterTypeDescription
elementRefTextXML element reference
childElemNameTextName of child element
childElemValueTextValue of child element
Function resultTextXML element reference

Description

The DOM Get last child XML element command returns an XML reference to the last “child” of the XML element passed as reference in elementRef. This reference may be used with the other XML parsing commands.

The optional childElemName and childElemValue parameters, when passed, receive respectively the name and value of the “child” element.

Example

Recovery of the reference of the last XML element of the parent root. The XML structure (C:\\import.xml) is loaded into a BLOB beforehand:

 var myBlobVar : Blob
 var $ref_XML_Parent;$ref_XML_Child : Text
 var $childName;$childValue : Text
 
 DOCUMENT TO BLOB("c:\\import.xml";myBlobVar)
 $ref_XML_Parent:=DOM Parse XML variable(myBlobVar)
 $ref_XML_Child:=DOM Get last child XML element($ref_XML_Parent;$childName;$childValue)

System variables and sets

If the command has been executed correctly, the system variable OK is set to 1. Otherwise, it is set to 0.

See also

DOM Get first child XML element