MathJax & Content MathML

423 views
Skip to first unread message

Prof E

unread,
Jan 21, 2011, 6:32:51 PM1/21/11
to MathJax Users
I've been using MathPlayer to show Content MathML online, but am
interested in switching to MathJax. I've got my web page to display
the presentation MathML supplied by MathJax in the sample-mml.html
file, but am having no luck with my existing Content MathML. Does
MathJax render Content MathML? With MathJax, I'm getting "Unknown node
type" errors, e.g., "reln" and even "apply" nodes.

Davide P. Cervone

unread,
Jan 21, 2011, 7:42:30 PM1/21/11
to mathja...@googlegroups.com
No, MathJax doesn't currently handle Content MathML, only Presentation
MathML. I understand you can use XSL translation to convert Content
MathML to Presentation MathML, and then MathJax should be able to
display it. Others may be able to tell you more about how to
accomplish that.

Davide

David Carlisle

unread,
Jan 22, 2011, 2:45:08 PM1/22/11
to mathja...@googlegroups.com
On 22 January 2011 00:42, Davide P. Cervone <dp...@union.edu> wrote:
No, MathJax doesn't currently handle Content MathML, only Presentation MathML.  I understand you can use XSL translation to convert Content MathML to Presentation MathML, and then MathJax should be able to display it.  Others may be able to tell you more about how to accomplish that.

Davide

The xslt at

http://code.google.com/p/web-xslt/wiki/Overview

has such implementation,. It's an updated version of the (more fully documented) stylesheet at

http://www.w3.org/Math/XSL

It was for example responsible for producing the presentation mathml sample rendrings of the content mathml examples in chapter 4 of mathml3.

David
 

Amir Ebrahimi

unread,
Jan 22, 2011, 8:36:33 PM1/22/11
to MathJax Users
I'm creating an app where I keep the MathML in Content form and then
use the following XSLT to convert it to presentation:
http://jeuclid.sourceforge.net/content.html

I load the MathML as an XML document at run time and use the following
jQuery XSLT plugin to convert it:
http://www.xslt-templater.com/

Finally, I queue up a rendering of the Presentation MathML after it
has been properly translated. So far, this has been working well.
Here's what some sample code looks like.

(document).ready(function(){
$.ajax({
url: "mathmlc2p.xsl",
dataType: "xml",
success: function(xml) {
mathmlc2p = xml;
}});

$.ajax({
url: "reference.mml",
dataType: "xml",
success: function(xml) {
referenceData = xml;
}});

...

$("div.leftbutton").click(function(){
$("#ContentDisplay").xslt(referenceData, mathmlc2p);
MathJax.Hub.Queue(["Typeset",MathJax.Hub, "ContentDisplay"]);
});

...

Hope that helps.

::Amir

Prof E

unread,
Jan 24, 2011, 11:02:36 AM1/24/11
to MathJax Users
Thanks much to all who replied!

I think I may create a C# class to convert content to presentation
MathML (I'm a little surprised I haven't been able to find anything
that already does that). I already have a C# class that reads content
MathML to solve equations based on values assigned to the appropriate
variables. I can reuse a bunch of it.

Amir's method would probably work for me, but I don't know xslt or
ajax...

I'm not a regular programmer, so I don't always know the right
terminology (so please forgive). I tend to learn just enough to meet
the next challenge. So far, html, asp.net, c#, xml, and a little
javascript...

Reply all
Reply to author
Forward
0 new messages