W3C home > Mailing lists > Public > www-validator@w3.org > May 2000

Nested lists

From: Peter Gylden Houmann <PGH@si.dk>
Date: Mon, 8 May 2000 06:05:48 -0400 (EDT)
Message-ID: <914ADD940AD9D111B86600805F89AA3160B246@simail.si.dk>
To: "'www-validator@w3.org'" <www-validator@w3.org>
Hi

I have a problem with nested lists and using </li>. The validator won't
validate the code, see below, and I just can't figure out what's wrong.
According to the 4.01 spec. the </li> is optional
(http://www.w3.org/TR/html4/struct/lists.html#idx-list-3).
When I omit the end tag, there's no problems.

It is important that the code follow a w3 spec. as the danish state
standards for webpages and electronic publications request it.
Document Checked
*	URI <http://www.w3.org/Addressing/>:
<http://www.si.dk/netsteder/menu.htm> 
*	Last modified: Mon May 8 08:56:50 2000 
*	Server: Apache/1.2.5 
*	Content length: 577 
*	Character encoding: unknown 
*	Document type: HTML 4.0
<http://www.w3.org/TR/1998/REC-html40-19980424/> Strict 
Below are the results of attempting to parse this document with an SGML
parser. 
*	Line 10
<http://validator.w3.org/check?&ss=y&uri=http%3A//www.si.dk/netsteder/menu.h
tm>, column 20: 
		  <ol class="nav-bar2">
		                      ^
		Error: document type does not allow element "OL" here;
assuming missing "LI" start-tag

Sorry, this document does not validate as HTML 4.0
<http://www.w3.org/TR/1998/REC-html40-19980424/> Strict. 
If you use CSS <http://www.w3.org/Style/css/> in your document, you should
also check it for validity
<http://jigsaw.w3.org/css-validator/validator?uri=http://www.si.dk/netsteder
/menu.htm> using the W3C CSS Validation Service
<http://jigsaw.w3.org/css-validator/>. 

Source Listing
Below is the source input I used for this validation: 
   1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">
   2: <html>
   3: <title>test - menubar</title>
   4: <body>
   5: <div id="sidebar">
   6: <h1 class="black">Menu</h1>
   7: <ul class="nav-bar1">
   8: <li class="no-disc"><a href="/netsteder/nyheder.html">Nyheder</a></li>
   9: <li class="no-disc"><a href="/netsteder/raad.html">R&aring;d</a></li>
  10: <ol class="nav-bar2">
  11: <li><a href="/netsteder/netformidling/">Netformidling</a></li>
  12: <li><a href="/netsteder/indhold/">Netindhold</a></li>
  13: </ol>
  14: <li class="no-disc"><a href="/netsteder/ret.html">
  15: Retningslinier</a></li> 
  16: </ul>
  17: </div>
  18: </body>
  19: </html>

I hope you'll be able to help.
Regards

Kommunikationskonsulent 
Peter Gylden Houmann
pgh@si.dk

Statens Information
Nørre Farimagsgade 65
Postboks 1103
1009  København K

33 37 92 00 
33 37 92 53 (direkte)
33 37 92 99 (fax)

http://www.si.dk
Received on Monday, 8 May 2000 11:55:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:53 GMT