DOM GET XML CHILD NODES
DOM GET XML CHILD NODES ( elementRef ; childTypesArr ; nodeRefsArr )
Parameter | Type | Description | |
---|---|---|---|
elementRef | Text | → | XML element reference |
childTypesArr | Array integer | ← | Types of child nodes |
nodeRefsArr | Text array | ← | References 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:
Constant | Type | Value |
---|---|---|
XML comment | Integer | 2 |
XML processing instruction | Integer | 3 |
XML DATA | Integer | 6 |
XML CDATA | Integer | 7 |
XML DOCTYPE | Integer | 10 |
XML ELEMENT | Integer | 11 |
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
Properties
Command number | 1081 |
Thread safe | ✓ |