Introduction to XHTML
If you want to know more about XML in general, you can take a look at my primer from a University of Washington 4 credit course: http://www.prism.washington.edu/lc/CL498A/xml.html. But, for most of you that may be way more than you want to know at this point in time (which is very reasonable as XML in general is outside the scope of our course). Otherwise, you can just focus on XHTML as one example of an XML-compliant language - the following comes from Wikipedia and is quite technical in nature. A good review to read, but not to get yourself overwhelmed by. This will be very useful to some of you who don't get overwhelmed. You aren't tested on any of this material but it is very good to know and contains the answers many questions you students have been asking me. By all means, you can ask me a question about anything in this document, but be sure you've used Google to search for better explanations for yourselves on any term you want more information on before you e-mail me. I'll be Googling myself to see what explanations are available in order to give you the best one that isn't too technical in nature.
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."
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 (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.
Another key advantage was extensibility. By utilising namespaces, XHTML documents could include fragments from other XML-based languages such as Scalable Vector Graphics and MathML. Finally, the renewed work would provide an opportunity to divide HTML into reusable components (XHTML Modularization) and clean up untidy parts of the language.
XHTML Relationship to HTML
HTML is the antecedent 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 and that all elements 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 that 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 (
HTML elements that are optional in the content model will not appear in the DOM tree unless they are explicitly specified. For example, an XHTML page must have a
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.
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 (
Most web browsers have mature support for all of the possible XHTML media types. The notable exception is Internet Explorer by Microsoft; rather than rendering
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, 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, 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
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 for XHTML 1.0, corresponding to the three different versions of HTML 4.01:
The second edition of XHTML 1.0 became a W3C Recommendation in August 2002.
Modularization of XHTML
Modularization provides an abstract collection of components through that 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.
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 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
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 and its predecessor the WAP Forum released three specifications between 2001 and 2006 that extended XHTML Basic 1.0. Known as XHTML Mobile Profile or XHTML-MP, they were strongly focussed on uniting the differing markup languages used on mobile handsets 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
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 and
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
New features introduced by XHTML 2.0 include: