XHTML, HTML and the What Challenge?

July 8, 2005

In the interview "Ten questions for Russ Weakley," Weakly talked a bit about the "MIME type challenge" and gave references to a number of articles on the subject.

As you may already know, I'm sometimes a little slow on the uptake. This is the first I'd heard of any challenge. Everything I'd read about CSS and web standards led me to believe I was doing things right. Had I miss a page somewhere? Now suddenly I find out things aren't so simple.

Sigh. When are they ever?

For anyone who's been under that rock with me, this is the story in brief: As Weakly puts it, "XHTML 1.0 (transitional, frameset or strict) should be served as application/xhtml+xml." However, "Internet Explorer does not support the application/xhtml+xml MIME type." Thus, we've been told (or have been if we're reading the same books and blogs) to serve up XHTML as text/html.

But as Ian Hickson says in "Sending XHTML as text/html Considered Harmful":

If you send XHTML as text/html, as far as browsers are concerned, you are just sending them Tag Soup. It doesn't matter if it validates, they are just going to be treating it the same was as plain old HTML 3.2 or random HTML garbage.

He goes on to say:

HTML 4.01 contains everything that XHTML 1.0 contains, so there is little reason to use XHTML in the real world. It appears the main reason is simply "jumping on the bandwagon" of using the latest and (perceived) greatest thing.

Tommy Olsson, Ian Hickson and Anne van Kesteren all think many people should go back to HTML. As Russ Weakly says, "I think that unless you are willing to serve your pages as application/xhtml+xml with content negotiation, then you are probably better off staying with HTML 4.01 at this time."

Huh? They're joking, right? I thought XHTML was just a more rigorous version of HTML. Well, turns out I was wrong. If you thought so, too, read Roger Johansson's "The perils of using XHTML properly" for a proper eye opener.

So what's a poor newbie designer supposed to do? As Jonathan Leighton admits in "That little 'XHTML or HTML?' debate," he's "not the only one really confused lately about whether XHTML or HTML is actually better/preferred/more correct/The Right Choice." Leighton studied the dilemma and made a choice to go back to HTML. Others have gone the opposite way. Leighton quotes Graham Bancroft, who declares, "I will continue coding in XHTML, I’ll be darned if I’m going to learn HTML, I mean, why should I?"

After thinking it over (probably not enough; I'll be revisiting this conflict, I feel sure), I've decided to stick with XHTML. For now. Maybe I am serving up "tag soup," but it's the cleanest, most semantically correct soup I've ever made. Thanks to XHTML, my markup is pristine compared to what I wrote last year.

Call me a Polly-Anna, but I think things are going the right way, and they're going to get better. Very soon, if not already, IE isn't going to have much choice but to get with the program (pun unintended). So, XHTML is harder than we first thought. Big deal. Does that mean we should stop trying? Or does it mean, instead, we should try harder?

But that's just my opinion and my decision. You have to weigh the pros and cons and make your own. Leighton probably expressed my feelings best when he said:

Remember that you are writing semantic markup. Remember that you are applying your page presentation with CSS. Remember that you give a damn about accessibility. Remember that your web sites are better than 99% of the crap out there--whether you decide to use XHTML or HTML.

While I wouldn't go so far on that last bit, personally, I think the gist of what he says is right. We're moving in the right direction. Whatever you decide, at least you give a damn.

UPDATE:
Thanks for all the comments. I'm glad to know I'm not alone in my choice. I'd like to add that I do understand the concern.

Tommy Olsson says in "XHTML Is Dead":

By now there are probably millions of web sites that use pretend-XHTML in a way that will cause them to break if they were served as an application of XML... What will happen if, one day, we change the rules?... The victims will blame the W3C, of course, even though they committed the mistakes themselves.

There is that danger. On the other hand, I'm no expert, and yet I realize the importance of validating my code. When I don't (yes, yes, I know, but it gets busy around here), I'm certainly not going to blame the W3C or think XHTML is somehow flawed if my page breaks.

I understand how hard the fight has been to get people to accept web standards and CSS. And yes, in the past there was a perception by some that XHTML and CSS weren't really workable. Then, just when things are going nicely, along comes this potential crisis. It is enough to have the standards people holding their foreheads and groaning, "Oh, no, here we go again." But I really don't think the same danger exists anymore.

You've done your jobs, standards people. We're getting it, finally. I think it's okay to relax a little now.