XMLTools
XMLElement
general XML element constructor
Calling Sequence
Parameters
Description
Examples
XMLElement(s, attrList, children)
s
-
string; name of the XML element to create
attrList
(optional) list of equations whose left and right sides are strings; attribute equations in the form attrName=attrValue, where attrName is the attribute name and attrValue is the attribute value
children
(optional) sequence or list of XML tree data structures returned by previous calls to the constructor, or other routines that produce XML trees; children of the XML tree
The XMLElement(s, attrList, children) command is the primary constructor used to create XML elements in Maple.
The first argument s is always the name of the element that is created. If no further arguments are included in the calling sequence, then an empty XML element is constructed and returned.
The attrList parameter represents the attributes of the newly constructed element.
If the third argument children is also a list, then it is taken to be a list of all the child elements to place inside the newly formed element returned by the XMLElement constructor.
If the arguments after the second argument are not of type list, they are interpreted as being child elements of the tree node.
If the second argument is not of type list, then all arguments after the first argument are taken to be children of the tree node that is constructed.
with⁡XMLTools:
Print⁡XMLElement⁡a
<a/>
Print⁡XMLElement⁡a,colour=red
<a colour = 'red'/>
Print⁡XMLElement⁡a,,some content
<a>some content</a>
Print⁡XMLElement⁡a,,XMLElement⁡b,colour=blue
<a> <b colour = 'blue'/> </a>
Print⁡XMLElement⁡a,,some content,XMLElement⁡b,colour=blue
<a> some content <b colour = 'blue'/> </a>
Print⁡XMLElement⁡a,colour=red,some content,XMLElement⁡b,colour=blue
<a colour = 'red'> some content <b colour = 'blue'/> </a>
Print⁡XMLElement⁡a,colour=red,style=italic,some content,XMLElement⁡b,colour=blue,more text,still more text
<a colour = 'red' style = 'italic'> some content <b colour = 'blue'>more text</b> still more text </a>
See Also
XMLTools[IsElement]
Download Help Document