W3C home > Mailing lists > Public > www-validator@w3.org > January 2010

Re: Missing closing li tag, "document was successfully checked as HTML 4.01 Transitional!"

From: Dag-Erling Smørgrav <des@des.no>
Date: Tue, 26 Jan 2010 14:39:50 +0100
To: Axel Christiansen <axel.christiansen@piranha.de>
Cc: www-validator@w3.org
Message-ID: <86pr4xj87t.fsf@ds4.des.no>
Axel Christiansen <axel.christiansen@piranha.de> writes:
> This doc snippet has validated all right, even with a missing "closing
> li tag".
>
> Should it be that way?

In HTML 4.01, yes - the closing tag is optional since the end of the
element can be deduced by the appearance of another <LI> or of </UL>.

If you look at the HTML DTD, you'll find this:

<!ELEMENT UL - - (LI)+                 -- unordered list -->
<!ELEMENT LI - O (%flow;)*             -- list item -->

the dash-dash after UL means that neither the start tag nor the end tag
are optional, while the dash-O after LI means that the end tag is
optional.

(remember, this is SGML, not XML - in XML, tags are never optional)

DES
-- 
Dag-Erling Smørgrav - des@des.no
Received on Tuesday, 26 January 2010 13:40:24 GMT

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