Re: HTML 3.2 PR - lists

[ By way of prelude, I have not yet had time to even look
  at the latest W3C HTML 3.2 spec, and I can't find a copy
  of (any version of) the 3.0 draft(s) in the (distressingly
  large) pile of papers on my desk, so the following only refers
  to HTML 2.0 as defined in RFC1866.  Other HTML specifications
  might and probably do say something different, so the foregoing
  observations are not necessarily accurate wrt. HTML as it is
  presently defined and used.  IOW: Take with a grain of salt :-)
]


Foteos Macrides <MACRIDES@SCI.WFBR.EDU> wrote:
> Joe English <joe@trystero.art.com> wrote:
> >There is also a structural difference between MENU/DIR and UL,
> >at least in RFC 1866:  MENU and DIR cannot contain nested block-level
>                         ^^^^^^^^
> >elements, while UL may.   [...]
>
>       Do correct me if I'm wrong, 'cuz I still can't read DTDs with
> high confidence that I understand their notation, but from the HTMLized
> "verbal" descriptions of the HTML 2.0 RFC and (expired) HTML 3.0 draft
> only DIR is precluded from being nested, because it's a columnar array,
> and thus <UL PLAIN> and <MENU> *are* fully equivalent, except for issues
> of "compactness", which are to be handled via variations in font size,
> and thus relevant only to GUI's.


RFC 1866 5.6.1 "Unordered List" paragraph 2 says:

|       The content of a <UL> element is a sequence of <LI> elements.
|       For example: [...]

whereas 5.6.3 "Directory List" paragraph 2 says:

|       The content of a <DIR> element is a sequence of <LI> elements.
|       Nested block elements are not allowed in the content of <DIR>
|       elements. For example: [...]

and 5.6.4 "Menu List" paragraph 2 says:

|       The content of a <MENU> element is a sequence of <LI> elements.
|       Nested block elements are not allowed in the content of <MENU>
|       elements. For example: [...]


So by my interpretation MENU is structurally more similar to DIR
than it is to <UL PLAIN>.  The 2.0 DTD clarifies (and, I believe,
supports) this interpretation, see below.

>       Or do you mean that UL and not MENU can have *other* block
> level elements as content.  I thought they both could only have LH
> and LIs (perhaps not LH for MENU in the actual DTD, but what the heck
> in "reality" 8-).


That's absolutely correct; I (and RFC1866!) should have been
more clear about what "nested block elements" means, i.e., block
elements that appear directly _or indirectly_ inside another element.

From the 2.0 DTD:

|       <!ELEMENT (OL|UL) - -  (LI)+>

which means that UL elements contain one or more LI elements
(just like you said).  On the other hand, for MENU it has:

|       <!ELEMENT (DIR|MENU) - -  (LI)+ -(%block)>
:                                       ^^^^^^^^^

The undersharkfinned part is an "exclusion exception";
it means that the indicated element types (%block; expands
to  `P | UL | ... | DL | PRE | ... ', i.e., all the block-level
elements) may not appear as children *or descendants* of
a (DIR|MENU).  That is: although an LI element can normally contain
block-level elements (by virtue of its declaration,

|	<!ELEMENT LI    - O %flow>

where %flow; expands to `(%text|%block)*'),  an LI
inside a MENU or DIR element can not (by virtue of the
exclusion exception in the <!ELEMENT (MENU|DIR) ....>
declaration.)

Does that make any sense?



--joe@art.com

Received on Wednesday, 13 November 1996 12:42:33 UTC