The Future of (X)HTML
Last week, the W3C officially threw in the towel on XHTML 2. This was a Good Thing, as the bulk of the web community has been behind HTML 5 and there was little apparent future for XHTML 2. Eliminating it just cuts out some confusion and largely fruitless effort.
Some observers have misread the demise of XHTML 2 as a failure of XHTML 1. The death of XHTML 2 does not, however, mean the end of XHTML syntax, which is fully supported by HTML 5.
A Brief History of Web Standards
HTML started as a stand-alone language for describing web pages in terms of both content and appearance. It evolved erratically in the early days of the web, culminating in HTML 4 (and the minor revision to HTML 4.01), which became a formal standard in 1999 and remains widespread today. It’s ironic that in one of the fastest-moving technologies of all time, we’re tied to a standard that hasn’t been updated in a decade.
XHTML 1, which debuted in 2000, is a reformulation of HTML 4 that provides a stricter syntax that conforms to XML rules. There’s nothing new in XHTML 1, in terms of capabilities; it’s just a new syntax.
XHTML disallows the presentational aspects of HTML, delegating these controls to CSS. Most web designers now design this way in any case, whether they are using HTML or XHTML. So it’s easy to think of XHTML as meaning "clean HTML," but it’s not the only way to write clean HTML.
Here are some of the additional syntactical requirements of XHTML 1:
- All tag names must be in lower case.
- All attributes must be in quotes.
- All tags must be closed, so single-part tags end with />.
- All documents must be well-formed, which means you can’t, for example, overlap tags.
XHTML 2 Charts a Different (Dead-End) Path
The standard that is dying is XHTML 2. This is in no way a condemnation of XHTML 1.
Whereas XHTML 1 took an existing HTML standard and simply provided a stricter syntax, XHTML 2 was a radical revamping that might have created superior markup, in a theoretical sense, but at the price of backward compatibility. XHTML 2 also continued to focus on web sites as documents, rather than applications.
HTML 5 Supports Both Syntaxes
The HTML 5 standard began life as a splinter group from the XHTML 2 effort, leaving the W3C in mid-2004. It was embraced by the W3C in March 2007 after its "years in exile," and with the demise of XHTML 2, HTML 5 is now the primary next-generation web standard.
HTML 5 defines both an HTML syntax and an XML syntax — you can choose. HTML 5 using XML syntax is an excellent successor to XHTML 1 for those who prefer this approach. Those who want to stick with HTML syntax and its more generous parsing by the browser can take that path. In either case, all of the old and new capabilities are available.
As for using the new features in HTML 5, it’s going to be a while — like a decade or so — before you can assume that nearly all of your web visitors are using browsers that fully implement HTML 5. Today, there’s a few features you can use, and some really interesting ones if you ignore Internet Explorer. But that’s a subject for another article.
Jeremy Keith, Misunderstanding Markup.
Jeffrey Zeldman, XHTML DOA WTF.
Jeffrey Zeldman, In Defense of Web Developers.