When Can we Start using XHTML?

XHTML was introduced as a standard at the same time as HTML 4 - back in 1997. It was a rewrite of HTML so that instead of just complying with the SGML standard (the standard for defining any markup language) it also complies with the XML standard. Theoretically this makes it easier to combine XHTML with other XML based markup languages in the same document and allow that one document to serve multiple purposes beyond just being a web page.

At the time XHTML was introduced no browser actually supported XHTML but the XHTML standard did include an appendix that defined a subset of XHTML that could be served as if it were HTML and so be able to be displayed in browsers that way. When it was introduced XHTML looked like it would be the future of web development and many web pages were written using the subset of XHTML that can be served and displayed as HTML ready for the day when browsers would support XHTML and they could be quickly converted.

The delays in some browsers actually supporting XHTML meant that opinions changed with many deciding that XHTML would not be the next big thing after all. Work on the proposed successor to HTML 4 and XHTML 1.0 called XHTML 2.0 eventually ceased with a pure XHTML future being abandoned. A new successor to HTML 4 called HTML 5 began development but XHTML wasn't forgotten as XHTML 5 was developed in parallel with XHTML 5 having the same relationship to HTML 5 as XHTML 1.0 has to HTML 4.

At the time of writing this (X)HTML 5 is close to but has not yet become a standard and so we can't really say which browsers if any fully support the new standard. Certainly there are plenty of older browser versions still in use that definitely don't support it. It is however possible to write web pages making use of the proposed new (X)HTML 5 tags in a way that uses them in browsers that support them and where the page is still usable in browsers that don't (eg. providing an object tag with a flash video attached inside of a video tag so that browsers that don't support the video tag will process the object tag instead). Writing (X)HTML 5 with fallbacks like this is somewhat similar in approach to using the subset of XHTML that can be processed as HTML - in both cases the code is ready for new browsers that support the new functionality while still working for older ones that don't. The difference is that the (X)HTML 5 will automatically work in the browsers that support it (assuming that the standard hasn't changed to remove support for the tags you used) while switching from HTML to XHTML requires a change to the way the web pages are served. The (X)HTML 5 will continue to work for the occasional visitor who is still using an antiquated browser that doesn't support the new tags while switching to XHTML will stop the page from displaying in browsers that don't support it and the page will be offered for download instead.

This makes it possible to prepare for (X)HTML 5 while continuing to support older browsers and not have to worry about changing your page when everyone has switched to using browsers that support the new tags. Actually switching to serving your XHTML 1.0 or XHTML 5 pages as XHTML requires that you make the decision to actually switch the way they are served. So while it is completely practical to use HTML 5 now even though it is yet to become a standard, it is still not possible to use XHTML as actual XHTML even though it became a standard in 1997.

There are two approaches that you can take to actually implementing XHTML on your site. If you want to implement it before all browsers support it then you need to restrict your page content to those tags that will work both as HTML and as XHTML. You then need to test on the server before serving the page to try to determine whether or not the browser supports XHTML and then serve the page as XHTML to those that do and as HTML to those that don't. Of course this then doubles your testing when it comes to seeing if the page displays correctly as you want it to and also greatly restricts the JavaScript you can have interact with the page.

The other alternative is to simply continue waiting until those using browsers that don't support XHTML stop visiting your pages. Once all of the visitors to your site are using browsers that support XHTML there is no reason why you can't then switch to serving the site as XHTML to everyone. This just leaves you needing to work out what portion of your visitors are still using antiquated browsers that don't support XHTML.

Most of the major browsers have been created since XHTML was first introduced and have supported XHTML from day one. The only major browser that hasn't been rewritten from the ground up since XHTML was first introduced is Internet Explorer. IE6 dominated the market for many years and so Microsoft had no incentive to actually update the browser during that time. It was only when they started losing significant market share that they decided they needed to upgrade the browser to actually support the 1997 standards. The browser was so far from supporting the standards that it took four new releases to actually introduce support for the standards equivalent to that in other browsers. Each of those new versions fixed some of the features that were missing in IE. With regard to support for XHTML the earliest version of Internet Explorer to actually support it is IE9.

So to answer the original question. All we need to do is to wait until people cease using Internet Explorer 8 and earlier and it will then be completely practical to use XHTML - either 1.0 or 5 - actually served as XHTML and without restricting ourselves to the subset that can be served as HTML. That just leaves us with a new question.

When will everyone cease using antiquated browsers such as Internet Explorer 8?


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow