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

RE: Presentation to Content MathML transform

From: Karim Alloula <Karim.Alloula@ensiacet.fr>
Date: Thu, 13 May 2010 14:19:46 +0200
To: "'David McKain'" <david.mckain@ed.ac.uk>
Cc: <www-math@w3.org>
Message-ID: <EF76985C1652485096CC1DC99B4385E1@ensiacet.fr>
Dear David,
In fact we already had a look at the SnuggleTeX Web site, and found it was
certainly the best approach to add some widely used semantic rules to the
plain Presentation MathML. Of course, you defined rules only for a limited
subset of mathematical expressions, but the approach you give can be easily
extended to other operators for example by introducing additional precedence
rules.

I try the stylesheets you sent me and give you my feedback!


Karim Alloula
INPT-ENSIACET
4, allée Emile Monso
31432 Toulouse CEDEX 04 - France
Tél : +33.(0)5.34.32.33.53
Mobile : +33.(0)6.30.61.10.38
-----Message d'origine-----
De : David McKain [mailto:david.mckain@ed.ac.uk] 
Envoyé : jeudi 13 mai 2010 12:45
À : Karim Alloula
Cc : www-math@w3.org
Objet : Re: Presentation to Content MathML transform

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
expressive.)

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

Some demos:

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

More information on the underlying process:

http://www2.ph.ed.ac.uk/snuggletex/documentation/semantic-enrichment.html

Cheers,
David.

--
The University of Edinburgh is a charitable body, registered in Scotland,
with registration number SC005336.


Received on Thursday, 13 May 2010 12:20:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 May 2010 12:20:23 GMT