Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
XMLTools[AttributeValue] - retrieve the value of an attribute of an XML element
XMLTools[AttributeValueWithDefault] - retrieve the value of an attribute of an XML element, or a specified default value if the attribute is not present
Calling Sequence
AttributeValue(xmlTree, attrName)
AttributeValueWithDefault(xmlTree, attrName, defValue)
Parameters
xmlTree
-
Maple XML tree; XML element
attrName
string; attribute name
defValue
string; default value
Description
The AttributeValue(xmlTree, attrName) command extracts the value of an attribute from the XML element xmlTree. The attribute, whose value is sought, must be specified by its name attrName.
If the attribute attrName is not present in the XML element xmlTree, an error is returned.
Note: Only the attributes that belong to the XML element xmlTree are examined. This function does not examine attributes of any subelements.
The AttributeValueWithDefault(xmlTree, attrName, defValue) command is similar to AttributeValue, except that it takes a third argument defValue. The defValue parameter is a string that specifies a default value for the named attribute attrName if it is not present in the element represented by xmlTree.
Note: Only the attributes that belong to the XML element xmlTree are examined. As in the case of AttributeValue, this function does not examine attributes of any subelements.
Examples
Error, (in XMLTools:-AttributeValue) there is no attribute `color' in the given element
See Also
XMLTools, XMLTools[Attributes], XMLTools[HasAttributes]
Download Help Document