XMLTools[GetChild] - access a child node of an XML tree
|
Calling Sequence
|
|
GetChild(xmlTree, n)
|
|
Parameters
|
|
xmlTree
|
-
|
Maple XML tree; XML element
|
n
|
-
|
positive integer; which child to extract from the XML element
|
|
|
|
|
Description
|
|
•
|
The GetChild(xmlTree, n) command accesses the child of the given XML element xmlTree at position n. The returned expression is either of type string or an XML tree data structure (when the child node has a tree structure of its own).
|
•
|
Child elements are numbered sequentially in the order they appear in the element. Attributes that might also be present in the element are not counted in the positioning. Therefore, the expressions GetChild(xmlTree, n) and GetChild(ContentModel(xmlTree ), n) return the same result. (The first form is slightly more efficient.)
|
•
|
The procedure that contains the GetChild command must verify if the child index n is valid.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
<a>
<first/>
<second/>
<third/>
</a>
| |
>
|
|
>
|
|
>
|
|
>
|
|
<a>
<first/>
<second>
text
<foo/>
more text
</second>
<third/>
</a>
| |
>
|
|
<second>
text
<foo/>
more text
</second>
| |
|
|
Download Help Document
Was this information helpful?