Re: Puzzled by lack of HTML, HEAD and BODY tags in output

On Wed, 28 Jul 2004 16:18:28 +0200, Christophe Strobbe  
<christophe.strobbe@esat.kuleuven.ac.be> wrote:
> At 15:37 28/07/2004, John Bray wrote:

>> I guess I thought that HEAD and BODY were still essential. Certainly
>> http://www.w3.org/TR/html401/struct/global.html suggests they are still
>> needed, though I've not burrowed into the details of the specification.

> Yes, the elements are essential, but the start and end tags are strictly
> optional (this is also the case with the elements HTML and TBODY).
..
> When start and end tags are omitted, an SGML parser infers the presence
> of the element with the help of the DTD. But browsers don't contain
> SGML parsers, so some get confused by the absence of optional tags.

I haven't found this to be really a problem, *except* when applying  
stylesheets to the tagless elements in some browsers. And Netscape 4 can  
get confused when you don't close your <p>-s and <li>-s.

> The above explanation only applies to SGML-based languages (like HTML 4),
> not to XML-based languages. Omitting start and end tags is not legal
> in XHTML, so Tidy should leave those in.

Agreed. If Tidy puts any XHTML doctype on top of the document, -omit  
should not drop optional tags, because there are no optional tags in XHTML.

-- 
The Web is a procrastination apparatus:    |  Rijk van Geijtenbeek
It can absorb as much time as              |   Documentation & QA
is required to ensure that you             |   Opera Software ASA
won't get any real work done.  - J.Nielsen |  mailto:rijk@opera.com M

Received on Thursday, 29 July 2004 05:15:06 UTC