W3C home > Mailing lists > Public > www-math@w3.org > December 2005

Re: MathML JavaScript Question

From: David Carlisle <davidc@nag.co.uk>
Date: Wed, 14 Dec 2005 13:07:24 GMT
Message-Id: <200512141307.NAA19695@penguin.nag.co.uk>
To: matt.street@telematica.co.uk
CC: www-math@w3.org

> Am I doing something wrong? Is this a limitation of the style sheets?
> Any help will be gratefully received!!! 

I don't think it's really the stylesheets so much as the difference
between scripting in an xml and html dom. You don't say which browser
you are using but the details are likely to be different unless your
javascript explicitly uses code to work cross browser.

In firefox for example you don't need the stylesheet at all to display
xhtml+mathml but your test file works in the same way (not displaying
the script) I think you need to generate the elements using suitable dom
calls to create the nodes rather than using document.write() in xhtml but
cross browser javascript isn't really my speciality, others may comment.
Note also that in an xhtml script element (unlike an html script
element) < will start an element tag rather than just standing for a <


      	document.write("<math ...</math>");

will be parsed as

a script node with three child nodes,
1) a text node
2) a child math element node
3) and a second text node 

If you want to pass "<math xmlns=.... " as a _string_ to a javascript
function then you'd need


so that < and & were not special. (This is not needed in html as in html
script and style are declared as CDATA elements, but the CDATA element
type does not exist in XML, so in XHTML you have to explictly escape
scripts that use < or &.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Wednesday, 14 December 2005 15:51:16 UTC

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