| MathML on the Web: Using XSLT to Enable Cross-Platform Support for XHTML and MathML in Current Browsers
David Carlisle
In this talk I shall give an overview of the current possibilities (and problems) with rendering MathML in current browsers. The current generation of web browsers do not usually support MathML "Out of the Box". However, as will be shown, in a surprisingly large set of browser/operating system combinations, it is possible to specify extensions to enable good quality MathML rendering. For the authors of documents that contain MathML (or the authors of systems producing such documents) the current systems have the problem that one needs to place specific (to the browser extension) markup in the document to enable the MathML rendering. This commits the document to being read by one particular browser, which is far from ideal for documents which are to be posted on a web server to be read by anyone. The main part of this talk will be a discussion of a set of XSLT stylesheets which aim to greatly reduce the need for renderer-specific markup to appear in the document. An author just needs to link from the document to a "universal stylesheet" the stylesheet detects the browser and MathML render to be used and transforms the document within the browser, adding whatever extra markup is required. Before looking at the stylesheet though, I will give a brief (or less brief, depending on the audience on the day...) overview of XSLT, and the features of that language that make it particularly suited to this task. Whilst the current stylesheet has been designed to support a range of MathML renderers, the principles of the stylesheet should be applicable to other XML languages that are designed to be used as components in a larger document type. (SVG being another obvious candidate.)
The online documentation for the XSLT Stylesheet for MathML Includes a large table showing a range of current rendering possibilities for MathML which are supported (or not) by the current stylesheet. This table may need updating/correcting before the conference. Differences in the markup (and MIME-types) required for these systems (if used without the stylesheet) will be discussed.
This section may need to be extended or shortened depending on the audience: many will be familiar with XSLT, but some may not have seen it at all. The talk will be itself an XSLT demonstration, being served from XML via an XSLT transform running in Internet Explorer. XSLT is a language designed for transforming XML documents. Its main distinguishing features are:
A description of the main "Template" mechanism of XSLT will be given, together with examples of simple templates.
A very brief guide to namespaces, highlighing the main point that it is (only) the namespace URI that matters, in particular the prefix (if any) used in the document may be variable.
The stylesheet is basically an "Identity transform" for documents using elements from the XHTML or MathML namespaces. The stylesheet can however query the environment in which it is running and so modify the transform, so that the resulting document contains the necessary features to enable MathML support. The main platform-specific modifications required are:
In addition the stylesheet uses a trick (due to Jonathan Marsh of Microsoft and the XSL WG) to enable the basic functionality of the stylesheet to also work with Internet Explorer 5.5 browsers using Microsoft's pre-XSL transformation language. IE 6 comes with XSLT by default and IE5 may be upgraded to use XSLT, but is distributed using a transformation language based on an early working draft of XSL. Example documents will be demonstrated being rendered by various different (Windows) MathML implementations. The main points of the stylesheet being used will be discussed.
The main conclusion of this talk is that MathML is now ready to be used on the web. With the exception of the Mac, there are freely available robust implementations of MathML renderers which work with the current generation of browsers. This stylesheet is based on XSLT but it is not necessary for authors of MathML pages to know any XSLT, they only need copy the stylesheet on to the server with their documents, and link to it using <?xml-stylesheet type="text/xsl" href="pmathml.xsl"?>The stylesheet is distributed under the terms of the W3C Software Notice and License which basically places no restriction on its use, except that derived works should acknowledge the source.
|