Coding with Jesse

What about application/xhtml+xml?

April 25th, 2005

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.

About the author

Jesse Skinner Hi, I'm Jesse Skinner. I work with development teams to speed up and stabilize web applications, reduce server costs, fix difficult bugs, modernize legacy applications, and improve developer productivity. I'd love to hear from you and see how I can make your life easier.