XMLTools - Maple Help

# Online Help

###### All Products    Maple    MapleSim

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

XMLTools

 GetAttribute
 retrieve the value of an attribute from an XML element

 Calling Sequence GetAttribute(xmlTree, attrName)

Parameters

 xmlTree - Maple XML tree; XML element attrName - string; attribute name

Description

 • The GetAttribute(xmlTree, attrName) command retrieves the value of the attribute attrName from the XML element xmlTree as a Maple equation.  If the specified attribute is not present, then the value FAIL is used as the right-hand side of the returned equation.
 Note: The presence of an attribute with a given name is tested by using HasAttribute.

Examples

 > $\mathrm{with}\left(\mathrm{XMLTools}\right):$
 > $\mathrm{GetAttribute}\left(\mathrm{XMLElement}\left("a",\left["b"="c"\right],"some text"\right),"b"\right)$
 ${"b"}{=}{"c"}$ (1)
 > $\mathrm{GetAttribute}\left(\mathrm{XMLElement}\left("a",\left["b"="c"\right],"some text"\right),"d"\right)$
 ${"d"}{=}{\mathrm{FAIL}}$ (2)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam