test whether an expression is a child of an XML element - Maple Help

Online Help

All Products    Maple    MapleSim


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

XMLTools[HasChild] - test whether an expression is a child of an XML element

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

withXMLTools:

x:=XMLElementa,,first,XMLElementb,,text,XMLElementc,more text,third:

Printx

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

HasChildx&comma;XMLTextthird

true

(1)

HasChildx&comma;XMLTexttext

false

(2)

HasChildx&comma;XMLElementc

false

(3)

See Also

XMLTools, XMLTools[AddChild], XMLTools[ContentModelCount], XMLTools[FirstChild], XMLTools[GetChild], 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