May 10, 2003 | Category:

Content Sent Correctly

A few days ago, I read about a test someone was doing on various sites. The test showed that of 119 sites tested, only 1 site had fully conformed to XHTML. So, I wanted to see if this site passed the tests.

The first two were easy: every page on this site validates as XHTML 1.1 (or it damn well should). The last one was a known problem: sending the pages you read as application/xhtml+xml rather than text/html. So off I went to find a solution.

It wasn’t long before I found Mark Pilgrim’s Road To XHTML 2.0: MIME types, which included a trivial piece of PHP that would solve my problems. It was quickly added to my headers.

Now, this change to my PHP meant that browsers who could accept the correct MIME type got that sent to them, others (like IE/WIN) got a normal MIME type that wouldn’t strain them.

Everything was going fine until I had to edit a post (I never spell-check this until well after entries go online). The editing feature of my CMS bawked at the new MIME-type. Why? Because browsers refuse to display any XHTML in a textarea when you use the proper MIME-type, leaving me screwed since my CMS dumps XHTML straight into a textarea to be manipulated.

After a bit of fudging, it all works. I can hardly wait for a new bunch of problems when XHTML 2.0 hits.

Sorry for how boring this all turned out. I’m a little ill today, and it seemed interesting when I started writing. Oh, how wrong.