Re: Suppressed content in HEAD: myth or reality?

Dan Connolly (connolly@w3.org)
Thu, 4 May 95 04:26:31 EDT

Brian Behlendorf writes:
> >
> > Any good suggestions on what to do when the user opens a <HEAD> and forgets to
> > close it?
>
> Put up a big red dialog box that says "BAD HTML", with an explanation
> "Apparently you forgot to check your <HEAD>..." Etc.

Well.. not quite. According to the current DTD, </HEAD> is completely
optional. An SGML parser infers it at the right place. Of course SGML
parsers choke badly on uknown tags.

Quick Quiz: Is the following legal? Is abc in HEAD or BODY?

Input

1. <!-- select doctype above... -->
2. <HEAD>
3. <TITLE><!-- your title here --></TITLE>
4.
5. abc
6. <!-- your HTML test data -->
7. </BODY>
8.

Ye ole validation service at

http://www.halsoft.com/html-val-svc/

says:

Bing! It's legal, and abc is in BODY:

Parsed Output (Element Structure Information Set)

AVERSION CDATA -//IETF//DTD HTML//EN//2.0
(HTML
(HEAD
(TITLE
)TITLE
)HEAD
(BODY
-abc\n\n
)BODY
)HTML
C

No idiot lights required.

C'mon folks: check your facts. Cite your sources. Keep the knee jerks
to a minimum.

Dan