Re: What is an XHTML document?

----- Original Message -----
From: "L. David Baron" <dbaron@fas.harvard.edu>
To: <www-html@w3.org>
Sent: Monday, July 24, 2000 10:07 PM
Subject: What is an XHTML document?


| Section 3.2 of the XHTML spec has requirements for handling of "XHTML
| documents." [1]  Section 5.1 says that XHTML Documents may be sent as
| "text/html".
|
| If these conformance requirements apply to XHTML documents served as
| "text/html", then user agents that also support SGML-based HTML must
| (possibly in violation of section 7.2.1 of RFC 2616 [2]) detect whether
| the content sent as text/html is XHTML or not.  The specification
| should say how they are to detect XHTML.

The XHTML Rec. says:

"A Strictly Conforming XHTML Document is a document that requires only the
facilities described as mandatory in this specification. Such a document must
meet all of the following criteria:

1. It must validate against one of the three DTDs found in Appendix A.
[Only useful for validating parsers/UAs, which Mozilla isn't]

2. The root element of the document must be <html>.

3. The root element of the document must designate the XHTML namespace using the
xmlns attribute [XMLNAMES]. The namespace for XHTML is defined to be
http://www.w3.org/1999/xhtml.

4. There must be a DOCTYPE declaration in the document prior to the root
element. The public identifier included in the DOCTYPE declaration must
reference one of the three DTDs found in Appendix A using the respective Formal
Public Identifier. The system identifier may be changed to reflect local system
conventions."

Both 2, 3 and 4 should IMO be used to detect if the document is a XHTML
document.

| It is unclear how to detect
| XHTML since an XML declaration is not required, and future versions of
| XHTML could have any FPI or system identifier in the DOCTYPE
| declaration.

A browser shouldn't even *try* to render a type document it doesn't recognize,
i.e. XHTML 1.1 or 2.0. For a browser, a document should only be considered XHTML
if it uses the XHTML 1.0 DOCTYPE. (Of course, future browsers, developed when
later versions of XHTML are available should support the new DOCTYPES).

-- 
Karl Ove Hufthammer

Received on Tuesday, 25 July 2000 11:54:11 UTC