4D v14.3

DOM GET XML CHILD NODES

Home

 
4D v14.3
DOM GET XML CHILD NODES

DOM GET XML CHILD NODES 


 

DOM GET XML CHILD NODES ( elementRef ; childTypesArr ; nodeRefsArr ) 
Parameter Type   Description
elementRef  Text in XML element reference
childTypesArr  Longint array in Types of child nodes
nodeRefsArr  Text array in References or Values of child nodes

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 Longint 2
XML processing instruction Longint 3
XML DATA Longint 6
XML CDATA Longint 7
XML DOCTYPE Longint 10
XML ELEMENT Longint 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 <Br/>)
$typeArr{3}=6$textArr{3} = "New"
$typeArr{4}=11$textArr{4} = "AEF1237897734568" (element reference <Br/>)
$typeArr{5}=6$textArr{5} = "York"

 
PROPERTIES 

Product: 4D
Theme: XML DOM
Number: 1081

 
HISTORY 

Created: 4D v12

 
SEE ALSO 

DOM Append XML child node
DOM Get XML document ref

 
ARTICLE USAGE

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)