W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2004

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

From: Rijk van Geijtenbeek <rijk@opera.com>
Date: Thu, 29 Jul 2004 11:12:00 +0200
To: "HTML-tidy list" <html-tidy@w3.org>
Message-ID: <opsbv6iax0icz8n2@rijk-01.lan>

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

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:54 UTC