Tech Center Current


Who says XHTML is good to use?

March 27th, 2007 by David Hammond

It seems like every web development tool is trying to generate XHTML these days. Web design teachers tell their students that HTML is “out” and XHTML is “in”. But is XHTML really the best thing to use? You may be surprised to learn that there isn’t a single major web browser vendor who thinks it is a good idea to use XHTML on a public website, and a growing number of web standards experts agree.

Why? XHTML seems to work, doesn’t it? Actually, if you use XHTML on a public website, most web browsers will simply pretend that you’ve written regular HTML, and they’ll proceed to treat it as such. Internet Explorer, the most widely-used web browser today, doesn’t even support the correct handling of XHTML. And worse, if a program does want to treat the page as real XHTML, it will usually have major problems because of unnoticed differences in real XHTML.

Microsoft posted on its official Internet Explorer blog:

If we tried to support real XHTML in IE 7 we would have ended up using our existing HTML parser (which is focused on compatibility) and hacking in XML constructs. It is highly unlikely we could support XHTML well in this way

Mozilla (creators of Firefox) posted on its web developer FAQ:

If you are using the usual HTML features […] serving valid HTML 4.01 as text/html ensures the widest browser and search engine support.

The Safari development team posted on its official blog:

On today’s web, the best thing to do is to make your document HTML4 all the way. Full XHTML processing is not an option, so the best choice is to stick consistently with HTML4.

Håkon Wium Lie, the CTO of Opera and long-time member of the World Wide Web Consortium which standardized the XHTML language, stated in an interview:

I don’t think XHTML is a realistic option for the masses. HTML5 is it.

(HTML 5 is currently in development under the combined efforts of the World Wide Web Consortium and the Web Hypertext Application Technology Working Group.)

Anne van Kesteren, a web standards expert at Opera, stated in his blog:

I’m an advocate of using XHTML only in the correct way, which basically means you have to use HTML. Period.

Ian Hickson, former Opera employee who was hired over by Google and has served as an editor for World Wide Web Consortium specifications, wrote an article about correct usage of XHTML, concluding:

Authors intending their work for public consumption should stick to HTML 4.01

What do these browser vendors and web standards experts know that the rest of us missed? I explain the issues in the article Beware of XHTML.

2 Responses

Arak.

December 1st, 2008 by Arak.

Your informatión is great an very well documentated.
Now I can understand what really happens when one uses XHTML or HTML.
Thank you for sharing.

Caracol y Punto » Blog Archive » HTML ó XHTML

December 1st, 2008 by Caracol y Punto » Blog Archive » HTML ó XHTML

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.