XMLTools
GetChildByName
access a child node of an XML tree
Calling Sequence
Parameters
Description
Examples
GetChildByName(xmlTree, name)
xmlTree
-
Maple XML tree; XML element
name
string or symbol; the name of the child element to extract
The GetChildByName(xmlTree, name) command accesses the children of the given XML element xmlTree with element name equal to name. A list of all children that are elements with element type equal to name is returned.
with⁡XMLTools:
xmlTree≔XMLElement⁡a,,XMLElement⁡b,,b text,XMLElement⁡c,,c text,XMLElement⁡b,,more b text:
Print⁡xmlTree
<a> <b>b text</b> <c>c text</c> <b>more b text</b> </a>
map⁡Print,GetChildByName⁡xmlTree,b
<b>b text</b> <b>more b text</b>
map⁡Print,GetChildByName⁡xmlTree,c
<c>c text</c>
map⁡Print,GetChildByName⁡xmlTree,nosuchelement
See Also
XMLTools[GetChild]
XMLTools[HasChild]
XMLTools[Print]
XMLTools[RemoveChild]
XMLTools[XMLElement]
Download Help Document