XMLTools
RemoveAttribute
remove an attribute from an XML element
Calling Sequence
Parameters
Description
Examples
RemoveAttribute(xmlTree, attrName)
xmlTree
-
Maple XML tree; XML element
attrName
string; attribute name
The RemoveAttribute(xmlTree, attrName) command removes the attribute whose name is attrName from the XML element xmlTree. A new XML tree is returned that does not contain an attribute by this name.
If the input XML tree xmlTree has no attribute named attrName, then the input tree is returned. In cases such as this, there is no guarantee that the returned tree is distinct from the input tree.
with⁡XMLTools:
x≔XMLElement⁡a,colour=red,size=10,some text:
Print⁡x
<a colour = 'red' size = '10'>some text</a>
Print⁡RemoveAttribute⁡x,colour
<a size = '10'>some text</a>
Print⁡RemoveAttribute⁡x,noSuchAttribute
See Also
XMLTools[AddAttribute]
XMLTools[Attributes]
XMLTools[HasAttribute]
XMLTools[RemoveAttributes]
XMLTools[XMLAttribute]
Download Help Document