« Let's not overblow Safari vs Mozilla | Main | Winter in Massachusetts DEAR DIARY: »

Will Mark turn to ASCII?

Note to Mark (and others) W3C says XHTML 1.0 does not have to be sent as application/xhtml+xml.. It says should not must.

Mark comments that he has migrated back to HTML4, which has caused its own problems. Will Mark turn to ASCII?

Personally I think the whole MIME type thing is bunk. If I send XHTML as text/html it works; if I sent it as anything else, it probably breaks.

Old joke:
Patient: Doctor, it hurts when I do this
Doctor: Don't do that

New World Order:
Designer: My Website breaks when I do this
Suggestion: Don't do that

XHTML 1.0 should be sent as application/xhtml+xml the MIME type itself reveals how stupid the thought process was, and how far removed from reality/sanity by not just making it much simpler, like "text/xhtml" The spec does not say it

Just an idea. That is all ‡

Comments

Have you read Ian Hickson's XHTML served as text/html considered harmful document? IT makes the very valid argument that XHTML, when served as text/html, is not checked for XML well formedness by the browser which greatly increases the chances of invalid XHTML documents cropping up all over the web. An invalid XHTML document can't be read by an XML parser, which kind of kills off the whole point of using XHTML in the first place.

http://www.hixie.ch/advocacy/xhtml

As heretical as it sounds, Ian, Simon, and I are right. I can show you rants dating back to 1995 (HTML 2.0-era) where people on www-html were complaining that web authors were sending documents containing Netscape-specific extensions as "text/html". Due to systematic, long-term abuse, "text/html" has come to mean "here's something with angle brackets; go do that magic thing you do with angle brackets". XHTML was supposed to *solve* this problem, but the only way it can solve it is if you use the appropriate MIME type (Ian's point). But using the appropriate MIME type is never safe (my point). Therefore, XHTML is never appropriate. Interesting idea, didn't work out. Oh well.

Why do I want to use XHTML? Because it forces me to think more clearly and write better markup. It's easier to automatically parse if I want to.

I actually wrote a little PHP snippet that sends XHTML as the "correct" MIME type IF the requesting IP is my home address. (I'll dig it out if anyone wants it.) This gives me the instant checking that I wanted with XHTML being parsed as XML without breaking it for others who can't use it.

The standard says "should" not must. Should browsers be able to handle the proper MIME type? Yes. Can they? No. Should I use a MIME type that will work 100% of the time or a MIME type that may work some of the time?

And what are my options? HTML 4? As Mark himself said, even HTML 4 can cause problems.

No matter what you choose, there will be potential for problems. You have to either accept HTML 4 problems or XHTML problems. Mark has chose HTML 4, I'm sticking with XHTML.