Hypertext is text, displayed on a computer, with references to other text that the reader can immediately follow, usually by a mouse click or keypress sequence.... Markup Language, or XHTML, is a markup language
Markup language
A markup language is a set of codes that give instructions regarding the structure of a text or how it is to be displayed. Markup languages have been in use for centuries, and in recent years have been used in computer typesetting and word-processing systems to specify the formatting, layout, structure, and other elements of a document.... that has the same depth of expression as HTML
HTML
HTML, an Acronym and initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document?by denoting certain text as links, headings, paragraphs, lists, and so on?and to supplement that text with interactive forms, embedded '... , but also conforms to XML syntax.
The Standard Generalized Markup Language is an International Organization for Standardization Standard metalanguage in which one can define markup languages for documents.... (SGML), a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML. Because they need to be well-formed, true XHTML documents allow for automated processing to be performed using standard XML tools—unlike HTML, which requires a relatively complex, lenient, and generally custom parser
Parsing
In computer science and linguistics, parsing, or, more formally, syntactic analysis, is the process of analyzing a sequence of lexical analysis#Token to determine their grammatical structure with respect to a given formal grammar.... .
Hypertext is text, displayed on a computer, with references to other text that the reader can immediately follow, usually by a mouse click or keypress sequence.... Markup Language, or XHTML, is a markup language
Markup language
A markup language is a set of codes that give instructions regarding the structure of a text or how it is to be displayed. Markup languages have been in use for centuries, and in recent years have been used in computer typesetting and word-processing systems to specify the formatting, layout, structure, and other elements of a document.... that has the same depth of expression as HTML
HTML
HTML, an Acronym and initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document?by denoting certain text as links, headings, paragraphs, lists, and so on?and to supplement that text with interactive forms, embedded '... , but also conforms to XML syntax.
The Standard Generalized Markup Language is an International Organization for Standardization Standard metalanguage in which one can define markup languages for documents.... (SGML), a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML. Because they need to be well-formed, true XHTML documents allow for automated processing to be performed using standard XML tools—unlike HTML, which requires a relatively complex, lenient, and generally custom parser
Parsing
In computer science and linguistics, parsing, or, more formally, syntactic analysis, is the process of analyzing a sequence of lexical analysis#Token to determine their grammatical structure with respect to a given formal grammar.... . XHTML can be thought of as the intersection of HTML and XML in many respects, since it is a reformulation of HTML in XML. XHTML 1.0 became a World Wide Web Consortium
World Wide Web Consortium
The World Wide Web Consortium is the main international standards organization for the World Wide Web . It is arranged as a consortium where member organizations maintain full-time staff for the purpose of working together in the development of standards for the World Wide Web.... (W3C) Recommendation
W3C recommendation
A W3C Recommendation is the final stage of a ratification process of the World Wide Web Consortium working group concerning the standard. This designation signifies that a document has been subjected to a public and W3C-member organization's review.... on January 26, 2000. XHTML 1.1 became a W3C Recommendation on May 31, 2001.
Overview
XHTML is "a reformulation of the three HTML 4 document types as applications of XML 1.0". The W3C also continues to maintain the HTML 4.01 Recommendation and the specifications for HTML5 and XHTML5 are being actively developed. In the current XHTML 1.0 Recommendation document, as published and revised to August 2002, the W3C comments that, "The XHTML family is the next step in the evolution of the Internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility."
Motivation
In the late 1990s, many considered that the future of HTML lay in the creation of a version adhering to the syntax rules of XML. The then current version of HTML, HTML 4, was ostensibly an application of Standard Generalized Markup Language
Standard Generalized Markup Language
The Standard Generalized Markup Language is an International Organization for Standardization Standard metalanguage in which one can define markup languages for documents.... (SGML); however the specification for SGML was complex, and neither web browsers nor the HTML 4 Recommendation were fully conformant with it. By shifting the underlying base from SGML to the simpler XML, HTML would become compatible with common XML tools. Servers and proxies would be able to transform content, as necessary, for constrained devices such as mobile phones.
In software engineering, extensibility is a system design principle where the implementation takes into consideration future growth. It is a systemic measure of the ability to extend a system and the level of effort required to implement the extension.... . By utilising namespaces
XML Namespace
XML namespaces are used for providing uniquely named elements and attributes in an XML instance. They are defined by a W3C recommendation called Namespaces in XML.... , XHTML documents could include fragments from other XML-based languages such as Scalable Vector Graphics
Scalable Vector Graphics
Scalable Vector Graphics is a family of specifications of XML-based file format for describing two-dimensional vector graphics, both static and dynamic .... and MathML
MathML
Mathematical Markup Language is an application of XML for describing mathematics notations and capturing both its structure and content. It aims at integrating mathematical formulae into World Wide Web documents.... . Finally, the renewed work would provide an opportunity to divide HTML into reusable components (XHTML Modularization
XHTML Modularization
XHTML modularization is a methodology for producing modularized markup languages in a number of different schema languages so that the modules can easily be plugged together to create markup languages.... ) and clean up untidy parts of the language.
An antecedent is a preceding event, condition, cause, phrase, or word. It may refer to:* Antecedent moisture, a hydrologic term describing the relative wetness condition of a sewershed... technology to XHTML. The changes from HTML to first-generation XHTML 1.0 are minor and are mainly to achieve conformance with XML. The most important change is the requirement that the document must be well-formed
Well-formed element
In web page design, and generally for all markup languages such as SGML, HTML, and XML, a well-formed element is one that is either*opened and subsequently closed,... and that all elements
HTML element
In computing, an HTML element indicates structure in an HTML document and a way of hierarchically arranging content. More specifically, an HTML element is an Standard Generalized Markup Language element that meets the requirements of one or more of the HTML Document Type Definitions .... must be explicitly closed as required in XML. In XML, all element and attribute names are case-sensitive, so the XHTML approach has been to define all tag names to be lowercase.
This contrasts with some earlier established traditions which began around the time of HTML 2.0, when many used uppercase tags. In XHTML, all attribute values must be enclosed by quotes; either single (') or double (") quotes may be used. In contrast, this was sometimes optional in SGML-based HTML, where attributes can omit quotes in certain cases. All elements must also be explicitly closed, including empty (aka singleton
Singleton
Singleton may refer to*Singleton , a set with exactly one element in mathematics*Singleton pattern, a Design pattern used in software engineering... ) elements such as img and br. This can be done by adding a closing slash to the start tag, e.g., <img /> and <br />. Attribute minimization (e.g., <option selected>) is also prohibited, as the attribute selected contains no explicit value; instead this would be written as <option selected="selected">.
HTML elements which are optional in the content model will not appear in the DOM
Document Object Model
The Document Object Model is a platform- and programming language-independent standard object model for representing HTML or XML documents as well as an Application Programming Interface for querying, traversing and manipulating such documents.... tree unless they are explicitly specified. For example, an XHTML page must have a <body> element, and a table will not have a <tbody> element unless the author specifies one.
The XHTML 1.0 recommendation devotes a section to differences between HTML and XHTML. The WHATWG wiki similarly considers differences that arise with the use of (X)HTML5.
Because XHTML and HTML are closely related technologies, sometimes they are written about and documented in parallel. In such circumstances, some authors conflate the two names by using a parenthetical notation, such as (X)HTML. This indicates that the documentation and principles can be considered to apply generally to both standards.
Adoption
The similarities between HTML 4.01 and XHTML 1.0 led many web sites and content management systems to adopt the initial W3C XHTML 1.0 Recommendation. To aid authors in the transition, the W3C provided guidance on how to publish XHTML 1.0 documents in an HTML-compatible manner, and serve them to browsers that were not designed for XHTML.
Such "HTML-compatible" content is sent using the HTML media type (text/html) rather than the official Internet media type for XHTML (application/xhtml+xml). When measuring the adoption of XHTML to that of regular HTML, therefore, it is important to distinguish whether it is media type usage or actual document contents that is being compared.
Most web browsers have mature support for all of the possible XHTML media types. The notable exception is Internet Explorer
Internet Explorer
Windows Internet Explorer , commonly abbreviated to IE, is a series of graphical user interface web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995.... by Microsoft
Microsoft
Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices.... ; rather than rendering application/xhtml+xml content, a dialog box invites the user to save the content to disk instead. Both Internet Explorer 7 (released in 2006) and Internet Explorer 8 Release Candidate 1 (released in January 2009) exhibit this behavior, and it is unclear whether this will be resolved in a future release. As long as this remains the case, most web developers avoid using XHTML that isn’t HTML-compatible, so advantages of XML such as namespaces, faster parsing and smaller-footprint browsers do not benefit the user. Microsoft developer Chris Wilson explained in 2005 that IE7’s priorities were improved security and CSS support, and that proper XHTML support would be difficult to graft onto IE’s compatibility-oriented HTML parser.
Criticism
In the early 2000s, some web developers began to question why Web authors ever made the leap into authoring in XHTML. Others countered that the problems ascribed to the use of XHTML could mostly be attributed to two main sources: the production of invalid XHTML documents by some Web authors and the lack of support for XHTML built into IE6. They went on to describe the benefits of XML-based Web documents (i.e. XHTML) regarding searching, indexing and parsing as well as future-proofing the Web itself.
In October 2006, HTML inventor and W3C chair Tim Berners-Lee
Tim Berners-Lee
Sir Timothy John Berners-Lee, Order of Merit, Order of the British Empire, Royal Society, Royal Academy of Engineering, Royal Society of Arts is an English people computer scientist and MIT professor credited with inventing the World Wide Web.... , introducing a major W3C effort to develop new XHTML5 and HTML5 specifications, posted in his blog that, "The attempt to get the world to switch to XML ... all at once didn't work. The large HTML-generating public did not move ... Some large communities did shift and are enjoying the fruits of well-formed systems ... The plan is to charter a completely new HTML group." In the current HTML and XHTML 5 working draft, its authors say that, "special attention has been given to defining clear conformance criteria for user agents in an effort to improve interoperability", "...while at the same time updating the HTML specifications to address issues raised in the past few years." Ian Hickson
Ian Hickson
Ian 'Hixie' Hickson is the author and maintainer of the Acid 2 and Acid3 tests, and the Web Applications 1.0/HTML5 specification., Sean Michael Kerner, internetnews.com, January 25, 2008... , author of the important paper criticising the use of XHTML in 2002, is a member of the group developing this specification and is listed as one of the co-authors of the current working draft.
Versions of XHTML
XHTML 1.0
December 1998 saw the publication of a W3C Working Draft entitled Reformulating HTML in XML. This introduced Voyager, the codename for a new markup language based on HTML 4 but adhering to the stricter syntax rules of XML. By February 1999 the specification had changed name to XHTML 1.0: The Extensible HyperText Markup Language, and in January 2000 it was officially adopted as a W3C Recommendation. There are three formal DTDs
Document Type Definition
Document Type Definition is one of several SGML and XML schema languages, and is also the term used to describe a document or portion thereof that is authored in the DTD language.... for XHTML 1.0, corresponding to the three different versions of HTML 4.01:
XHTML 1.0 Strict is the equivalent to strict HTML 4.01, and includes elements and attributes that have not been marked deprecated in the HTML 4.01 specification.
XHTML 1.0 Transitional is the equivalent of HTML 4.01 Transitional, and includes the presentational elements (such as center, font and strike) excluded from the strict version.
XHTML 1.0 Frameset is the equivalent of HTML 4.01 Frameset, and allows for the definition of frameset documents—a common Web feature in the late 1990s.
The second edition of XHTML 1.0 became a W3C Recommendation in August 2002.
XHTML modularization is a methodology for producing modularized markup languages in a number of different schema languages so that the modules can easily be plugged together to create markup languages.... provides an abstract collection of components through which XHTML can be subsetted and extended. The feature is intended to help XHTML extend its reach onto emerging platforms, such as mobile devices and Web-enabled televisions. The initial draft of Modularization of XHTML became available in April 1999, and reached Recommendation status in April 2001.
The first XHTML Family Markup Languages to be developed with this technique were XHTML 1.1 and XHTML Basic 1.0. Another example is XHTML-Print (W3C Recommendation, September 2006), a language designed for printing from mobile devices to low-cost printers.
In October 2008 Modularization of XHTML was superseded by XHTML Modularization 1.1, which adds an XML Schema implementation.
XHTML 1.1—Module-based XHTML
XHTML 1.1 evolved out of the work surrounding the initial Modularization of XHTML specification. The W3C released a first draft in September 1999; Recommendation status was reached in May 2001. The modules combined within XHTML 1.1 effectively recreate XHTML 1.0 Strict, with the addition of ruby annotation
Ruby character
are small, annotative glosses that can be placed above or to the right of a Chinese character when writing logogram languages such as Chinese language or Japanese language to show the pronunciation.... elements (ruby, rbc, rtc, rb, rt and rp) to better support East-Asian languages. Other changes include removal of the lang attribute (in favour of xml:lang), and removal of the name attribute from the a and map elements.
Although XHTML 1.1 is largely compatible with XHTML 1.0 and HTML 4, in August 2002 the W3C issued a formal Note advising that it should not be transmitted with the HTML media type. With limited browser support for the alternate application/xhtml+xml media type, XHTML 1.1 proved unable to gain widespread use. In January 2009 a second edition of the document was issued, relaxing this restriction and allowing XHTML 1.1 to be served as text/html.
XHTML 1.1 Second Edition is expected in the first quarter of 2009.
XHTML Basic and XHTML-MP
To support constrained devices, XHTML Basic was created by the W3C; it reached Recommendation status in December 2000. XHTML Basic 1.0 is the most restrictive version of XHTML, providing a minimal set of features that even the most limited devices can be expected to support.
The Open Mobile Alliance is a standards body which develops open standards for the mobile phone industry.... and its predecessor the WAP Forum released three specifications between 2001 and 2006 that extended XHTML Basic 1.0. Known as XHTML Mobile Profile
XHTML Mobile Profile
XHTML Mobile Profile is a hypertextual computer language standard designed specifically for mobile phones and other resource-constrained devices.... or XHTML-MP, they were strongly focussed on uniting the differing markup languages used on mobile handsets
Mobile phone
A mobile phone is a long-range, electronic device used for mobile voice or data communication over a network of specialized base stations known as cell sites.... at the time. All provide richer form controls than XHTML Basic 1.0, along with varying levels of scripting support.
XHTML Basic 1.1 became a W3C Recommendation in July 2008, superseding XHTML-MP 1.2. XHTML Basic 1.1 is almost but not quite a subset of regular XHTML 1.1. The most notable addition over XHTML 1.1 is the inputmode attribute—also found in XHTML-MP 1.2—which provides hints to help browsers improve form entry.
XHTML 1.2
The XHTML 2 Working Group is considering the creation a new language based on XHTML 1.1. If XHTML 1.2 is created, it will include WAI-ARIA
WAI-ARIA
WAI-ARIA is a set of documents that specify how to increase the accessibility of dynamic content and user interface components developed with Ajax, HTML, JavaScript and related technologies.... and role attributes to better support accessible web applications, and improved Semantic Web
Semantic Web
The Semantic Web is an evolving extension of the World Wide Web in which the semantics of information and services on the web is defined, making it possible for the web to understand and satisfy the requests of people and machines to use the web content.... support through RDFa
RDFa
RDFa is a set of extensions to XHTML which is now a W3C Recommendation. RDFa uses attributes from XHTML's meta and link elements, and generalises them so that they are usable on all elements.... . The inputmode attribute from XHTML Basic 1.1, along with the target attribute (for specifying frame
Framing (World Wide Web)
On a web page, framing means that a website can be organized into HTML element#Frames. Each frame displays a different HTML document. Headers and sidebar menus do not move when the content frame is scrolled up and down.... targets) may also be present. It's important to note that the XHTML2 WG have not yet been chartered to carry out the development of XHTML1.2, this means that the XHTML1.2 proposal may not eventuate.
XHTML 2.0
Between August 2002 and July 2006 the W3C released the first eight Working Drafts of XHTML 2.0, a new version of XHTML able to make a clean break from the past by discarding the requirement of backward compatibility. This lack of compatibility with XHTML 1.x and HTML 4 caused some early controversy in the web developer community. Some parts of the language (such as the role and RDFa attributes) were subsequently split out of the specification and worked on as separate modules, partially to help make the transition from XHTML 1.x to XHTML 2.0 smoother. A ninth draft of XHTML 2.0 is expected to appear in 2009.
XForms is an XML format for the specification of a data processing model for XML data and user interface for the XML data, such as form . XForms was designed to be the next generation of HTML / XHTML forms, but is generic enough that it can also be used in a standalone manner or with presentation languages other than XHTML to describe a user... , an XML-based user input specification allowing forms to be displayed appropriately for different rendering devices.
DOM events allow event-driven programming languages like JavaScript, JScript, ECMAScript, VBScript and Java to register various event handlers/event listeners on the element nodes inside a Document Object Model tree, e.g.... will be replaced by XML Events
XML Events
In computer science and web development, XML Events is a W3C standard for handling Event-driven programming that occur in an XML document. These events are typically caused by users interacting with the web page using a device such as a web browser on a personal computer or mobile phone.... , which uses the XML Document Object Model
Document Object Model
The Document Object Model is a platform- and programming language-independent standard object model for representing HTML or XML documents as well as an Application Programming Interface for querying, traversing and manipulating such documents.... .
A new list element type, the nl element type, will be included to specifically designate a list as a navigation list. This will be useful in creating nested menus, which are currently created by a wide variety of means like nested unordered lists or nested definition lists.
In computing, a hyperlink, usually shortened to link, is a directly followable reference within a hypertext document.The area from which the hyperlink can be activated is called its anchor; its target is what the link points to, which may be another location within the same page or document, another page or document, or a... , e.g.,
The XML Linking Language, or XLink, is an XML markup language used for creating hyperlinks in XML documents. XLink is a W3C specification that outlines methods of describing links between resources in XML documents, whether internal or external to the original document.... . However, XLink itself is not compatible with XHTML due to design differences.
Any element will be able to reference alternative media with the src attribute, e.g.,
London Bridge
is the same as .
The alt attribute of the img element has been removed: alternative text will be given in the content of the img element, much like the object element, e.g., HMS Audacious.
A single heading element (h) will be added. The level of these headings are determined by the depth of the nesting. This allows the use of headings to be infinite, rather than limiting use to six levels deep.
The remaining presentational elements i, b and tt, still allowed in XHTML 1.x (even Strict), will be absent from XHTML 2.0. The only somewhat presentational elements remaining will be sup and sub for superscript and subscript respectively, because they have significant non-presentational uses and are required by certain languages. All other tags are meant to be semantic instead (e.g. for strong or bolded text) while allowing the user agent to control the presentation of elements via CSS.
The addition of RDF triple with the property and about attributes to facilitate the conversion from XHTML to RDF/XML.
HTML 5 is the fifth major revision of the core language of the World Wide Web, HTML. HTML 5 specifies two variants of the same language, a "classic" HTML variant known as HTML 5 and an XHTML variant known as XHTML 5.... initially grew independently of the W3C, through a loose group of browser manufacturers and other interested parties calling themselves the WHATWG, or Web Hypertext Application Technology Working Group. The WHATWG announced the existence of an open mailing list in June 2004, along with a website bearing the strapline “Maintaining and evolving HTML since 2004.” The key motive of the group was to create a platform for dynamic web applications; they considered XHTML 2.0 to be too document-centric, and not suitable for the creation of forum sites or online shops.
In April 2007, the Mozilla Foundation and Opera Software joined Apple in requesting that the newly rechartered HTML Working Group of the W3C adopt the work, under the name of HTML 5. The group resolved to do this the following month, and the First Public Working Draft of HTML 5 was issued by the W3C in January 2008. The most recent W3C Working Draft was published in June 2008.
HTML 5 has both a regular text/html serialization and an XML serialization, which is known as XHTML 5. In addition to the markup language, the specification includes a number of application programming interfaces. The Document Object Model
Document Object Model
The Document Object Model is a platform- and programming language-independent standard object model for representing HTML or XML documents as well as an Application Programming Interface for querying, traversing and manipulating such documents.... is extended with APIs for editing, drag-and-drop, data storage and network communication.
The language can be considered more compatible with HTML 4 and XHTML 1.x than XHTML 2.0, due to the decision to keep the existing HTML form elements and events model. It adds many new elements not found in XHTML 1.x, however, such as section and aside. (The XHTML 1.2 equivalent (which (X)HTML 5 replaces) of these structural elements would be specification is expected to add WAI-ARIA support in a future draft. There is currently no indication as to whether HTML 5 will support RDFa.
Valid XHTML documents
An XHTML document that conforms to an XHTML specification is said to be valid. Validity assures consistency in document code, which in turn eases processing, but does not necessarily ensure consistent rendering by browsers. A document can be checked for validity with the W3C Markup Validation Service
W3C Markup Validation Service
The Markup Validation Service by the World Wide Web Consortium allows Internet users to check HTML documents for conformance to HTML or XHTML standards.... . In practice, many web development programs provide code validation based on the W3C standards.
Root element
The root element of an XHTML document must be html, and must contain an xmlns attribute to associate it with the XHTML namespace
XML Namespace
XML namespaces are used for providing uniquely named elements and attributes in an XML instance. They are defined by a W3C recommendation called Namespaces in XML.... . The namespace URI for XHTML is http://www.w3.org/1999/xhtml. For XHTML 1.1 and later there should also ideally be a version attribute to clearly identify the version of XHTML being used. The example tag below additionally features an xml:lang attribute to identify the document with a natural language
Natural language
In the philosophy of language, a natural language is a language that is spoken, Sign language, or writing by humans for general-purpose communication, as distinguished from formal languages and from constructed languages.... :
For XHTML 1.1 and 2.0 an optional schemaLocation attribute can be added, to associate the namespace with an XML Schema. The example below is for XHTML 2.0:
This example also demonstrates the use of multiple namespaces within a document. The xmlns:xsi declaration indicates that any elements or attributes prefixed with xsi: fall within the XML Schema instance namespace rather than the XHTML namespace. This mechanism of prefixes allows elements and attributes from different XML vocabularies to be mixed together in the same document, without the potential for naming clashes.
A Document Type Declaration, or DOCTYPE, is an instruction that associates a particular SGML or XML document with a Document Type Definition .... , or DOCTYPE, may be used. A DOCTYPE declares to the browser which Document Type Definition
Document Type Definition
Document Type Definition is one of several SGML and XML schema languages, and is also the term used to describe a document or portion thereof that is authored in the DTD language.... (DTD) the document conforms to. A Document Type Declaration should be placed before the root element
Root element
Each XML document has one, and exactly one single root element. This element is also known as the document element. It encloses all the other elements and is therefore the sole parent element to all the other elements.... .
A system identifier is a document processing construct introduced in the HyTime markup language as a supplement to SGML. It was subsequently incorporated into the HTML and XML markup languages.... part of the DOCTYPE, which in these examples is the URL
Uniform Resource Locator
In Information technology, a Uniform Resource Locator is a type of Uniform Resource Identifier that specifies where an identified resource is available and the mechanism for retrieving it.... that begins with http://, need only point to a copy of the DTD to use if the validator cannot locate one based on the public identifier
Public identifier
A public identifier is a document processing construct in SGML and XML.In HTML and XML, a public identifier is meant to be universally unique within its application scope.... (the other quoted string). It does not need to be the specific URL that is in these examples; in fact, authors are encouraged to use local copies of the DTD files when possible. The public identifier, however, must be character-for-character the same as in the examples.
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">
XHTML Basic 1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
XHTML 2.0
XHTML 2.0, , 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">
XHTML5
XHTML5, the XHTML variant of the HTML5 specification, does not actually have a doctype. However, authors do have the option to use the new HTML doctype that the HTML variant of HTML5 uses which is: <!DOCTYPE html>
A character encoding system consists of a code that pairs a sequence of character from a given character set with something else, such as a sequence of natural numbers, octet or electrical pulses, in order to facilitate the transmission of data through telecommunication networks and/or Computer data storage of Character in compute... may be specified at the beginning of an XHTML document in the XML declaration when the document is served using the application/xhtml+xml MIME type. (If an XML document lacks encoding specification, an XML parser assumes that the encoding is UTF-8
UTF-8
UTF-8 is a Variable-width encoding character encoding for Unicode. It is able to represent any character in the Unicode standard, yet the initial encoding of byte codes and character assignments for UTF-8 is backward compatibility with ASCII.... or UTF-16, unless the encoding has already been determined by a higher protocol.)
For example:
The declaration may be optionally omitted because it declares as its encoding the default encoding. However, if the document instead makes use of XML 1.1 or another character encoding, a declaration is necessary. Internet Explorer
Internet Explorer
Windows Internet Explorer , commonly abbreviated to IE, is a series of graphical user interface web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995.... prior to version 7 enters quirks mode
Quirks mode
Quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for older browsers, instead of strictly complying with World Wide Web Consortium and Internet Engineering Task Force standards in standards mode.... if it encounters an XML declaration in a document served as text/html.
Common errors
Some of the most common errors in the usage of XHTML are:
Not closing empty elements (elements without closing tags in HTML4)
Incorrect:
Correct:
Note that any of these are acceptable in XHTML: <br></br>, <br/> and <br />. Older HTML-only browsers interpreting it as HTML will generally accept <br> and <br />.
Not closing non-empty elements
Incorrect:
This is a paragraph.
This is another paragraph.
Correct:
This is a paragraph.
This is another paragraph.
Improperly nesting elements (Note that this would also be invalid in HTML
HTML
HTML, an Acronym and initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document?by denoting certain text as links, headings, paragraphs, lists, and so on?and to supplement that text with interactive forms, embedded '... )
Incorrect: This is some text.
Correct: This is some text.
Not putting quotation marks around attribute values
Incorrect:
Correct:
Correct:
Using the ampersand character outside of entities (Note that this would also be invalid in HTML
HTML
HTML, an Acronym and initialism of HyperText Markup Language, is the predominant markup language for Web pages. It provides a means to describe the structure of text-based information in a document?by denoting certain text as links, headings, paragraphs, lists, and so on?and to supplement that text with interactive forms, embedded '... )
The term CDATA, meaning character data, is used for distinct, but related purposes in the markup languages Standard Generalized Markup Language and XML.... , script-comments and xml-comments when embedding scripts and stylesheets.
This problem can be avoided altogether by putting all script and stylesheet information into separate files and referring to them as follows in the XHTML head element.
Note: The format <script …></script>, rather than the more concise <script … />, is required for HTML compatibility when served as MIME type text/html.
If an author chooses to include script or style data inline within an XHTML document, different approaches are recommended as shown in the examples below, depending whether the author intends to serve the page as application/xhtml+xml and target only fully conformant browsers, or serve the page as text/html and try to obtain usability in Internet Explorer 6 and other non-conformant browsers.
Backward compatibility
XHTML 1.x documents are mostly backward compatible with HTML 4 user agents when the appropriate guidelines are followed. XHTML 1.1 is essentially compatible, although the elements for ruby annotation
Ruby character
are small, annotative glosses that can be placed above or to the right of a Chinese character when writing logogram languages such as Chinese language or Japanese language to show the pronunciation.... are not part of the HTML 4 specification and thus generally ignored by HTML 4 browsers. Later XHTML 1.x modules such as those for the role attribute, RDFa
RDFa
RDFa is a set of extensions to XHTML which is now a W3C Recommendation. RDFa uses attributes from XHTML's meta and link elements, and generalises them so that they are usable on all elements.... and WAI-ARIA
WAI-ARIA
WAI-ARIA is a set of documents that specify how to increase the accessibility of dynamic content and user interface components developed with Ajax, HTML, JavaScript and related technologies.... degrade gracefully in a similar manner.
HTML 5 and XHTML 2 are significantly less compatible, although this can be mitigated to some degree through the use of scripting. (This can be simple one-liners, such as the use of “document.createElement” to register a new HTML element within Internet Explorer, or complete JavaScript frameworks, such as the FormFaces implementation of XForms
XForms
XForms is an XML format for the specification of a data processing model for XML data and user interface for the XML data, such as form . XForms was designed to be the next generation of HTML / XHTML forms, but is generic enough that it can also be used in a standalone manner or with presentation languages other than XHTML to describe a user... .)
Examples
The followings are examples of XHTML 1.0 Strict. Both of them have the same visual output. The former one follows the HTML Compatibility Guidelines of the XHTML Media Types Note while the latter one breaks backward compatibility but provides cleaner markup.
style="text-align: left;" | Media type recommendation for the examples:
Media type
Example 1
Example 2
application/xhtml+xml
SHOULD
SHOULD
application/xml
MAY
MAY
text/xml
MAY
MAY
text/html
MAY
SHOULD NOT
Example 1.
XHTML 1.0 Example
This is an example of an
XHTML 1.0 Strict document.
Example 2.
XHTML 1.0 Example
This is an example of an
XHTML 1.0 Strict document.
Notes:
The "loadpdf" function is actually a workaround for Internet Explorer. It can be replaced by adding within .
The img element does not get a name attribute in the . Use id instead.
An Internet media type, originally called a MIME type after MIME and sometimes a Content-type after the name of a header in several protocols whose value is such a type, is a two-part identifier for file formats on the Internet.... of XHTML documents:
- Mark Pilgrim (3/19/2003). Includes examples for conditionally serving application/xhtml+xml using PHP
PHP
PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in Standalone software Graphical user interface.... , Python
Python (programming language)
Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python's core syntax and semantics are Minimalism , while the standard library is large and comprehensive.... , and Apache
Apache HTTP Server
The Apache HTTP Server, commonly referred to simply as Apache , is a web server notable for playing a key role in the initial growth of the World Wide Web.... (mod rewrite).
- summarizes one web browser's XHTML processing mode
Validators
[https://addons.mozilla.org/firefox/249/ Firefox page validator] Extension to Mozilla Firefox
Mozilla Firefox
Mozilla Firefox is a web browser descended from the Mozilla Application Suite and managed by Mozilla Corporation. Official versions are distributed under the terms of the proprietary EULA.... browser