Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

Namespaces

XHTML uses the document type definition (DTD) to define the tag names and attributes that you can use when you create a page. Each page must have one of the three XHTML DTDs: Strict, Transitional, or Frameset but you can also add other DTDs that contain your own tags. For example, you might have a DTD that define a collection of tags such as equations for mathematical formulae.

The XHTML namespace contains all the XHTML tags and attribute names. If you add other DTDs, they each define a separate namespace containing the tags you have created.

A name may exist in several name spaces with a different meaning in each so you must tell the browser which namespace to look at.

You use the xlmns attribute to introduce and name each namespace in your page. For example

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" 
lang="en"> <math xmlns="http://ann.com/maths>

If you want to use both in the same page, add a name to the namespace:

<math xmlns:math="http://www.ann.com/maths>

You can then mix tags:

<div>
<p>A normal division</p>
<p> An equation a <math: div/> b
</div>