W3C home > Mailing lists > Public > www-html@w3.org > July 2000

Re: What is an XHTML document?

From: Karl Ove Hufthammer <huftis@bigfoot.com>
Date: Tue, 25 Jul 2000 17:15:54 +0200
Message-ID: <00cd01bff650$87726160$85448ed5@huftis>
To: "L. David Baron" <dbaron@fas.harvard.edu>, <www-html@w3.org>
----- 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

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

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

| 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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:54 UTC