From BC$ MobileTV Wiki
Revision as of 18:44, 26 February 2008 by Joe (Talk | contribs)

Jump to: navigation, search

XHTML, or eXtensible Hypertext Markup language, is a web programming language used to define the visual properties of a data shared through the World Wide Web (WWW). It is also quickly becoming a de facto standard for the Mobile Web (Mobile Internet).


In order to validate an XHTML document, a Document Type Declaration, or DOCTYPE, may be used. A DOCTYPE declares to the browser which Document Type Definition (DTD) the document conforms to. A Document Type Declaration should be placed before the root element.

These are the most common XHTML Document Type Declarations:

  • XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  • XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  • XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

  • XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  • XHTML5

XHTML5 does not require a doctype, and XHTML5 validation is not DTD-based.

  • XHTML 2.0

XHTML 2.0, As of August 2006, is in a draft phase. If an XHTML 2.0 Recommendation is published with the same document type declaration as in the current Working Draft, the declaration will appear as:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">


NOTE: A placeholder DTD schema exists at the corresponding URI, though it currently only includes the character reference entities from previous recommendations. XHTML 2 contemplates both a version attribute and an xsi:schemalocation attribute on the root HTML element that could possibly serve as a substitute for any DOCTYPE declaration.

XML NAMESPACEs and Schemas

In addition to the DOCTYPE, all XHTML elements must be in the appropriate XML namespace for the version being used. This is usually accomplished by declaring a default namespace on the root element using xmlns="namespace" as in the example below:

  • For XHTML 1.0, XHTML 1.1 and XHTML5

<html xmlns="http://www.w3.org/1999/xhtml">

  • XHTML 2.0 requires both a namespace and an XML Schema instance declaration. These might be declared as

<html xmlns="http://www.w3.org/2002/06/xhtml2/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


External Links


  1. wikipedia:Xhtml
  2. wikipedia:Xhtml