Re: Body start tag.

Arnaud Le Hors <lehors@w3.org> wrote:

> The current DTD (not the spec) is designed to allow the following:
>
> 1) In a frameset document:
>
> * have FRAMESET in place of BODY
> * allow NOFRAMES inside a FRAMESET as an alternate container
> * have BODY inside NOFRAMES
>
> 2) In a "normal" document (not containing a FRAMESET, but possibly used
> within a frameset):
>
> * have a BODY
> * allow NOFRAMES inside BODY to be used in as an alternate container -
> in this case BODY is not allowed of course
>
> I won't list here all the reasons for trying to achieve these particular
> goals. But as you've noted this has the drawback of making the BODY
> start tag mandatory in "normal" documents. Note that however it can
> still be omitted in NOFRAMES which is why the definition of BODY has not
> been changed.


Have you considered using two different root element types?


	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
	<!-- "normal" document ... -->

	<!DOCTYPE FRAMEDOC PUBLIC "-//W3C//DTD HTML 4.0//EN">
	<!-- "frameset" document ... -->


where the DTD defines:

	<!ELEMENT HTML O O (HEAD, BODY)>

	<!ELEMENT FRAMEDOC O O (HEAD, FRAMESET)>


Or, you could bite the bullet and make the <BODY> start-tag mandatory.
Make <HEAD> mandatory too, while you're at it.  It won't hurt any
valid HTML 2.0 or HTML 3.2 documents.  If authors want to upgrade
to 4.0 they'll need to edit their documents anyway (to change
the <!DOCTYPE ...> declaration, if nothing else); it won't be
hard to <HEAD> and <BODY> start-tags while they're at it.

AFAIK, the only reason <HEAD>, </HEAD>, <BODY> and </BODY>
were omissible in HTML 2.0 was for backwards-compatibility
with HTML 1.0.  It should be safe by now to make them
mandatory.  It would also clear up a lot of confusion.



--Joe English

  joe@art.com

Received on Wednesday, 16 July 1997 14:40:15 UTC