But what about this for static pages?
I don't use php / asp etc (just static xhtml pages) and therefore cannot code this logic into the MIME type served.
However I want to take advantages of the xhtml benefits on the browsers that support application/xhtml+xml
Can I not simply do the following:
Does Microsoft Internet Explorer accept the media type application/xhtml+xml?
No. However, there is a trick that allows you to serve XHTML1.0 documents to Internet Explorer as application/xml.
Include at the top of your document the line in bold here:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="copy.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
where copy.xsl is a file that contains the following:
Note that this file must be on the same site as the document referring to it.
Although you are serving the document as XML, and it gets parsed as XML, the browser thinks it has received text/html, and so your XHTML 1.0 document must follow many of the guidelines for serving to legacy browsers.
Your XHTML document will continue to work on browsers that accept XHTML 1.0 as application/xml.