W3C home > Mailing lists > Public > www-validator@w3.org > August 2005

Re: Possible issue with 4.01 strict validator?

From: Ian Stuart <Ian.Stuart@ed.ac.uk>
Date: Tue, 30 Aug 2005 14:11:55 +0100
Message-ID: <43145B1B.90009@ed.ac.uk>
To: www-validator@w3.org

Char-Lez Braden wrote:
> Hello,
> I am seeing some behavior I cannot explain that might be a problem with 
> the validator.
> This URL http://www.freecitizen.com/demo.html shows a very small HTML 
> document that the validator says is good, but looks I believe the HTML 
> is missing a </p> tag (Right above the </body> tag).   When I put the 
> <p> tag in (http://www.freecitizen.com/demo2.html) I get the message 
> "Error  Line 19 column 7: end tag for element "P" which is not open."
> When I look at the parse tree (demo.html) it appears to me that the 
> validator is inserting a </p> just before the <ul> tag.
What you are missing is that the <ul> element is a Block element, and 
the <p> element (also a Block element) cannot contain another block element.

The xhtml version of this would be:
     <p>yack yack yack</p>
     <p>blah blah blah</p>
     <p></p> <!-- could also do <p /> -->
         <li><a href='http://www.freecitizen.com/'>item 1</a></li>
         <li><a href='http://www.freecitizen.com/'>item 2</a></li>
(I've squished things to make the message smaller)

Because html 4.01 defines closing tags as optional for <p>, the opening 
<ul> implies the closing </p>, therefor putting the </p> after the </ul> 
closes a <p> that is, in fact, already closed.

Hope this helps.


Ian Stuart.
Bibliographics and Multimedia Service Delivery team,
The University of Edinburgh.

Received on Tuesday, 30 August 2005 13:21:30 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:30:49 UTC