Re: XHTML 1.0 DTD and namespace declaration

mikael@staldal.nu (Mikael Ståldal) wrote:

> The XHTML 1.0 DTD contains this namespace declarations:
> 
> <!ELEMENT html (head, body)>
> <!ATTLIST html
> %i18n;
> xmlns       %URI;          #FIXED 'http://www.w3.org/1999/xhtml'
> >
> 
> However, this conflicts with the the following paragraph in section 4
> of the Namespace recommendation:

This doesn't conflict with the Namespaces in XML Recommendation.
"3.3.2 Attribute Defaults" of the XML 1.0 Recommendation says:

    In an attribute declaration, #REQUIRED means that the attribute must
    always be provided, #IMPLIED that no default value is provided.
    [Definition: If the declaration is neither #REQUIRED nor #IMPLIED,
    then the AttValue value contains the declared default value; the
    #FIXED keyword states that the attribute must always have the default
    value. If a default value is declared, when an XML processor
    encounters an omitted attribute, it is to behave as though the
    attribute were present with the declared default value.]

  cf. http://www.w3.org/TR/REC-xml#sec-attr-defaults

So having the #FIXED keyword does state that the attribute must
always have the default value (in the case of the XHTML 1.0 DTD,
'http://www.w3.org/1999/xhtml'), but it doesn't prohibit at all
to directly provide that value in the XML document entity (i.e.
XHTML document).  Using the #REQUIRED keyword would ensure that
the attribute must always be provided, but it doesn't guarantee
whether the declared value is the correct one.  So the HTML
Working Group decided to use the #FIXED keyword to ensure that
the declared value is the correct one.

As you cited, if you care for correct operation with non-validating
XML processors, namespace declarations must be provided directly,
and if you look at examples in the XHTML 1.0 Recommendation, you'll
realize that indeed all examples explicitly provide namespace
declarations, including the XHTML 1.0 Recommendation itself.

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Sunday, 15 October 2000 23:51:12 UTC