Overview of the MathML Package

Calling Sequence


MathML[command](arguments)
command(arguments)


Description


•

MathML is an evolving Internet standard for the communication of structured mathematical formulae between applications, especially for use on the World Wide Web. The purveyors of Math ML are a committee of the World Wide Web Consortium (W3C) who publish periodic revisions of the standard. The current MathML implementation in Maple is based on revision 2.0 of that standard. The MathML standard is a publicly available document that can be viewed or downloaded by using a Web browser at http://www.w3c.org/Math/. (The precise version of the standard used in the development of this package is given below.)

•

MathML, as a standard, is still in its early stages. It will take time before applications fully comply and for it to fulfill its true potential for offering seamless Web connectivity and operability between applications. We have tried to provide an implementation that complies to the standard as it existed at the time of development, and to provide the necessary tools to help you benefit from this existing standard immediately. For the latest information on MathML, and to get useful applets and other components to take maximum advantage of the standard, visit http://www.maplesoft.com/support/downloads/mathml.aspx.

•

Each command in the MathML package can be accessed by using either the long form or the short form of the command name in the command calling sequence.


As the underlying implementation of the MathML package is a module, it is also possible to use the form MathML:command to access a command from the package. For more information, see Module Members.



List of MathML Package Commands


•

The MathML package contains commands for importing and exporting Maple expressions from and to MathML text. The following is a list of available commands.



About MathML


•

MathML (or Mathematical Markup Language) is an XML application, which means that it consists of text interspersed with "tags" similar to those found in HTML. For instance, the number can be represented in MathML by the encoding "<math><mn>2</mn></math>". A more complicated example is the following representation of .

<math>

<apply>

<plus/>

<ci>a</ci>

<apply>

<times/>

<ci>b</ci>

<ci>c</ci>

</apply>

</apply>

</math>




The indentation indicates a hierarchical nesting of the structures formed by these tags (called "elements"). All mathematical expressions are represented in this way by reflecting their nested subexpression structure.

•

Because it is necessary, in general, to specify both what an expression means and how it is to appear when rendered, MathML provides two different kinds of encoding for expressions and a mechanism for combining the two. The first, shown in the example above, is called "Content" MathML. It represents the semantics of an expression, but gives little or no information about how it should appear when the expression is to be printed in a book or on a computer display. A second form of representation, known as "Presentation" MathML is used to encode the information needed to render an expression properly.

•

The Maple expression , for example, can be represented semantically by the Content MathML.

<math>

<apply>

<plus/>

<apply>

<power/>

<ci>x</ci>

<cn>2</cn>

</apply>

<apply>

<power/>

<ci>y</ci>

<cn>2</cn>

</apply>

</apply>

</math>




To convey the information needed to print the expression in the usual way, a different sort of encoding is used.

<math>

<mrow>

<mrow>

<mrow>

<msup>

<mi>a</mi>

<mn>2</mn>

</msup>

</mrow>

<mo>+</mo>

<mrow>

<msup>

<mi>b</mi>

<mn>2</mn>

</msup>

</mrow>

</mrow>

</mrow>

</math>




This encoding tells an application (such as a Web browser) how to render the expression but gives no indication of its meaning.

•

So that applications with widely differing purposes can communicate with each other, MathML allows both representations of an expression to be "packaged" together into a single element. There are, in fact, two ways of doing this: Mixed Mode MathML and Parallel Mode MathML. The Maple MathML package uses Parallel Mode MathML, in which the content representation is bundled to the presentation representation as an XML annotation.

•

In addition to the Content and Presentation representations, MathML allows application specific data to be attached to an expression. This package uses and produces such an annotation in the form of a string of Maple language code.

•

A graphical user interface to some of the functionality provided by this package is available via the worksheet File menu option Export As HTML with MathML, and is integrated into the cut and paste facilities of the Maple graphical user interface.

•

Not every Maple expression can be represented in MathML, nor can every expression written in MathML markup be taken as a valid representation of some Maple object. When it is not possible to effect a translation between Maple and MathML, the commands in this package raise an exception. If possible, some indication of where the translator had difficulties is also returned.


