XMLTools[ContentModel] - extract the content model of an XML element
XMLTools[ContentModelCount] - count the number of children of an XML element
|
Calling Sequence
|
|
ContentModel(xmlTree)
ContentModelCount(xmlTree)
|
|
Parameters
|
|
xmlTree
|
-
|
Maple XML tree; XML element
|
|
|
|
|
Description
|
|
•
|
The ContentModel(xmlTree) command returns the content model of the XML element xmlTree. The data is returned in the form of a list of strings or a list of XML trees, and it occurs in the same order as in the input element.
|
|
Note: To remove all the attributes of element xmlTree, leaving the attributes of any subelements unchanged, use XMLElement( ElementName(xmlTree), [], ContentModel(xmlTree)).
|
•
|
The ContentModelCount(xmlTree) command counts the number of children (attributes are not counted) of the XML element xmlTree. The number of children is returned as a non-negative integer.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
>
|
|
![[_XML_Element(_XML_ElementType("b"), [_XML_Attribute(_XML_AttrName("size"), _XML_AttrValue("2"))], [_XML_Text("some text")]), _XML_Text("more text")]](/support/helpjp/helpview.aspx?si=7730/file03439/math92.png)
| (3) |
>
|
|
![_XML_a(_XML_Element(_XML_ElementType("b"), [_XML_Attribute(_XML_AttrName("size"), _XML_AttrValue("2"))], [_XML_Text("some text")]), _XML_Text("more text"))](/support/helpjp/helpview.aspx?si=7730/file03439/math99.png)
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
|
|
Download Help Document
Was this information helpful?