Re: Form Content Models [was: HTML 3.2 Content Models ]

Daniel W. Connolly (connolly@beach.w3.org)
Fri, 10 May 1996 12:38:42 -0400


Message-Id: <m0uHvDH-0002TfC@beach.w3.org>
To: dkgsoft@ozemail.com.au
Cc: www-html@w3.org
Subject: Re: Form Content Models [was: HTML 3.2 Content Models ]
In-Reply-To: Your message of "Sat, 11 May 1996 02:08:30 +1000."
             <199605101607.CAA25952@oznet02.ozemail.com.au> 
Date: Fri, 10 May 1996 12:38:42 -0400
From: "Daniel W. Connolly" <connolly@beach.w3.org>


As I stated earlier, issue tracking will be simplified if you
keep to one issue per message. I'll address your points
separately:

In message <199605101607.CAA25952@oznet02.ozemail.com.au>, "Dianne Gorman" writ
es:
>Yesterday I commented very vaguely  (sorry) on a couple of problems
>in the HTML 3.2 DTD.  I'm more precise this time:
>
>1. Forms
>
>HTML Features at a Glance at
>http://www.w3.org/pub/WWW/MarkUp/Wilbur/ states " INPUT, SELECT and
>TEXTAREA are only allowed within FORM elements. "  But according to 
>the DTD, these are merely text-level tags which are in no way 
>confined to the FORM element:
>
><!ELEMENT FORM - - %body.content -(FORM)>
>
><!ENTITY % text "#PCDATA | %font | %phrase | %special | %form">
><!ENTITY % form "INPUT | SELECT | TEXTAREA">
>
>The HTML 2.0 DTD has:
><!ELEMENT FORM - - %body.content -(FORM) +(INPUT|SELECT|TEXTAREA)>
>
>Is there a logical reason for INPUT|SELECT|TEXTAREA being moved to
>%text in the HTML 3.2 DTD?

We wrestled for hours over this one. We're pretty sure there's
no good answer, but we'd be pleased as punch to see one.

SGML isn't sufficiently expressive to say exactly what we want to say,
so "INPUT, SELECT and TEXTAREA are only allowed within FORM
elements. " is an application convention.

The screw cases are these:

(see http://www.w3.org/pub/WWW/MarkUp/html-test/forms/form-exceptions.html)

	<h2>Input in option in select</h2>

	<form action="/dev/null">
	<select name=xxx>
	<option>xyz <input name=trouble>
	<option>
	</select>
	</form>

	<h2>Input outside Form</h2>

	<p>stuff <input name=orphan>


The former is valid according to the HTML 2.0 DTD, and there's
no application convention in the spec that says anything about it.

The latter is valid according to the SGML part of the HTML 3.2
DTD, but prohibited by the application conventions.

For background, see some of the comp.text.sgml archives regarding
inclusion exceptions:


Subject: The case against inclusion exceptions (again)
From:           David Megginson <dmeggins@aix1.uottawa.ca>
Organization:   University of Ottawa
Date:           29 Apr 1996 07:34:53 -0400
Newsgroups:     comp.text.sgml
Message-ID:     <m2pw8rnu02.fsf@baeda.english.uottawa.ca>


http://www.let.ruu.nl/departments/C+L/loeffen/archive/cts/s/2286.htm

From: Christoph Altenhofen (caltenhofen@vnet.ibm.com ) 
Date: 12 Aug 1994 12:12:38 UT 

For the selection of elements, allowed to include, I recommend Goldfarb
419:2:

  - Inclusions should not be used for contextual subelements.
    They should be used only for elements that are not logically
    part of the content at that part where they occur in the
    document [...].

From: Erik Naggum (erik@naggum.no ) 
Date: 13 Aug 1994 19:02:53 UT 

[...]
exclusion exceptions are almost obviously useful.  to halt recursion is
just one use.  another is to allow larger content models than will be used
in all contexts, then let some element higher up exclude unwanted elements.
this allows a form is generic/specific separation that is not tied to the
element, but rather to its relationship to other elements.  this is a very
powerful mechanism that requires the exclusion exception to work.

inclusion exceptions are _not_ useful, but probably not obviously so.
nothing can be done with inclusion exceptions that cannot be done without,
and the methods used without inclusions are better than those used with.

[...]