Re: Sniffing XHTML sent as text/html

On Wed, 13 Sep 2000, Dan Connolly wrote:

> > There should be no
> > sniffing of text/html documents to see if they are really XHTML.
> 
> I don't know what you mean by "sniffing"; it is a simple
> computation to distinguish conforming XHTML documents
> from conforming HTML 4.01, HTML 4.0, HTML 3.2, and HTML 2.0
> documents: the latter begin with doctype declarations with
> well-known FPIs and URIs, e.g.:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>                      "http://www.w3.org/TR/html4/strict.dtd">
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>                      "http://www.w3.org/TR/html4/loose.dtd">

I believe that this is exactly what they mean by sniffing -- read the
start of the incoming text/html data and use the data there to determine
whether it is 'really' HTML (or rather the mess of tags that people
generally call HTML) or XML (XHTML), and the pass the data on acordingly.  
I tend to think that such sniffing, even if it works, is more confusing to
developers than helpful, since it is just one more way for things to go
wrong in a hard to detect way.  

Ian
--
Ian Graham ................................... ian.graham@utoronto.ca
......................................... http://www.utoronto.ca/ian/

Received on Friday, 15 September 2000 18:43:06 UTC