FirstChild - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


XMLTools

  

FirstChild

  

extract the first child node of an XML tree

  

SecondChild

  

extract the second child node of an XML tree

  

ThirdChild

  

extract the third child node of an XML tree

  

LastChild

  

extract the last child node of an XML tree

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

FirstChild(xmlTree)

SecondChild(xmlTree)

ThirdChild(xmlTree)

LastChild(xmlTree)

Parameters

xmlTree

-

Maple XML tree; XML element

Description

• 

Each of these routines accesses a particular child of the given XML element xmlTree. The returned expression is either of type string (NULL is returned in the case of a plain text child node) or an XML tree data structure (when the child node has a tree structure of its own).

  

Each of these procedures is a specialization of the GetChild routine for common special cases. For instance, SecondChild retrieves the second content element of xmlTree if there are at least two such children. Otherwise, NULL is returned.

Examples

withXMLTools:

xXMLElementa,colour=red,XMLElementb,,foo,XMLElementc,,bar,XMLElementd,,baz:

Printx

<a colour = 'red'>
  <b>foo</b>
  <c>bar</c>
  <d>baz</d>
</a>

PrintFirstChildx

<b>foo</b>

PrintSecondChildx

<c>bar</c>

PrintThirdChildx

<d>baz</d>

PrintLastChildx

<d>baz</d>

See Also

XMLTools

XMLTools[GetChild]

XMLTools[HasChild]