Re: Nested Lists

Aymeric Poulain Maubant (Aymeric.PoulainMaubant@enst-bretagne.fr)
Wed, 11 Mar 1998 18:48:59 +0100


Message-Id: <199803111749.SAA29608@melimelo.enst-bretagne.fr>
From: Aymeric Poulain Maubant <Aymeric.PoulainMaubant@enst-bretagne.fr>
To: www-html@w3.org
In-reply-to: Your message of "Wed, 11 Mar 1998 11:39:24 EST."
             <3506BEB6.2ABEFFE6@student.hik.se> 
Date: Wed, 11 Mar 1998 18:48:59 +0100
Subject: 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>