4D v14.3

DOM Get first child XML element

Home

 
4D v14.3
DOM Get first child XML element

DOM Get first child XML element 


 

DOM Get first child XML element ( elementRef {; childElemName {; childElemValue}} ) -> Function result 
Parameter Type   Description
elementRef  String in XML element reference
childElemName  String in Name of child XML element
childElemValue  String in Value of child XML element
Function result  String in Child XML element reference (16 characters)

The DOM Get first child 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.

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_TEXT($xml_Parent_Ref;$xml_Child_Ref)
 
 DOCUMENT TO BLOB("c:\\import.xml";myBlobVar)
 $xml_Parent_Ref:=DOM Parse XML variable(myBlobVar)
 $xml_Child_Ref:=DOM Get first child XML element($xml_Parent_Ref)

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_TEXT($xml_Parent_Ref;$xml_Child_Ref)
 C_TEXT($childName;$childValue)
 
 DOCUMENT TO BLOB("c:\\import.xml";myBlobVar)
 $xml_Parent_Ref:=DOM Parse XML variable(myBlobVar)
 $xml_Child_Ref:=DOM Get first child XML element($xml_Parent_Ref;$childName;$childValue)

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

 
PROPERTIES 

Product: 4D
Theme: XML DOM
Number: 723

The OK variable is changed by the command

 
HISTORY 

Modified: 4D 2004.2

 
SEE ALSO 

DOM Get next sibling XML element

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)