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
- XHTML 1.0 Transitional
- XHTML 1.0 Frameset
- XHTML 1.1
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:
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
- XHTML 2.0 requires both a namespace and an XML Schema instance declaration. These might be declared as
- W3C Validator: http://validator.w3.org/
(You can validate your XHTML, HTML and WAP web documents via the URL, a File Upload, or even Copy & Paste)