W3C home > Mailing lists > Public > www-math@w3.org > May 2010

Re: Presentation to Content MathML transform

From: David McKain <david.mckain@ed.ac.uk>
Date: Thu, 13 May 2010 11:44:41 +0100
Cc: <www-math@w3.org>
Message-Id: <F1D63D1F-FD9F-4A15-94B5-27BFBB977CF7@ed.ac.uk>
To: Karim Alloula <Karim.Alloula@ensiacet.fr>
Hi Karim,

> I am looking at some XSL stylesheet to transform Presentation MathML  
> to
> Content MathML.
> Can anyone provide me such a tool?

As Michael has said, this kind of transformation is not easy to do for  
various reasons. If you can simplify or restrict the context you're  
working in, you may find that things become slightly more amenable.

One thing I investigated recently was trying this kind of  
transformation on very simple Presentation MathML corresponding to the  
kind of basic algebraic expressions you might encounter in UK School  
or early FE/HE mathematics teaching, to investigate possible  
applications for e-Assessment at this level. Working within this very  
restricted domain simplifies the problem significantly, as did working  
solely on the Presentation MathML output of a LaTeX to MathML  
converter (SnuggleTeX) and/or the MathML generated by ASCIIMathML,  
since the resulting "source" Presentation MathML has a fairly well- 
defined structure.

In my case, the conversion was done using a pipeline of two XSLT 2.0  
stylesheets. The first converted the display-oriented Presentation  
MathML into something with a more "semantic" structure, and the second  
then converted this to Content MathML. (A third stylesheet also  
generates linear input format for the Maxima computer algebra system.)

You're welcome to play around with these stylesheets to see if the  
approach might be useful for you. (I found XSLT 2.0 extremely powerful  
here for various reasons. E.g. I could define XPath functions for  
matching certain PMathML constructs, which made the code very  

There are, of course, many caveats and limitations to this approach...!

Some demos:

http://www2.ph.ed.ac.uk/snuggletex/UpConversionDemo (LaTeX input to  
(ASCIIMathML input to CMathML)

More information on the underlying process:



The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
Received on Friday, 14 May 2010 13:22:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:27:42 UTC