XMLTools[AddAttribute] - add an attribute to an XML element
|
Calling Sequence
|
|
AddAttribute(xmlTree, attrName, attrValue)
AddAttribute(xmlTree, attr)
|
|
Parameters
|
|
xmlTree
|
-
|
Maple XML tree; XML element
|
attrName
|
-
|
string; attribute name
|
attrValue
|
-
|
string; attribute value
|
attr
|
-
|
equation of the form attrName = attrValue; attribute specification
|
|
|
|
|
Description
|
|
•
|
The AddAttribute(xmlTree, attr) command creates a new XML element from a given one by adding the specified attributes. The AddAttribute(xmlTree, attrName, attrValue) form of the calling sequence is equivalent to the AddAttribute(xmlTree, attr) form.
|
•
|
The input tree xmlTree must not already have an attribute with the specified attribute name . The behavior of this function is unspecified if the XML tree xmlTree already has an attribute named attrName.
|
•
|
The attribute encoded as attrName = attrValue is added to the attributes of xmlTree, and the new XML tree is returned. The position of the new attribute among any other attributes that may already exist in the tree is unspecified.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
The next example returns an error since the attribute value is not of type string.
>
|
|
>
|
|
|
|
Download Help Document
Was this information helpful?