thanks for those hints about configuring the doctype, will try that!
Iâ€™ll try to state the reasons for my preferences regarding (X)HTML without writing a ten-page thesis
I am not militant about this subject but I think thereâ€™s a lot of ignorance and hype
that needs to be addressed.
- XHTML is not supported at all by any version of IE and wonâ€™t be any time soon, according to the IE team
- serving different MIME types to IE and other UAâ€™s via content negotiation is too much hassle and not bulletproof anyway; also, thatâ€™s not enough, as you need to actually alter the document itself (remove non-namespaced classic HTML attributes for XHTML etc. and maintain different versions of your CSS and DOM-manipulating scripts (e.g., root element in XHTML is html, in HTML4 itâ€™s body)
- even if all UAâ€™s supported XHTML perfectly: the tiniest error will give users the Yellow Screen of Death, which I wonâ€™t accept for my clients and their audiences
- these tiny errors can potentially be caused by too many factors that have nothing to do with my diligence or lack thereof as an author/developer
- currently, I have no need for MathML or SVG
- the semantics and tags/attributes are identical for HTML 4.01 and XHTML 1.0, the latter being simply a reformulation into XML of the former -- no more, no less (read the specs if you donâ€™t believe me)
- XHTML is in no way more "accessible" or "standards-compliant" or <insert fashionably abused term here> than a well-structured, semantically marked up, valid HTML 4.01 Strict document
- forward-compatibility of XHTML 1.0 is a myth; XHTML 2.0 is a whole different animal, so the notion of quickly and painlessly switching over one day is an utter illusion
- no mainstream user agent supports XHTML 2.0 today
- XHTML 1.0 is only one year "younger" than HTML 4.01, so the notion that itâ€™s the latest and greatest thing is also a misconception -- not that age is a valid argument, anyway
- seeing that real XHTML is not a viable option for me, and seeing that serving XHTML as text/html is absolutely redundant as itâ€™s parsed as "classical" HTML tag soup by UAâ€™s, I choose to feed UAâ€™s real, clean HTML to begin with, skipping their overhead of having to handle tag soup
- mobile devices handle HTML nicely; if they didnâ€™t theyâ€™d exclude the majority of content on the Web; XHTML is not a requirement
- ... the subject is complicated but to wrap up: simply put, there is no need and no valid reason for me to use XHTML in this day and age
XHTML just happened to be a part of turn-of-the-millenium web standards advocacy by people such as Zeldman (understandably, the strict syntax offered a good way of forcing authors to abandon 90â€™s style horror coding). These advocates showed me the light, too, and Iâ€™m glad to see standards becoming more and more established. But itâ€™s a grave misconception that web standards are synonymous with XHTML or exclude/forbid HTML 4.01. The W3C expresses no preference for either recommendation.
HTML 4.01 Strict + CSS + unobtrusive scripting/DOM manipulation + semantic markup + accessibility best practices are fine. Throwing XHTML in the mix does not make it one inch "better".
Of course, serving XHTM as text/html (as 99% of XHTML sites probably do) according to Appendix C of the XHTML 1.0 spec is not the end of the world. It works, because UAâ€™s are forgiving. So if anyone wants to continue to do so, they should feel free to do so (I might have to, too, now and then in collaborative projects etc). They should, however, be fully aware that there is no benefit over HTML4 and that itâ€™s in no way more "modern" or "standards-compliant" or whatever. As I said in the beginning, Iâ€™m not militant about this subject, because right now, for practical purposes, it doesnâ€™t really matter. I just donâ€™t see why I should do things that make no sense.
Iâ€™d like to see people become at least more informed about the markup language they use. That way, they might be less condescending towards people like me who make informed decisions. Bravado, in this case your reply was obviously well-intentioned and friendly (so no sweat
) but I have
come across technically clueless people who become very haughty and obnoxious when trying to verbally demonstrate their supposed XHTML-"superiority", which I find very sad.
Sorry, this response turned out to be slightly longer after all... A few years ago, if Iâ€™d read these words of mine Iâ€™d probably have thought, "What a pedantic loser!", but the fact is, this is
about more than just abstract minor pedantics.
Almost forgot: The article you linked to
seems to actually reinforce what I said here and contradict your statements, so Iâ€™m a bit confused. It concludes by saying
This site uses HTML 4.01/Strict utilizing the well-formedness requirements of â€śXHTMLâ„˘ 1.0 The Extensible HyperText Markup Language (Second Edition): A Reformulation of HTML 4 in XML 1.0.â€ť (excepting those XHTML-specific requirements found Appendix C, i.e., C.1, C.2 and C.3). This decision was based on three unassuming facts.
* XHTML 1.0 is not forward compatible; XHTML 2.0 will not be backwards compatible.
* Serving XHTML as application/xhtml+xml doesnâ€™t work in IE.
* HTML 5 purports backwards compatibility.