Re: validator does NOT validate XHTML 1.0

Devon Y. <vehementpetal@hotmail.com> wrote:

>This morning I discovered that XHTML docs without the XHTML namespace, 
>validate on the W3's http://validator.w3.org/. This is 100% wrong
>according to the XHTML 1.0 Recommendation, which says "The root element
>of the document must contain an xmlns declaration for the XHTML
>namespace [XMLNS]." (http://www.w3.org/TR/xhtml1/#docconf). I can only
>imagine how much this error is (and will be) affecting websites.

I'm afraid the XHTML Reccomendation does not adequately reflect the
accompanying DTD. The definition in the DTD is:

<!ATTLIST html
  %i18n;
  id          ID             #IMPLIED
  xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
  >

That is, the "xmlns" attribute on the "html" element is "FIXED". This means
it can be omitted and will then be implicitly understood to have the value
from the DTD, or it can be included and will generate an error if it is
different from the value in the DTD. Just try to Validate a document with a
bogus value for the "xmlns" attribute.

It's quite possible that the HTML WG intended to express an "Additional
Constraint", above what is possible to express in a DTD, but that is a
different matter and not one we can do a whole lot about I'm afraid.


-- 
Terje, you are a sick and twisted individual, and I
think I speak for all of us when I say, "Thank you!"

               -- John Gruber <gruber@barebones.com>

Received on Thursday, 22 August 2002 18:22:34 UTC