Department of Mathematics

Math 300: Mathematical Computing

XHTML

As a case study of XML in action, let's look at XHTML, the extensible HyperText Markup Language. This is, on its face, a simple rendering of HTML in XML format. Each HTML tag is mapped to an XML tag of the same name, all with their meanings interpreted by a DTD. Some formatting of an XHTML file is obtained through the namespace, but you can specify more formatting via a stylesheet, usually CSS.

Following is a typical XHTML declaration, as it must appear at the top of an XHTML file.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]>
<html xmlns="http://www.w3.org/1999/xhtml">

The first line just tells your browser that XML is coming. The next tells where to get the DTD for this document. Note that the DTD is somewhere far away on a W3C server. Finally comes a line that tells your browser where the meaning of all the tags used lies: it is in a so-called namespace. This allows us to use short names for these tags - everything is understood to be in the context of the namespace.

From our point of view, there are relatively few differences between XHTML and plain old HTML.


Assignment 7 is posted.




A solution to the exam has been posted.



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