Re: Sniffing XHTML sent as text/html

Steven Pemberton wrote:
> 
> David,
> 
> The HTML WG has discussed this issue: the intention was to allow old
> (HTML-only) browsers to accept XHTML 1.0 documents by following the
> guidelines, and serving them as text/html. Therefore, documents served as
> text/html should be treated as HTML and not as XHTML.

I'm not sure I understand what you mean... do you mean
that every document served as text/html shall
be a conforming HTML 4.01, HTML 4.0, HTML 3.2 or HTML 2.0
document? i.e. that text/html body parts must
not contain ?

i.e. what are you saying is the specified behavior
of a conforming user agent, in the sense of 
the XHTML 1.1 spec
<http://www.w3.org/TR/xhtml11/conformance.html#s_conform>,
when presented with a text/html body part
whose text constitutes a
Strictly Conforming XHTML 1.1 Document?

If, by "treat it as HTML," you mean "treat it
as per the behaviour specified for user agents
in the HTML 4.01 spec," then the behaviour
is unspecified, since no conforming XHTML 1.1
document is a conforming HTML 4.01 document,
and the behaviour of an HTML 4.01 user agent
when presented with other than a conforming
HTML 4.01, HTML 4.0, HTML 3.2, or HTML 2.0
document is unspecified.

The current specification for the text/html
media type says that it apples to XHTML 1.0
as well as HTML 4.01 etc:

	In addition, [XHTML1]
      defines a profile of use of XHTML which is compatible with HTML
      4.01 and which may also be labeled as text/html.

	-- http://www.ietf.org/rfc/rfc2854.txt
	<-- http://www.isi.edu/in-notes/iana/assignments/media-types/text/html



> 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">



-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Wednesday, 13 September 2000 18:11:01 UTC