Re: discrepancy in the <head> definition

Hello,

Thanks for your detailed reply.  Now I understand your point.
In short, this is not an error.  See below for details.

"Bedri Dogan Emir" <emir_bedri@hotmail.com> wrote:

> Dear Mr. Ischikawa,
> I thank you very much for your message and here are my findings :
> The declaration of the <head> element in the DTD of HTML 4.01 is as
> follows :
>  
> <!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" 
>                                 -- repeatable head elements --> 
>  
> <!--================ Document Head ========================-->
> <!-- %head.misc; defined earlier on as "SCRIPT|STYLE|META|LINK|OBJECT"
> --> 
>  
> <!ENTITY % head.content "TITLE &  BASE?">
>  
> <!ELEMENT HEAD O O (%head.content;)+ (%head.misc;)  -- document head -->

No, the actual definition is:

  <!ELEMENT HEAD O O (%head.content;) +(%head.misc;)  -- document head -->

Note the difference of the placement of "+".  It's not a suffix of
(%head.content;) but a prefix of (%head.misc;), which has completely
different meaning.

> There is no an explicit definition of the content model of  the <head>
> element in the DTD of the HTML 4.01 and we should deduct it from the
> definition given in the DTD. But the definition neither allows the usage
> of the elements stated within %head.misc not at all or any time we need,
> nor it implies the usage at any order. This is an error. With that
> definition we can use only one <meta> and nothing else if we have ever
> used one <meta> (besides %head.content of course). 

No.  "+(%head.misc;)" means SCRIPT, STYLE, META, LINK and OBJECT elements
may appear within HEAD any time, anywhere, in any order.  It is an SGML
feature called "inclusion".

> But the error is corected in the DTD of XHTML 1.0  with the definition
> of <head> element :
>  
> <!--================ Document Head ========================--> 
> <!ENTITY head.misc "(script|style|meta|link|object|isindex)*">
>  
> <!--content model is %head.misc; combined with a single  title and an
> optional base element in any order-->
>  
> <!ELEMENT head(%head.misc;,
>   ((title, %head.misc;, (base, %head.misc;)?) | (base, %head.misc);,
> (title, %head.misc;))))>

XML doesn't allow inclusion, that's why XHTML 1.0 had to change
the content model of the head element.

> Please note the asteristisk in the entity %head.misc and the ordering of
> the definition which allows the usage “in any order” . Things seems to
> be in order now but that is not valid for a current DTD of HTML 4.01. 
> I think the correct definition for the DTD of HTML 4.01 would be as
> follows :
> <!--================ Document Head ========================-->
> <!ENTITY head.misc "(script|style|meta|link|object)*">
>  
> <!--content model is %head.misc; combined with a single title and an
> optional base element in any order--> 
>  
> <!ELEMENT head(%head.misc;, ((title, %head.misc;, (base, %head.misc;)?)|
>  
> (base, %head.misc);, (title, %head.misc;))))> 

With SGML's "inclusion" and "& connector" features,
"(%head.content;) +(%head.misc;)" means almost the same thing.
It does have a side-effect, in that it also allows (%head.misc;)
inside TITLE, that's why the content model of the TITLE element
disallows them by an another SGML feature called "exclusion", like:

  <!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title -->

> I thank you very much for your kind interest and I will be very happy if
> I will have  your comments on the subject. 

Hope this clarifies the issue.

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

Received on Thursday, 6 February 2003 06:23:54 UTC