DOM Get first child XML element

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2004.2 (Modified)


DOM Get first child XML element (elementRef{; childElemName{; childElemValue}}) String

ParameterTypeDescription
elementRefStringXML element reference
childElemNameStringName of child XML element
childElemValueStringValue of child XML element
Function resultStringChild XML element reference (16 characters)

Description

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.

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:=DOM Parse XML variable(myBlobVar)
   $xml_Child_Ref:=DOM Get first child 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:=DOM Parse XML variable(myBlobVar)
   $xml_Child_Ref:=DOM Get first child XML element($xml_Parent_Ref;$childName;$childValue)

See Also

DOM Get next sibling XML element.

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.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next