RemoveAttribute - Maple Help

XMLTools

 RemoveAttribute
 remove an attribute from an XML element

 Calling Sequence RemoveAttribute(xmlTree, attrName)

Parameters

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

Description

 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{XMLTools}\right):$
 > $x≔\mathrm{XMLElement}\left("a",\left["colour"="red","size"="10"\right],"some text"\right):$
 > $\mathrm{Print}\left(x\right)$
 some text
 > $\mathrm{Print}\left(\mathrm{RemoveAttribute}\left(x,"colour"\right)\right)$
 some text
 > $\mathrm{Print}\left(\mathrm{RemoveAttribute}\left(x,"noSuchAttribute"\right)\right)$
 some text