StripAttributes - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


XMLTools

  

StripAttributes

  

remove all attributes from an XML element

  

StripComments

  

remove all comments from an XML element

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

StripAttributes(xmlTree)

StripComments(xmlTree)

Parameters

xmlTree

-

Maple XML tree; XML element

Description

• 

The StripAttributes(xmlTree) command removes all attributes from the XML element xmlTree and returns the resulting XML tree.

• 

The StripComments(xmlTree) command removes all comment structures from the XML element xmlTree and returns the resulting XML tree.

  

If the input XML tree xmlTree does not have any comments, then the tree is simply returned.

  

Note: When using these functions, attributes and/or comments are removed at all levels (or subelements) of the XML data structure xmlTree, not only the top-level element that it represents. The resulting XML data structure is completely free of attributes and/or _XML_COMMENT calls.

Examples

withXMLTools:

xmlTree1XMLElementa,colour=red,some text,XMLElementb,colour=blue,more text

xmlTree1_XML_Element_XML_ElementTypea,_XML_Attribute_XML_AttrNamecolour,_XML_AttrValuered,_XML_Textsome text,_XML_Element_XML_ElementTypeb,_XML_Attribute_XML_AttrNamecolour,_XML_AttrValueblue,_XML_Textmore text

(1)

StripAttributesxmlTree1

_XML_Element_XML_ElementTypea,,_XML_Textsome text,_XML_Element_XML_ElementTypeb,,_XML_Textmore text

(2)

xmlTree2XMLElementa,colour=red,some text,XMLElementb,,XMLCommenta comment,more text

xmlTree2_XML_Element_XML_ElementTypea,_XML_Attribute_XML_AttrNamecolour,_XML_AttrValuered,_XML_Textsome text,_XML_Element_XML_ElementTypeb,,_XML_Commenta comment,_XML_Textmore text

(3)

StripCommentsxmlTree2

_XML_Element_XML_ElementTypea,_XML_Attribute_XML_AttrNamecolour,_XML_AttrValuered,_XML_Textsome text,_XML_Element_XML_ElementTypeb,,_XML_Textmore text

(4)

See Also

XMLTools

XMLTools[Attributes]

XMLTools[RemoveAttributes]