You’re Not My !DOCTYPE
I’ve seen a lot of debate going on around the web as to the direction of HTML5 and XHTML2. I wasn’t really too worried about it, I use XHTML because it’s what I’m comfortable with, it forces me to write well-formed markup, and so far has always seemed like the appropriate solution. Recently my employer acquired a photo-sharing service, and this has added a few more people to our satellite team. One of them promptly informed us (politely) in not so many words that we were crazy to be using XHTML and if we continued to do so the ground would open, our cubicles being consumed by the fires of hell. At least, that was my take.
As of now, we plan to continue in the direction of XHTML. We currently use 1.0 Transitional, because we recently transitioned our code from HTML tag soup. We’ve cleaned everywhere we can, but I’m sure there’s still some nasty code floating around that we’ve missed, and for now we need that transitional doctype forgiveness. I feel as though most of the concerns about XHTML going forward are largely based on speculation. It’s hard to say which way the browser support winds will blow, especially with IE8 not being much more than whisper at this point in time. But, in the links my coworker sent to support his arguments I found something rather surprising; it appears the browser development teams are actually pushing towards HTML5.
I put out an email to some people for their thoughts, but I decided to just throw this out in the open and invite anyone with any thoughts, speculation, hopes for XHTML2, HTML5, and next gen browser support to get in touch. Post your ideas in the comments, or shoot me an email. I’d like to see where the public consensus lies on this issue.
Here are my colleague’s arguments against XHTML, I will post a follow up later with my individual disagreements and conclusions, but for now just marinade over these:
http://www.webdevout.net/articles/beware-of-xhtml
http://www.hixie.ch/advocacy/xhtml
http://www.mozilla.org/docs/web-developer/faq.html#acceptThe first one is really all you need to read, but in a nutshell, it is essentially pointless to use XHTML unless we plan to use its features like SVG or MathML, or if we plan to parse the XHTML on the back-end with an xml parser. The reason it is usually pointless is because IE (the most prevalent browser today by far, especially for AG) does not support XHTML with its correct mime type, which is required in order to use its features, and it won’t support it any time soon. Contrary to popular belief, it is definitely unclear whether XHTML is the “future”… it could very well be HTML5 that the industry adopts. Developing in XHTML, aside from creating a bit of bloat by requiring singleton tags to be closed like
<img />, it also leads to the erroneous belief that by developing with XHTML and simply switching the MIME type in the future if IE decides to support it, that everything will just work. Nothing could be farther from the truth. Sending XHTML as application/xhtml+xml has *enormous* implications in both html/css AND javascript. Please read the last link I listed above to see the many changes that would be required for JS alone if we switched to a real XHTML mime type… it has the potential to break almost every script we currently use. Then there’s the notion that we can just deliver it with the proper mime type to browsers that support XHTML and as HTML to the rest. This is added maintenance hassle and to what end? Is the benefit worth the added maintenance cost?So for these reasons, more and more developers are realizing that HTML 4.01 strict is the best doctype to use unless there is a true need to do otherwise… that is, if you’re actually using the “X” portion of XHTML.
“You’re Not My !DOCTYPE” was a tshirt idea from a coworker floating around here for a while. I’m still thinking about bringing the shirt to fruition, anyone think they might be interested?

Funny how this topic/discussion/debate is resurfacing in various places. Did you see this same discussion take place on the CWSA meetup forums? I will find it interesting to hear your opinion. I look forward to reading it.
Yes I did read that before I posted this
In regards to the CWSA site I don’t really feel one way or the other about it now, because I hope such a site would have a short lifecycle (constant reiterations.)
Oops, just emailed you back with some more of my thoughts on the matter. Which you can post later or throw out or do whatever with.
As for the code cleanliness you menton, if you’re using a Transitional DOCTYPE, what does it really matter if you write “well-formed markup” or not?
If you still have to support presentational elements in your legacy code, might the time switching it to XHTML Transitional been better spent removing the presentation and”cleaning it up” to HTML Strict?
Brendan, I see your point about what does it matter.
Our particular situation was this:
We were completely redesigning our site. This meant most markup would be new, and cleaned up. But in the time frame allocated it would have been impossible to catch all the old nasty stuff. We wanted to go the direction of XHTML, so we chose transitional thinking that would be the most painless going forward. Eventually all the nasty code will be replaced, most of it already has, and at that time we can move into a strict doctype.
Declaring the Doctype as XHTML rather than HTML4 didn’t take us any additional time, because we were attempting to remove as much presentational crap as possible, we just knew we wouldn’t get all of it.
As Brendan already stated, if you want to enforce standards and clean markup - then why Transitional? Even if you are re-designing - wouldn’t it be better to use strict, catch the errors and then fix them?
Personally, I have yet to see a useful example of how XHTML will enhance anything. I have made my argument on the meetup.com, but scraping a site isn’t a good example or reason, and neither is ‘forcing me to write clean code’ (in my opinion).
From a technical perspective your colleagues have hit the nail on the head. If you are never going to use any XML/MathML, etc- then why XHTML? And - there are deeper implications of just ‘flipping a switch’ like others thing it will be possible to do. There are technical considerations to actually implement it properly (in regards to CSS/JS/etc).
So, aside from ‘it forces me to write clean code’ - what is the real purpose of XHTML that makes it any better than HTML?
(side note - sorry if I sound harsh, I just enjoy this debate…he)
Nate, you don’t sound harsh
I enjoy a good debate. I’ll elaborate more on our reasonings, situations, and why I disagree with the coworker in my follow up post.
I thought I had read the whole meetup argument but I just scraped the surface, so I am going to finish that before I go into more detail.
Use XHTML 1.0 Transitional if you want the well-formedness of the spec, but don’t want to deal with the MIME-type zealots.
Personally, I think that anyone who maintains that XHTML can only be used with
application/xhtml+xmlshould reread RFC 2119.@Ethan
Care to give an example of how you can take advantage of XHTML without the proper mimetype? I am interested.
I wouldn’t consider myself a mime-type zealot, but I have yet to see useful examples.
I pretty much wrote a book on the meetup site, so I’ll try to be short here
Writing XHTML instead of HTML was a decision I made a few years ago; back when HTML looked to be deprecated. Since that time things have changed.
I agree that you don’t currently get any enhancements by using XHTML (beside my beloved strict syntax). It was the promise of future support that lead me to favor XHTML. It was “backwards compatible”, so no harm using it before the actual native support appeared in the browsers.
No, it isn’t technically correct. Yes, the browsers see our carefully crafted XHTML as HTML tag soup. But, if you do what it takes to make sure your XHTML is correct, then where is the problem? When/if browsers start supporting it natively, you’re ready. If it never happens, well then you are just taking advantage of the forgiving nature of HTML—until you can correct it.
When I started the discussion at meetup, I was on the fence, not really seeing the advantage any more of one over the other. My views have changed. I think that for your average, run-of-the-mill web page, HTML is the way to go. If for some reason you need the stricter structure provided by XHTML, then use it. HTML5 is being developed to support both syntaxes. For now, though, I don’t think you’ll burn for using XHTML and serving it as text/html. Unless, of course, you use it to serve a table-based design