(Excerpt from "The MathML Handbook" by Pavi Sandhu)

When you are posting an HTML (or XHTML) document that contains MathML on a Web site, it is important to have a way of controlling the exact style in which the document will be displayed. The style of the document includes information about properties such as font size, style, color, page margins, alignment, and so on. For displaying mathematics, there are also additional style considerations, such as the size of subscripts and superscripts relative to the base or whether fractions, integrals, and sums should be shown in display or inline form.

You can use the tags and attributes provided in MathML presentation markup to specify the precise rendering for any mathematical formula in a document. However, instead of specifying styles locally for each individual expression, you can collect style information that applies to the entire document in a separate stylesheet, which is rather convenient. The stylesheet can then be stored in a central location where multiple documents on a Web site can reference it. This makes it possible to assign a consistent appearance to a related set of documents. Also, by editing the stylesheet, you can apply style changes to an entire collection of documents without having to edit each document individually.

For HTML and XML documents, two stylesheet languages are of particular importance: CSS and XSLT. These are both recommendations of the W3C and are supported by most modern browsers. A key reason for their popularity is that since they are open standards, they are not tied to a specific vendor or platform. This chapter reviews the basic concepts of CSS and XSLT and provides examples of how they can be used to control the display of MathML in Web documents.

CSS specifies a simple syntax that allows you to associate style properties with specific elements in a document. XSLT, in contrast, is a more complex but also more powerful language. In addition to its role in specifying styles, XSLT provides a general mechanism for transforming XML documents. In particular, XSLT has a variety of useful applications in the context of MathML, such as creating macros to abbreviate complex notation, defining new tags to represent concepts that are not supported by the existing MathML specification, or even translating content markup to presentation markup. We shall see examples of these uses of XSLT under Using XSLT with MathML.


<< back next >>





Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America