Difference between revisions of "XHTML"

From BC$ MobileTV Wiki
Jump to: navigation, search
(External Links)
(External Links)
Line 82: Line 82:
  
 
* '''W3C Validator:''' http://validator.w3.org/
 
* '''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)
+
(You can validate your XHTML, HTML and WAP web documents via the URL, a File Upload, or even Copy&Paste)
  
 
* Javascript and XHTML (how to use JavaScript to ensure your page still passes XHTML 1.0+ validation): http://javascript.about.com/library/blxhtml.htm?r=9I
 
* Javascript and XHTML (how to use JavaScript to ensure your page still passes XHTML 1.0+ validation): http://javascript.about.com/library/blxhtml.htm?r=9I

Revision as of 19:54, 5 March 2008

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).



DOCTYPEs

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">

[1]

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"

[2]



External Links

(You can validate your XHTML, HTML and WAP web documents via the URL, a File Upload, or even Copy&Paste)

References

  1. wikipedia:Xhtml
  2. wikipedia:Xhtml