Skip to main content
Version: 21 R4 BETA

DOM Get last child XML element

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

ParameterTypeDescription
elementRefText→XML element reference
childElemNameText←Name of child element
childElemValueany←Value of child element
Function resultText←XML element reference
History
ReleaseChanges
2004.2Created

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

Properties​

Command number925
Thread safeyes
Modifies variablesOK