access a child node of an XML tree - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Web Features : XMLTools : XMLTools/GetChildByName

XMLTools[GetChildByName] - access a child node of an XML tree

Calling Sequence

GetChildByName(xmlTree, name)

Parameters

xmlTree

-

Maple XML tree; XML element

name

-

string or symbol; the name of the child element to extract

Description

• 

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.

Examples

withXMLTools:

xmlTree:=XMLElementa,,XMLElementb,,b text,XMLElementc,,c text,XMLElementb,,more b text:

PrintxmlTree

<a>
  <b>b text</b>
  <c>c text</c>
  <b>more b text</b>
</a>

mapPrint&comma;GetChildByNamexmlTree&comma;b

<b>b text</b>

<b>more b text</b>

(1)

mapPrint&comma;GetChildByNamexmlTree&comma;c

<c>c text</c>

(2)

mapPrint&comma;GetChildByNamexmlTree&comma;nosuchelement

(3)

See Also

XMLTools, XMLTools[GetChild], XMLTools[HasChild], XMLTools[Print], XMLTools[RemoveChild], XMLTools[XMLElement]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam