XMLTools
HasAttribute
test whether an XML element has a specified attribute
Calling Sequence
Parameters
Description
Examples
HasAttribute(xmlTree, attrName)
xmlTree
-
Maple XML tree; XML element
attrName
string; attribute name
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.
with⁡XMLTools:
x≔XMLElement⁡a,b=c,some text:
Print⁡x
<a b = 'c'>some text</a>
HasAttribute⁡x,b
true
HasAttribute⁡x,c
false
HasAttribute⁡x,a
HasAttribute⁡x,d
See Also
XMLTools[Attributes]
XMLTools[AttributeValue]
XMLTools[RemoveAttribute]
XMLTools[XMLElement]
Download Help Document