/ I’ve converted to application/xhtml+xml

So I’ve gone ahead and decided what to do about my dilemma. I’m now serving my pages using the application/xhtml+xml MIME type to compliant browsers and the text/html MIME type to everything else. In order to be able to do this, I installed a wonderful little plugin called WP Content Negotiator written by Admiral Justin. It feels like I just got my first tattoo. It’s a combination of feeling like “wow, I did it!” and “oh boy, I hope I don’t regret this.”

I have to say though that I really learned the meaning of the expression “be careful what you wish for.” A while ago in my post Invalid markup: does it matter? I was complaining about how we should have zero tolerance for invalid markup, and that browsers were too lax with tag soup. Well, let me tell you, installing this plugin was a slap in the face for yours truly. If ever there was a surefire way to break my site right quick, this was it. Colour me shamed. I also learned another valuable lesson: “never install plugins directly on the production version of your site, you’ll most likely break it.”

So there I was, with this giant error message staring me down because the XML parser I had just invoked in Firefox didn’t like my markup. Horror of horrors, I just realized that I couldn’t get by with even one error in my markup. So a little nail-biting, and some quick fixes later, the site is fully XHTML 1.1 Strict served with the application/xhtml+xml MIME type. Not without some consequences however. For example, I can no longer run AdSense or Technorati JavaScripts because of the way they try to write to the DOM. It just doesn’t work the same way with the XML DOM and I have yet to figure out what to do about it. Unfortunately, according to Alex Stevenson’s experience, it seems that Google isn’t about to fix the AdSense XHTML compatibility problem.

It’s a very awkward feeling though, to know that at any given moment, a lapse in my markup will cause a page to stop working. Of course, you might be asking yourself: “why do something like that?” Well, like I told a friend earlier today, “my site is my indulgence, and it’s where I can exercise my purist tendencies.” Sure it’s fanatical to a fault, but hey, where else am I going to have the fun of experimenting with the new and chic? Besides, I can always go back to boring old text/html whenever I want. But where’s the challenge in that?


Read more from the archive.