Re: Bug in validator with HTML 4 documents that are towards at XH TML c

Claus Andre Faerber <> wrote:

>Marc A. Donges <> schrieb/wrote:
>>I recently tried to make my documents, which complied with HTML 4.0
>>Transitional, as compatible with XHTML 1.0 as possible (whithout
>>switching the DTD yet).
>You can't do this. SGML-based HTML and XHTML use incompatible SGML  
>declatations (as XHTML is based on XML).

To elaborate a bit...

* HTML is defined as an application of SGML in a SGML DTD.

* XHTML is defined as an application of XML in a XML DTD.

One does not modify HTML to be compatible with XHTML. One converts
HTML into XHTML and then modifies the XHTML to be (sorta) compatible
with HTML _browsers_.

The compatibility guidelines in the XHTML 1.0 Reccommendation are to
help you make XHTML documents display in today's common browsers the
way the HTML document would have, but the document still is XHTML and
should include an XHTML DOCTYPE declaration (if it contains one at all;
the DOCTYPE is optional in XHTML).

The compatibility guideline's reccomendations are intended to fool
browsers into thinking the document is "really" HTML and render it.
That is the reason why the XHTML 1.0 Reccommendation suggests serving
XHTML documents with a MIME type of "text/html" instead of "text/xhtml",
"text/xml", or "application/xml" which would be the obvious and, arguably,
the correct MIME types. If you did, however, most browsers would offer
to save the document to disk because they have not been configured to
try to render documents with other MIME types then "text/html".

However, where other tools -- such as the W3C HTML Validation Service
(which, despite the name, also validates XML/XHTML), authoring and
document management systems, workflow managers, etc. -- are concerned,
the document is, and must be labeled as, XHTML to be useable. The only
reason the compatibility guidelines work at all is that current browsers
do not actually contain SGML parsers. If they had, the XHTML 1.0
compatibility guidelines would get you nowhere as browsers would barf
on it no matter what you did.

Received on Wednesday, 2 February 2000 05:19:45 UTC