Re: Generic LIST Element

Joe English (jenglish@crl.com)
Thu, 03 Aug 1995 16:52:31 -0700


While we're on the subject, how does this content
model look?

<!ELEMENT (UL|OL) - - (LI+)>
<!ELEMENT LI - O (LIH, (%block;)*) >
<!ELEMENT LIH O O (%text;)* >

For reference, the current definition is:

<!ELEMENT (OL|UL) - - (LI)+>
<!ELEMENT LI - O %flow>
<!ENTITY % flow "(%text|%block)*">

Currently, <LI> can contain block-level and phrase-level
elements (and #PCDATA) freely intermixed. The new model
would only allow an initial sequence of phrase-level text
(wrapped in an LIH); "free-floating" character data would
not be allowed after the first block element.

Since the LIH is contextually required, the start-tag can be
omitted, so existing markup like:

<ul>
<li>Short items.
<li>
<p>Longer items....
<p>...
<li>
<ul>
<li>Nested lists
</ul>
<li>Nested lists with headers:
<ul>
<li>blah.
</ul>
</ol>

would still be conformant.

There are some subtle changes, but nothing that should affect
current browsers: the internal element structure would change,
and <LI> would no longer have mixed content so spurious whitespace
between block-level elements would disappear. (This is a desirable
change, IMHO.) The LIH element would facilitate collapsible
outlines (as discussed earlier), and would in many cases
require no change to current documents.

Something similar could be done for <DD> and other elements
of that nature.

--Joe English

jenglish@crl.com