XMLTools
AttrCont
split an XML element into its attributes and content
Calling Sequence
Parameters
Description
Examples
AttrCont(xmlTree)
xmlTree
-
Maple XML tree; XML element
The AttrCont(xmlTree) command separates the attributes and content of an XML element and returns them in an expression sequence of two lists. The first list is a list of equations that represent the attributes, each of whose left and right sides are strings. The second list is a list of expressions that represent the content where each of the expressions is of one of the types function or string.
Except for efficiency, the call AttrCont(xmlTree) is equivalent to using Attributes(xmlTree), ContentModel(xmlTree). When both the content model and the attributes are required, it is more efficient to call AttrCont than to use Attributes and ContentModel individually.
with⁡XMLTools:
xmlTree≔XMLElement⁡a,colour=red,XMLElement⁡b,size=2,some text,more text
xmlTree≔_XML_Element⁡_XML_ElementType⁡a,_XML_Attribute⁡_XML_AttrName⁡colour,_XML_AttrValue⁡red,_XML_Element⁡_XML_ElementType⁡b,_XML_Attribute⁡_XML_AttrName⁡size,_XML_AttrValue⁡2,_XML_Text⁡some text,_XML_Text⁡more text
AttrCont⁡xmlTree
_XML_Attribute⁡_XML_AttrName⁡colour,_XML_AttrValue⁡red,_XML_Element⁡_XML_ElementType⁡b,_XML_Attribute⁡_XML_AttrName⁡size,_XML_AttrValue⁡2,_XML_Text⁡some text,_XML_Text⁡more text
See Also
XMLTools[Attributes]
XMLTools[ContentModel]
Download Help Document