For the latest news about MathMLc2p and to download an updated version, go
to the new
This page is no longer updated. It is provided as historical
MathML Content2Presentation Transformation (MathMLc2p)
There are two ways of enconding mathematical data using MathML:
- Content markup is concerned with the semantics of mathematics
- Presentation markup is concerned with the rendering of mathematics
The MathML Content2Presentation Transformation (MathMLc2p), written in
XSLT, is able to translate content markup expressions into presentation
markup expressions automatically.
The latest stylesheet (2000-12-14) can be downloaded here.
What you should know about this stylesheet
There is no guarantee that the stylesheet covers all the needs. Besides,
it is probably buggy, due to the lack of a test suite to conduct extensive
tests. It should get better with time, as I receive feedback and as a MathML
test suite should be available soon. Being a Ph. D. student, I will support
the transformation and improve it over time, but this will not be a full-time
job, so be patient. You can send comments, bug reports, suggestions of improvement by e-mail.
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
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:
com.jclark.xsl.sax.Driver input.xml mathmlc2p.xsl output"
The stylesheet is set to generate an output XML file without XML
- Latest version has been tested successfully against all examples
provided in the Content section of the MathML test suite.
- Latest version works fine with the following examples, provided by David Fiddes and Robert
- Problem with fn tags in some cases (too many commas when there
are several arguments).
Planned improvements for future versions
- Better handling of compose and inverse
- Detect more cases in which vectors have to be rendered vertically
instead of horizontally. Right now, only vectors which are multiplied by
a matrix and which are on the right of this matrix are rendered
vertically. I have chosen horizontal rendering as default because,
according to the draft, vectors can be used as the list of arguments of a
function (see Chapter
Amaya: W3C's HTML browser/editor,
capable of rendering MathML presentation markup (used to test MathMLc2P's
XSLT Recommendation 1.0
Some XSLT engines: J.Clarks's XT,
- Added ( ) around -1 in inverse.
- Removed differential d from int when the integral is defined by
- Replaced <munderover> by <msubsup> and <munder> by
<msub> in integrals (int).
- <apply><diff/><ci>f</ci></apply> is now
rendered as f'
- Added support for new elements : cartesianproduct.
- Fixed some rule specificity conflicts.
- Minor bug fixes wrt bvar element in diff and
- Fixed bug wrt namespace problem using the name() function
- Added support for new elements : domain, codomain, image, piecewise,
floor, ceiling, factorof, momentabout.
- Replaced mchars by standard entity references.
- Minor bug fixes
- Added support for the MathML namespace
"http://www.w3.org/1998/Math/MathML". Examples have been updated
- Removed redundant element mrow (child of math)
- Added support for element mtext in source
- Added support for deprecated element reln
- Fixed bug in elements forall and exists
- All math elements are processed, no matter there depth in the
XML source document
- First version made public
Last modified: Mon Jan 15 10:24:33 Romance Standard Time 2001