Home > MathMLc2p

MathML Content2Presentation Transformation (MathMLc2p)

There are two ways of enconding mathematical data using MathML:

The MathML Content2Presentation Transformation (MathMLc2p), written in XSLT, is able to translate content markup expressions into presentation markup expressions automatically.

MathMLc2p is now maintained by the members of project JEuclid. The latest version of the stylesheet can be downloaded from their repository. Previous versions are available from the corresponding entry in the history log. The latest version is made available under the Apache license; earlier versions were distributed under the MIT license. Many improvements on early versions have been contributed by Brent Hendricks and Josh Bode.

A tracker dedicated to MathMLc2p is available on the JEuclid Web site.

What you should know about this stylesheet

There is no guarantee that the stylesheet covers all the needs. I implemented it a few years ago while working for Xerox Research Centre Europe and INRIA Rhône-Alpes. I am no longer officially working on MathMLc2p, but I am still available to answer questions and maybe fix a few bugs (depending on their difficulty). Contributions to MathMLc2p are still welcome.

The current version is based on the 13 November 2000 MathML 2.0 Candidate Recommendation. As a consequence, it is not intended for use with MathML 1.x

Entity references have been replaced by mchar entities, but entity references in the source document are still supported as long as they are defined somewhere. Content tags defined by presentation tags are supported, as well as XML annotations encoded in MathML-Presentation or MathML-Content.

Since mchar elements are not part of the spec any more, I switched back to standard entity references.

What it does not do

The transformation takes content markup and outputs presentation markup according to the default rendering given in Chapter 4. It does not try to enhance the rendering by adding additional information like spacing attributes, nor does it split an expression if it's too long, since this kind of thing is rendering software/device dependent.

How to use it

You need an XML parser and an XSLT engine, such as J. Clark's XP+XT written in Java.

The MathMLc2p stylesheet's filename is mathmlc2p.xsl
The command line, for James Clark's XT, when used in conjunction with XP is:
"java -Dcom.jclark.xsl.sax.parser=com.jclark.xml.sax.CommentDriver com.jclark.xsl.sax.Driver input.xml mathmlc2p.xsl output"

The stylesheet is set to generate an output XML file without XML declaration.

Known bugs

Possible improvements

Related links

MathML Homepage

Amaya: W3C's HTML browser/editor, capable of rendering MathML presentation markup (used to test MathMLc2P's output)

XSLT Recommendation 1.0


Latest version (Download)

Version 2007-05-22 (Download)

Version 2007-04-24 (Download)

Version 2005-07-19 (Download)

Version 2000-12-14 (Download)

Version 2000-12-04

Version 2000-11-24

Version 2000-06-14

Version 2000-06-13

Version 2000-04-14