XMLTools[StripAttributes] - remove all attributes from an XML element
XMLTools[StripComments] - remove all comments from an XML element
|
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
|
|
>
|
|
>
|
|
![xmlTree1 := _XML_Element(_XML_ElementType("a"), [_XML_Attribute(_XML_AttrName("colour"), _XML_AttrValue("red"))], [_XML_Text("some text"), _XML_Element(_XML_ElementType("b"), [_XML_Attribute(_XML_AttrName("colour"), _XML_AttrValue("blue"))], [_XML_Text("more text")])])](/support/helpjp/helpview.aspx?si=7762/file03471/math76.png)
| (1) |
>
|
|
![_XML_Element(_XML_ElementType("a"), [], [_XML_Text("some text"), _XML_Element(_XML_ElementType("b"), [], [_XML_Text("more text")])])](/support/helpjp/helpview.aspx?si=7762/file03471/math83.png)
| (2) |
>
|
![xmlTree2 := XMLElement("a", ["colour" = "red"], ["some text", XMLElement("b", [], XMLComment("a comment"), "more text")])](/support/helpjp/helpview.aspx?si=7762/file03471/math87.png)
|
![xmlTree2 := _XML_Element(_XML_ElementType("a"), [_XML_Attribute(_XML_AttrName("colour"), _XML_AttrValue("red"))], [_XML_Text("some text"), _XML_Element(_XML_ElementType("b"), [], [_XML_Comment("a comment"), _XML_Text("more text")])])](/support/helpjp/helpview.aspx?si=7762/file03471/math90.png)
| (3) |
>
|
|
![_XML_Element(_XML_ElementType("a"), [_XML_Attribute(_XML_AttrName("colour"), _XML_AttrValue("red"))], [_XML_Text("some text"), _XML_Element(_XML_ElementType("b"), [], [_XML_Text("more text")])])](/support/helpjp/helpview.aspx?si=7762/file03471/math97.png)
| (4) |
|
|