Technical information (DTD 4.01) : Is it possible to omit HEAD and/or BODY tags within HTML tag ?

Dear W3C,

I just can't understand how it's possible to omit HEAD and/or BODY tags within HTML tag.
I have extract those tag declaration from the HTML 4.01 DTD.


<!ELEMENT HEAD<http://www.w3.org/TR/REC-html40/struct/global.html#edef-HEAD> O O (%head.content;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#head.content>) +(%head.misc;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#head.misc>)   -- document head -->

<!ELEMENT BODY<http://www.w3.org/TR/REC-html40/struct/global.html#edef-BODY> O O (%block;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#block>|SCRIPT)+ +(INS|DEL)      -- document body -->

<!ENTITY % html.content "HEAD, BODY">

<!ELEMENT HTML<http://www.w3.org/TR/REC-html40/struct/global.html#edef-HTML> O O (%html.content;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#html.content>)                  -- document root element -->

The HTML tag declaration specifies that HEAD and BODY tags are mandatory within the HTML tag itself, and in that specific order, but in the HEAD and BODY tags declarations, it's possible to ommit those tags in the HTML document ? How can that be ?

Also, why is the '+' operator before the '(%head.misc;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#head.misc>)' and '(INS|DEL)' statements instead of after, like in the '(%block;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#block>|SCRIPT)+' statement ? Doest it change the behavior of the '+' operator ? Or its meaning ? I could not find any documentation on that syntaxe.

See, for my work, I have to fully understand the HTML 4.01 DTD.
To accomplish that I looked for documentation about DTD editing on the internet, so I could understand how yours are written.
I found what appears to me some incomplete documentation. I asked adviced to people in my professional circle, but no one could provide me with an answer.

Could you explain to me how I should have interpreted those preceding DTD statements ?
Or do you have any detailed DTD editing documentations, references, ... I could refer to, so I would have all the knowledge to fully understand the HTML 4.01 DTD ?

Thanks for your concern

Jean-Pierre Dubuc
Québec, PQ, Canada (french)


French version of the preceding email :

Bonjour,

Je n'arrive pas à bien comprendre les extraits suivants de la DTD de la spécification du HTML 4.01, en ce qui concerne la possibilité d'omettre les balises HEAD et/ou BODY, à l'intérieur de la balise HTML.


<!ELEMENT HEAD<http://www.w3.org/TR/REC-html40/struct/global.html#edef-HEAD> O O (%head.content;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#head.content>) +(%head.misc;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#head.misc>)   -- document head -->

<!ELEMENT BODY<http://www.w3.org/TR/REC-html40/struct/global.html#edef-BODY> O O (%block;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#block>|SCRIPT)+ +(INS|DEL)      -- document body -->

<!ENTITY % html.content "HEAD, BODY">

<!ELEMENT HTML<http://www.w3.org/TR/REC-html40/struct/global.html#edef-HTML> O O (%html.content;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#html.content>)                  -- document root element -->

La déclaration qui concerne la balise HTML spécifie que les balises HEAD et BODY sont obligatoires, et dans l'ordre spécifié.
Toutefois, dans les déclarations des balises HEAD et BODY, il est aussi spécifié que l'on peut omettre ces balises.
Comment cela est-il possible si les balises HEAD et BODY sont requises à l'intérieur d'une balise HTML ?

Aussi, pourquoi l'opérateur '+' est-il placé avant les déclarations '(%head.misc;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#head.misc>)' et '(INS|DEL)', au lieu d'après, comme dans la déclaration suivante '(%block;<http://www.w3.org/TR/REC-html40/sgml/dtd.html#block>|SCRIPT)+' ?
Est-ce que cela change le comportement de cet opérateur ? Ou sa signification ? Je n'ai point trouver d'informations sur cette syntaxe particulière.

Voyez-vous, pour mon travail, je me dois de comprendre parfaitement la DTD de la spécification du HTML 4.01
Pour ce faire, j'ai recherché sur internet comment éditer une DTD, afin de pouvoir ainsi comprendre la DTD de la spécification du HTML 4.01
J'ai trouvé certaines documentations, mais de manière générale, elles me semblent toutes incomplètes.
J'ai aussi sollicité mon entourage professionnel, sans plus de succès.

Pourriez-vous m'expliquer comment je devrais interpréter les spécifications ci-haut ?
Ou pourriez-vous me fournir, ou me diriger, vers une documentation détaillée d'édition d'une DTD, afin que je puisse avoir toutes les notions nécessaires pour bien comprendre celle du HTML 4.01 ?

Bien à vous

Jean-Pierre Dubuc
Québec, PQ, Canada

Received on Tuesday, 23 September 2008 08:22:50 UTC