Skip to main content
Version: 20 R7 BETA

DOM GET XML CHILD NODES

DOM GET XML CHILD NODES ( elementRef ; childTypesArr ; nodeRefsArr )

ParameterTypeDescription
elementRefTextXML element reference
childTypesArrArray integerTypes of child nodes
nodeRefsArrText arrayReferences or Values of child nodes

Description

The DOM GET XML CHILD NODES command returns the types and references or values of all the child nodes of the XML element designated by elementRef.

The types of child nodes are returned in the childTypesArr array. You can compare the values returned by the command with the following constants, found in the "XML" theme:

ConstantTypeValue
XML commentLongint2
XML processing instructionLongint3
XML DATALongint6
XML CDATALongint7
XML DOCTYPELongint10
XML ELEMENTLongint11

For more information, please refer to the description of the DOM Append XML child node command.

The nodeRefsArr array receives the values or references of the elements according to their nature (contents or instructions).

Example

Given the following XML structure:

<myElement>Hello<br/>New<br/>York</myElement>

After executing these instructions:

 elementRef:=DOM Find XML element($root;"myElement")
 DOM GET XML CHILD NODES(elementRef;$typeArr;$textArr)

... the $typeArr and $textArr arrays will contain the following values:

$typeArr{1}=6$textArr{1} = "Hello"
$typeArr{2}=11$textArr{2} = "AEF1233456878977" (element reference
)
$typeArr{3}=6$textArr{3} = "New"
$typeArr{4}=11$textArr{4} = "AEF1237897734568" (element reference
)
$typeArr{5}=6$textArr{5} = "York"

See also

DOM Append XML child node
DOM Get XML document ref