HasChild - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


XMLTools

  

HasChild

  

test whether an expression is a child of an XML element

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

HasChild(xmlTree, child)

Parameters

xmlTree

-

Maple XML tree; XML element

child

-

XML element or text object; child element

Description

• 

The HasChild(xmlTree, child) command returns the value true if the expression child is an immediate child of the XML element xmlTree. Otherwise, false is returned.

Examples

> 

with⁡XMLTools:

> 

x≔XMLElement⁡a,,first,XMLElement⁡b,,text,XMLElement⁡c,more text,third:

> 

Print⁡x

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

> 

HasChild⁡x&comma;XMLText⁡third

true

(1)
> 

HasChild⁡x&comma;XMLText⁡text

false

(2)
> 

HasChild⁡x&comma;XMLElement⁡c

false

(3)

See Also

XMLTools

XMLTools[AddChild]

XMLTools[ContentModelCount]

XMLTools[FirstChild]

XMLTools[GetChild]

XMLTools[RemoveChild]

XMLTools[XMLElement]