Note: This is the documentation of the original version of these stylesheets, which are still available from this site.
Versions of the stylesheets updated to MathML3 are currently maintained as google code projects..
Addtitional technical information. For a first overview of the stylesheet see the Overview Page.
At the current time few browsers have "native" support for MathML, and none have native support for the Content part of MathML. However Mozilla and Amaya have good support for Presentation MathML, and for other browsers there are a range of extensions that will render MathML (in particular, WebEQ and MathPlayer from Design Science and Techexplorer from IBM).
The main disadvantage of using a third party extension to render MathML
within a web page is that it requires specific markup to specify the
rendering extension (so
<applet> for Java applets,
<embed> for plugins and
Microsoft Behavior extensions). The use of such markup ties the document to
one particular platform, whereas the ideal of publishing information on the
Web is that it should be accessible to all using a range of tools. We present
here a proposed mechanism for using the XSLT transformation language to avoid
these drawbacks and to allow XML files that conform to the XHTML and MathML Recommendations to be rendered
on a range of browsers, with no browser specific markup in the document. The
document just requires a single processing instruction linking to the stylesheet described
here. The stylesheet transforms the supplied XML file, adding whatever markup
is required to render MathML in the current browser, and pass the resulting
document to the browser for rendering. Clearly this does require that the
browser supports XSLT transformations, which does mean that a relatively new
browser is required, however the current versions of (at least) Internet
Explorer, Netscape and Mozilla all support XSLT, so while XSLT support is not
universal it is, or soon will be, available on the majority of desktop
In order to use these stylesheets you need to add one line such as the
following to your document, before the top level
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?> <?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>The stylesheet
mathml.xslwill render documents containing any part of MathML, including Content Elements. If the document does not contain any Content MathML, then as an alternative one may link to a slightly simpler stylesheet:
<?xml-stylesheet type="text/xsl" href="pmathml.xsl"?> <?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/pmathml.xsl"?>
This avoids loading the XSLT required to transform Content MathML to Presentation MathML that is needed to display Content MathML in some platforms. Most of the examples presented here will use this second stylesheet as this is sufficient to demonstrate the rendering capabilities of the various systems.
Normally the stylesheet will transform the input document to use a suitable MathML renderer, depending on the browser in use and any browser extensions that it detects. It tries a list of possibilities and selects the first one which appears to be installed.
One may control this behaviour, adding one rendering possibility to the front of the list of renderers to be attempted. This is accomplished by adding an attribute from the MathML preferences namespace to the top level html element of the input document. For example:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html pref:renderer="css"> </html>
from the pmathml-css example file specifies that the "css" rendering is to be preferred (in preference to Techexplorer or MathPlayer that might otherwise have been chosen in Internet Explorer).
There are still improvements to be made to these stylesheets and the documentation...
|Native Presentation||MathPlayer Behaviour||Techexplorer Behaviour||Techexplorer Plugin||CSS/Java Script|
|Windows||IE x, x < 5.0||no||no||no||no||no||no|
|Netscape x, x <= 6.0||no||no||no||no||no||no|
|Netscape x, x <= 6.0||no||no||no||no||no||no|
|Linux / Unix||Netscape x, x <= 6.0||no||no||no||no||no||no|
The majority of the code in these styleseets has been written by David Carlisle. Contributions from others are acknowledged at appropriate places within the sources.
The code is made available under the following conditions:
Copyright © David Carlisle 2001, 2002. Use and distribution of this code are permitted under the terms of the W3C Software Notice and License.
Sometimes it is inconvenient to arrange that a document is always generated with the correct relative link to the stylesheet, and the Internet Explorer security restrictions cause problems with using an absolute URI to (for example) the copy on the W3C site.
It is possible to make use of XSLT's "literal result element as stylesheet" syntax, and use the document itself as the stylesheet. This form can not do the Content to Presentation transform required by Mozilla, so it should only be used for documents using presentation MathML, also currently it generates a warning about unsupported XSLT elements in Amaya. However for Internet Explorer, Mozilla and Netscape, one can follow the example pmathml-self-style.xml, the main parts of which are shown below.
To use this mechanism:
classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4"should work for Techexplorer. (This version of the stylesheet can not support the different options simultaneously.).
xsl:processing-instructionelement should be added as shown, to generate a processing instruction to work with Microsoft Behaviors.
For Content MathML, Mozilla requires a transformation to Presentation, but in all other cases of MathML rendering using the stylesheet, there is little "transformation" happening; the main process is an identity transformation, with some additional features, mainly to enable the Internet explorer behaviors mechanism.
If you have access to the server configuration then an alternative to using the stylesheet is produce the file in XHTML, with the additional object and processing instructions required by Internet explorer. However serve the file as content type text/html if the client requesting the page is Internet Explorer (and text/xml otherwise). By serving the file as HTML, Internet Explorer will use its HTML parser and so trigger the behavior mechanism. Without needing a stylesheet to perform an XHTML to HTML transformation.
If attempting this mechanism one should be aware of the compatibility guidelines in the XHTML 1.0 Recommendation which give advice on how to avoid XHTML features that may cause problems in HTML browsers.
$Id: Overview-tech.html,v 1.10 2012/03/29 15:58:10 dcarlis Exp $