Department of Mathematics

Math 300: Mathematical Computing

MathML, XML, and XHTML

MathML, the Mathematical Markup Language, is a standard developed by W3C for typesetting mathematics on the World Wide Web. It has long been possible to use HTML to typeset some very simple mathematical expressions, such as

a x2 + b x + c = 0

but it was never possible to type the quadratic formula for the roots of that equation until the advent of MathML. However, at long last, we can now do so. If a is not zero, then one of the roots of the equation above is given by the formula - b 2 + b 2 - 4 a c 12 2 a . Note that we can equivalently write - b 2 + b 2 - 4 a c 2a

This was formerly done through the magic of XML and XHTML, so we should gain a little bit of understanding of those languages. XML stands for eXtensible Markup Language. It tries to answer the need for ever-increasing formatting on Web pages, and to combine that with a need to manage data on the Web, flavoring all of that with the W3C's constant battle against procedural markup. Thus, XML has the following properties, among others.

Anyone can write an XML file, making up tags as she goes along. Nothing is predefined, so she may choose any tag names she likes. About the only thing that is required is that for every starting <tag> there must be an ending </tag>. Thus, XML documents generally have the following properties.

DTD stands for Document Type Definition. It is here that XML tags begin to acquire meaning. It is here that the XML element address, for example, could be defined to be composed of the other elements street, city, postal-code. Here one can specify whether a given subelement is required, whether it is a database key, or whether it is simple string information.

DTDs are already considered to be too limiting to be used indefinitely. The W3C is already working on generalized forms for these that ultimately will replace DTDs. Stay tuned.

Formatting in XML documents is handled through XSL, the XML Stylesheet Language. It is here that one may translate XML into other languages such as HTML, or one could reorganize the XML to extract information and form new XML documents, e.g. to give a table of contents for the XML. XSL is like CSS, except it does more: it supports transforming the document entirely before display. For example, one might use XSL not only to format a document, but to format it using HTML and styles.

Building an XML document directly from scratch, creating a DTD to describe the data relations, and formatting it for display by creating an XSL sheet would be a tremendous task - too great for simply making one little web page. Fortunately, the W3C provides numerous resources for us to tap into. One of the most useful is XHTML. As you might have guessed, this stands for eXtensible HyperText Markup Language. It represents an effort to make HTML nothing more than a subset of XML. XHTML 1.0 constitutes a DTD for XML documents that can interpret XML tags as HTML tags. XHTML looks different from HTML in a number of ways.

Nowadays we do not require XML or XHTML to create MathML - the markup language is built-in to HTML5. Nonetheless, it adheres to its XML roots syntactically. ex = lim n 1+ xn n

Assignment C is posted.

The test solution is available.

Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us
Copyright © 1996-2015 Kevin Cooper