Re: *.xhtml filenames, mimetypes and and mathML problem

I have set up my site now to use content negotiation.  Unfortunately
I found that I had to fudge things using
    AddType text/html;qs=0.8 .html
to try to ensure that the xhtml was the preferred option and not html.
(The reason is that I have a lot of readers out there using IE+MathPlayer.)
I don't know if that will fix anything as per the standard bots.  I will have
to wait and see.

The idea of writing code to deal with every browser, bot, plugin or agent 
out there (and there are hundreds not yet mentioned) fills me with some 
kind of horror.  After all, I want to be writing good web pages, not 
spending my time tracking the latest changes in browsers and bots.

Richard

On Friday 24 February 2006 04:06, Jason Davis wrote:
> Masatran (Deepak), R. wrote:
> > * William F Hammond <hammond@csc.albany.edu> 2006-02-23
> >
> > Content Negotiation works well for my XHTML+MathML webpage
> > <http://research.iiit.ac.in/~masatran/model/>. It is accepted as
> > XHTML+MathML by XHTML-aware browsers. It is present in Google's cache at
> > <http://64.233.179.104/search?q=cache:research.iiit.ac.in/~masatran/model
> >/>. The only problem is that Google's cache serves it as plain HTML.
>
> Then instead of checking for the presence of "application/xhtml+xml" in
> the accept variable (that, incidentally, leaves out Safari which
> otherwise understands XML/XHTML just fine), you could also check for the
> presence of "googlebot" in the user agent variable, and send that the
> XHTML mime-type as well.
>
> To make it even more complicated, consider the case where the user is
> browsing with Internet Explorer and has the DesignScience MathML plugin
> installed. His browser suddenly can accept application/xhtml+xml and
> text/xml documents, and the page is *internally* converted to HTML (in
> client memory) so that the MathML will render using IE's weird
> implementation of HTML namespaces (it will actually internally rewrite
> all the MathML to use an mml prefix, and insert two special tags into
> the head of the document). Internet Explorer without the DesignScience
> plugin will just either not understand the mime-type or display the XML
> tree. Fortunately, the MathML plugin inserts a "MathPlayer" into the
> user-agent of Internet Explorer, letting you detect it.
>
> To summarize, for XHTML content negotiation, if the user-agent contains
> "AppleWebKit", "Googlebot", or "MathPlayer", or the accept variable
> includes "application/xhtml+xml", then you can send as
> application/xhtml+xml, otherwise send as text/html.
>
> -Jason Davis

Received on Friday, 24 February 2006 09:41:02 UTC