HTML or XHTML: A purist’s dilemma

Whenever possible, I like to do things the right way. Proper implementation of anything—though it may take more effort initially—returns dividends in the form of higher performance, reliability, scalability, re-usability, and so on and so forth. This principle applies to life in general and isn’t limited to web development (read: Tacoma Narrows Bridge). It is however at the core of this article and the focus of the issue I am wrestling with.

For some time now, I was under the impression that XHTML was simply “better HTML,” due to its inherent well formedness—what with it being written in XML and all. But it seems I was mistaken (and I’m willing to admit it). Recently I’ve been reading articles by Anne van Kesteren, and it’s gotten me wondering if I didn’t just jump on the XHTML bandwagon without even asking myself that one all-important question: “Do I really need this?” Had I taken the time to explore the issue a little, I would have found out that in order to deliver XHTML to a client properly, I should be doing it via the application/xhtml+xml MIME type. Currently my documents are delivered as text/html, so all I have to do is change the MIME type right? Not really. While Firefox supports it, IE doesn’t. A document delivered to IE using the application/xhtml+xml MIME type causes the browser to display a download window as it doesn’t support it as a known document format. I could rig my web server to deliver the document in text/html for IE, but then I’d have to ask myself: “Is the effort worth it?” In other words, what advantage would XHTML bring me for the effort I’d have to expend in properly implementing it? Not to mention the fact that it would still be delivered in the incorrect MIME type in IE. The answer unfortunately is: none. Though there really aren’t any major semantic differences between HTML and XHTML, I’d really only need to use the latter if I had to extend HTML with MathML or some other custom markup languages. For more on this, read Anne’s post entitled: “MIME types matter; DOCTYPEs don’t

Now, some of you may be thinking “big deal, it still validates as XHTML even if the MIME type says it’s HTML and not XHTML.” Well, that would be a bad assumption to make since according to the W3C HTML WG Chair Steve Pemberton, …documents served as text/html should be treated as HTML and not as XHTML. This means that even though I work very hard at writing properly formed XHTML, in reality what I’ve been doing is exactly what I’ve been trying hard to avoid: I’ve been writing tag soup! That’s right, since in essence I’ve been delivering HTML documents using mal-formed HTML.

My dilemma is the following: Do I switch to HTML 4.01 and get used to uppercase tags that don’t self-close? Do I stay with XHTML 1.0 Strict and keep delivering it with the incorrect MIME type? Do I rig Apache to deliver my XHTML with the application/xhtml+xml MIME type and abandon visitors with older browsers (like IE 6). Or do I find a happy medium that delivers application/xhtml+xml to conforming browsers and text/html to everyone else?

What do you think?

Related Reading

Tags:


redtube downloader redtube video download redtube video download redtube videos download redtube xvideos xvideos downloader xvideos video download xvideos video download xvideos videos download xvideos metacafe metacafe downloader metacafe video download metacafe video download metacafe videos download metacafe xhamster xhamster downloader xhamster video download xhamster video download xhamster videos download xhamster daylimotion daylimotion downloader daylimotion video download daylimotion video download daylimotion videos download daylimotion facebook facebook downloader facebook video download facebook video download facebook videos download facebook badjojo badjojo downloader badjojo video download badjojo video download badjojo videos download badjojo dachix dachix downloader dachix video download dachix video download dachix videos download dachix keezmovies keezmovies downloader keezmovies video download keezmovies video download keezmovies videos download keezmovies shufuni shufuni downloader shufuni video download shufuni video download shufuni videos download shufuni vimeo vimeo downloader vimeo video download vimeo video download vimeo videos download vimeo veoh veoh downloader veoh video download veoh video download veoh videos download veoh theync theync downloader theync video download theync video download theync videos download theync ehow ehow downloader ehow video download ehow video download ehow videos download ehow xtube xtube downloader xtube video download xtube video download xtube videos download xtube stupidvideos stupidvideos downloader stupidvideos video download stupidvideos video download stupidvideos videos download stupidvideos AccessHollywood AccessHollywood downloader AccessHollywood video download AccessHollywood video download AccessHollywood videos download AccessHollywood ClipJunkie ClipJunkie downloader ClipJunkie video download ClipJunkie video download ClipJunkie videos download ClipJunkie Ebaumsworld Ebaumsworld downloader Ebaumsworld video download Ebaumsworld video download Ebaumsworld videos download Ebaumsworld FunnyOrDie FunnyOrDie downloader FunnyOrDie video download FunnyOrDie video download FunnyOrDie videos download FunnyOrDie FootyTube FootyTube downloader FootyTube video download FootyTube video download FootyTube videos download FootyTube pornhub pornhub downloader pornhub video download pornhub video download pornhub videos download pornhub