Re: why TITLE, not TITLE?

Chad Owen Yoshikawa <chad@CS.Berkeley.EDU> wrote:
>
> Recently, I've been playing around with a DTD-driven parser, and
> noticed that it would break when there wasn't a TITLE element
> in the document.  This was a little suprising, since a lot of
> HTML documents don't have this TITLE tag, [...]

A lot of HTML documents fail to validate for a large number of reasons...

> Making TITLE optional (e.g. TITLE? in the element
> content model for HEAD) doesn't seem to create any ambiguity in the
> grammar,  and makes simple text documents and existing HTML
> documents w/ no TITLE tag HTML-compliant.   The above 'Hello World'
> document becomes:
> <HTML><HEAD></HEAD<BODY>Hello World</BODY></HTML>

That wouldn't work; you can't omit start- and end-tags
for elements with no content (in this case HEAD), so the parser
would still complain.

The next step -- making HEAD optional -- would invalidate
all current documents that don't include an explicit <HEAD>
tag, since the parser won't infer start-tags for optional
elements.

The most drastic solution -- replacing all content models with

	<!ELEMENT xxx - O ANY>

would probably best reflect what's actually in use on the Web,
but that wouldn't be very helpful to authors who want to know what
they *should* do as opposed to what they *can* do :-)


--Joe English

  joe@art.com

Received on Thursday, 8 May 1997 22:12:15 UTC