XMLTools - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Web Features : XMLTools : XMLTools/ContentModel

XMLTools

  

ContentModel

  

extract the content model of an XML element

  

ContentModelCount

  

count the number of children of an XML element

 

Calling Sequence

Parameters

Description

Examples

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

withXMLTools:

ContentModelXMLElementa

(1)

ContentModelXMLElementa,foo=bar

(2)

xmlTreeXMLElementa,colour=red,XMLElementb,size=2,some text,more text:

ContentModelxmlTree

_XML_Element_XML_ElementTypeb,_XML_Attribute_XML_AttrNamesize,_XML_AttrValue2,_XML_Textsome text,_XML_Textmore text

(3)

MakeElementElementNamexmlTree,,ContentModelxmlTree

_XML_a_XML_Element_XML_ElementTypeb,_XML_Attribute_XML_AttrNamesize,_XML_AttrValue2,_XML_Textsome text,_XML_Textmore text

(4)

ContentModelCountXMLElementa

0

(5)

ContentModelCountXMLElementa,foo=bar

0

(6)

ContentModelCountXMLElementa,,one,two,three

1

(7)

ContentModelCountxmlTree

2

(8)

See Also

XMLTools

XMLTools[ElementName]

XMLTools[SelectRemoveContent]

XMLTools[XMLElement]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam