test whether an XML element has a specified attribute - Maple Help

Online Help

All Products    Maple    MapleSim


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

XMLTools[HasAttribute] - test whether an XML element has a specified attribute

Calling Sequence

HasAttribute(xmlTree, attrName)

Parameters

xmlTree

-

Maple XML tree; XML element

attrName

-

string; attribute name

Description

• 

The HasAttribute(xmlTree, attrName) command tests whether an attribute with the name attrName is present in the XML element xmlTree. The value true is returned if the attribute is present in xmlTree. Otherwise, false is returned.

Examples

withXMLTools:

x:=XMLElementa,b=c,some text:

Printx

<a b = 'c'>some text</a>

HasAttributex&comma;b

true

(1)

HasAttributex&comma;c

false

(2)

HasAttributex&comma;a

false

(3)

HasAttributex&comma;d

false

(4)

See Also

XMLTools, XMLTools[Attributes], XMLTools[AttributeValue], XMLTools[RemoveAttribute], 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