Re: why TITLE, not TITLE?
Joe English (joe@trystero.art.com)
Thu, 08 May 1997 19:12:11 PDT
Message-Id: <9705090212.AA18114@trystero.art.com>
To: www-html@w3.org
Subject: Re: why TITLE, not TITLE?
In-Reply-To: <199705090105.SAA09970@whenever.CS.Berkeley.EDU>
Date: Thu, 08 May 1997 19:12:11 PDT
From: Joe English <joe@trystero.art.com>
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