Geir Arne Brevik, October 30 2006:

Splitting hairs by sending XHTML as text/html

In the geekier corners of the web blogosphere, there have been some fuzz lately about invalid practice of sending XHTML-documents as text/html and not application/xhtml+xml, as it should, being XML and not plain text. Ian Hickson was maybe most enlightning, but Apple’s Maciej Stachowiaks post on webkit.org weighed in heavier in my book. After all, if one of the main browser makers think we all should serve (valid, but still) HTML4, who can argue against that?

We have discussed this a lot at the office, and the first thing we found out is that this is not incredibly important. Validation, regardless of doctype, is a thousand times more important than what doctype/header combo you choose:

The other thing we found out was that it is not much of a hassle to switch from one solution to another. After all, we’re using templates and use editors with no-nonsense find/replace-functions. I changed a site from XHTML (which I’ve been using exclusively since 2001, btw) to HTML4 in two minutes. It’s true that HTML4 can pass validation with quite sloppy code (this is valid!! try it!!), but I’m still going to use all-lowercase markup with quoted tag attributes, in a well thought out structure. After all, the main pay-off for that goes to me, with more readable and DOM-navigatable code. No matter if I’m using <br /> or <br>.

As you understand, I did it. On a site that’s not yet public, but still. Risking my markup status by choosing a different path than Tantek, Veerle, Zeldman, Cederholm, Molly, and even Tim Berners-Lee, without any measurable real-world effect, one way or another.

So why did I do it? To be honest, I have no real hard-hitting argument. As Brad Fults points out XHTML served as text/html is mostly harmful to feelings, but I really think it goes the other way around as well. I might go back to XHTML, but why not try it the right way, and see how it works? That’s my position for the moment. Ask me in a year if I still care.

. . .

P.S.

Eric Meyer is on my team.