Re: <select>

James D Mason (MASONJD@oax.a1.ornl.gov)
Thu, 13 Apr 95 09:20:53 EDT

This is just a quick answer; I don't have a chance to look at the HTML DTDs.

But there is no intrinsic SGML reason why a <SELECT> can't be allowed in an
<OPTION> inside another <SELECT>. This sort of thing is done with lists in
many SGML applications (i.e., <LIST> inside <ITEM> inside <LIST>).

It's first of all a matter of what your DTD allows. If the DTD says something
like

<!ELEMENT LIST - - (ITEM+)>
<!ELEMENT ITEM - O (%TEXT;)>

and %TEXT includes LISTs, then you have it.

There might be some other reasons, having to do with your corporate style,
etc. for not allowing this, but in general, recursion is possible in SGML.

The reason for having instead LIST1, LIST2, LIST3, etc. rather than recursive
LISTs is often that some people don't know how to write SGML processors that
keep track of where they are in the parse tree. Good processing systems nest
lists and indent properly; poorly designed ones have to fall back on fudges
like LIST1.

Jim Mason
masonjd@ornl.gov