Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
XMLTools[SubsAttribute] - replace an attribute's value in an XML element
XMLTools[SubsAttributeName] - replace an attribute's name in an XML element
Calling Sequence
SubsAttribute(xmlTree, attrName, attrValue)
SubsAttribute(xmlTree, attr)
SubsAttributeName(xmlTree, attrName, newName)
SubsAttributeName(xmlTree, attr2)
Parameters
xmlTree
-
Maple XML tree; XML element
attrName
string; attribute name
attrValue
string; attribute value
attr
equation of the form ; attribute specification
newName
string; new attribute name
attr2
equation of the form ; attribute name specification
Description
The SubsAttribute command replaces the value of attribute attrName with attrValue in the XML element xmlTree.
The attribute can be specified in two ways.
- As a pair consisting of the name attrName of the attribute and its new value attrValue.
- As an equation attr. Specifying the attribute substitution as an equation is equivalent to using SubsAttribute(xmlTree, lhs(attr), rhs(attr)).
A new XML element with the attribute attrName that has the new specified value is returned. The original value of the attribute attrName (which may or may not be the same as the new value attrValue) is discarded.
The SubsAttributeName command replaces the name of an attribute in the XML element xmlTree.
- As a pair consisting of the name attrName of the attribute and its new name newName.
- As an equation attr2 representing the substitution of the old name for the new. Specifying the attribute substitution as an equation attr2 is equivalent to using SubsAttributeName(xmlTree, lhs(attr2), rhs(attr2)).
A new XML element is returned where the original attribute attrName is replaced by one named newName, but newName has the value of the original attribute.
Both of these functions return an error if the XML element represented by xmlTree has no attribute named attrName.
Examples
<a colour = 'red'>some text</a>
<a colour = 'blue'>some text</a>
<a color = 'red'>some text</a>
Error, (in unknown) element does not have an attribute called "color"
See Also
XMLTools, XMLTools[AddAttribute], XMLTools[AttributeNames], XMLTools[Attributes], XMLTools[Print], XMLTools[XMLElement]
Download Help Document