Overview of the XMLTools Package
Calling Sequence
Description
List of XMLTools Package Commands
XMLTools:-command(arguments)
command(arguments)
Extensible Markup Language (XML) is a markup language designed to permit the structured encoding of documents and data in a form that is both human- and machine-readable. The XML standard is a publicly available document that can be viewed or downloaded by using a web browser at http://www.w3c.org/XML/.
The XMLTools package is a collection of commands for manipulating Maple internal representation of XML documents as tree data structures. The package provides a (validating) parser, formatter, access to an XSLT engine, and a number of utilities that define an XML document as an abstract data type.
One purpose of this package is to make it unnecessary to know the storage format for XML documents in Maple by providing access to the element structure information set (ESIS) of the document via Maple routines. (The storage format for XML documents used in Maple is not documented, and is subject to change.)
You should never access any part of a Maple representation of an XML document except by using the commands in the XMLTools package.
Each command in the XMLTools package can be accessed by using either the long form or the short form of the command name in the command calling sequence.
The long form, XMLTools:-command, is always available. The short form can be used after loading the package.
The following is a list of available commands.
AddAttribute
AddChild
ApplyElement
AttrCont
AttributeCount
AttributeNames
Attributes
AttributeTable
AttributeValue
AttributeValueWithDefault
CDataData
CleanEntities
CleanXML
CommentText
Compare
ContentModel
ContentModelCount
ElementName
ElementStatistics
ElementType
ElementTypeName
ElementTypePrefix
ElementTypeURI
EntityName
Equal
FirstChild
GetAttribute
GetChild
GetChildByName
HasAttribute
HasChild
IsAttribute
IsCData
IsComment
IsElement
IsEntity
IsProcessingInstruction
IsText
IsTree
LastChild
ParseFile
ParseString
Print
PrintToFile
PrintToString
ProcessAttributes
ProcessingInstructionData
ProcessingInstructionName
RemoveAttribute
RemoveAttributes
RemoveChild
RemoveContent
ReplaceChild
SecondChild
SelectAttributes
SelectContent
SelectRemoveAttributes
SelectRemoveContent
Serialize
StripAttributes
StripComments
SubsAttribute
SubsAttributeName
TextText
ThirdChild
ToRecord
ToString
Transform
Validate
WriteFile
XMLAttribute
XMLCData
XMLComment
XMLDocument
XMLElement
XMLEntity
XMLProcessingInstruction
XMLText
To display the help page for a particular XMLTools command, see Getting Help with a Command in a Package.
Most routines that operate on an XML tree data structure change the tree structure in some way, returning a copy of the input tree with the modification implied by the routine. The representation used is immutable. (There is no way to modify an XML tree data structure ``in place.'' In contrast to many XML APIs written in object oriented languages such as C++ or Java, which provide direct access to a DOM representation of XML instances, Maple's XML APIs present to the user the Document Value Model of an XML instance.)
For performance reasons, in routines that accept a Maple XML tree data structure as an argument, type checking of this argument is limited to a surface type check. When debugging code, assertions can be used to further validate that the argument is an XML tree.
See Also
help
MathML
module
UsingPackages
with
Worksheet
Download Help Document