W3C home > Mailing lists > Public > www-html-editor@w3.org > July to September 2008

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

From: CE Whitehead <cewcathar@hotmail.com>
Date: Tue, 23 Sep 2008 11:10:53 -0400
Message-ID: <BLU109-W4799C7ED8D0931BA046EA4B34A0@phx.gbl>
To: Dubuc Jean-Pierre <jdubuc@oqlf.gouv.qc.ca>, "'www-html-editor@w3.org'" <www-html-editor@w3.org>



Hi, you can also omit the html tags themselves in html pages.

HTML is pretty 'robust', that is people do not have to write it perfectly for it to work!

Thus, it tolerates both upper and lower case letters and other things (other languages, such as xhtml, are to my understanding, quite a bit stricter).

So what it is is html is not that strict.

It's sloppy coding to omit the html tag specifying the version--but it works; it's sloppy coding (but sometimes necessary if your web host truncates the headings of html pages and just embeds the rest in its own page with its own heading) to put css style codes and JavaScript functions in the body itself, but it all works fine; you just need the page content and the page saved with the suffix .html or .htm

That's it.

Of course, there are some tags that need closing tags to get the page to format properly (but not the head or body tags)--these include the tags denoting lists, and tags for links.


I hope that answers your questions.

(But if you want a nicely encoded page where people can easily find style codes and JavaScript functions, then you should put those at the bottom of the header section and use tags to indicate the different sections, head, body, various divs within the body; your coding shows your page structure--your headers indicate page titles and titles of sections depending on the level header.  It's really important to use the appropriate level of headers and to divide content up into divs in case the page is to be translated into audio . . . so that it's clear to anyone/anything reading the code what the headers go with.  I think that is what the w3c says; someone correct me if I am wrong about this)


Best,


C. E. Whitehead
cewcathar@hotmail.com


________________________________



From: jdubuc@oqlf.gouv.qc.ca
To: www-html-editor@w3.org
Date: Mon, 22 Sep 2008 14:17:53 -0400
Subject: 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.




 O O (%head.content;) +(%head.misc;)   -- document head -->

 O O (%block;|SCRIPT)+ +(INS|DEL)      -- document body -->



 O O (%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;)’ and ‘(INS|DEL)’ statements instead of after, like in the ‘(%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.




 O O (%head.content;) +(%head.misc;)   -- document head -->

 O O (%block;|SCRIPT)+ +(INS|DEL)      -- document body -->



 O O (%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;)’ et ‘(INS|DEL)’, au lieu d’après, comme dans la déclaration suivante ‘(%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 15:11:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:17:57 GMT