Coding with Jesse

What about application/xhtml+xml?

It turns out I wasn't done last week when I switched the site over to XHTML 1.1. It turns out that according to the W3C, text/html is not an allowed type for XHTML 1.1. And the type application/xhtml+xml brings with it a number of concerns. The biggest concern is that Internet Explorer doesn't support this type.

I found this great guide which suggested giving Internet Explorer XHTML 1.0 Strict while browsers that support application/xhtml+xml can be server XHTML 1.1. I went ahead and did this. I had to do the following:

  1. I inspect the HTTP_ACCEPT variable, if available, to see if application/xhtml+xml is accepted.
  2. The <?xml version="1.0"?> tag is added for 1.1
  3. The appropriate <!DOCTYPE> is displayed.
  4. The <html> tag has a lang attribute for 1.0
  5. Style sheets are served using <link> for 1.0, <?xml-stylesheet?> for 1.1.
  6. Style sheet needed to be modified to give the html element a background colour.

That's all I needed to do. There are other things that may need to be done, for example changes to DOM Scripting. I feel better knowing that I can support the cutting edge, while still supporting older browsers that are behind the times.

Published on April 25th, 2005. © Jesse Skinner

About the author

Jesse Skinner

Hi, I'm Jesse Skinner. I'm a web development coach & consultant. I teach web development teams how to scale up their server infrastructure, improve automated testing and monitoring, reduce costs, and modernize their legacy systems. I focus on empowering teams through customized training and coaching.

Feel free to email me. I'm eager to hear about your challenges and see how I can make your life easier.