Re: Nested Lists

> 
>    <ul>
>       <li>Heading</li>
>       <ul>
>          <li>Subitem</li>
>          <li>Subitem</li>
>       </ul>
>    </ul>
> 
> The Validation Report said:
>    Error at line 75:
>       <ul>
>          document type does not allow element "UL" here;
>          assuming missing "LI" start-tag

From RFC1866 (html2.0, which is enough) you have :

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

which means the only tag you can find inside a <ul></ul> or <ol></ol>
structure is <li> (and you can find many of them, but at least one).

Then, you read :

<!ELEMENT LI    - O %flow>

which means that </li> is optionnal, and <li></li> contains strings
of type "flow" (which is <!ENTITY % flow "(%text|%block)*"> and if you
follow the definition chain, you will find that <ul> is allowed
within <li>)

The correct minimal code is thus :

   <ul>
      <li>Heading
      <LI>
	<ul>
         <li>Subitem
         <li>Subitem
        </ul>
   </ul>

Received on Wednesday, 11 March 1998 12:49:09 UTC