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

Re: Peculiar validation results for certain XHTML 1.1 documents

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Fri, 7 Jan 2005 13:14:59 +0200 (EET)
To: www-validator@w3.org
Message-ID: <Pine.GSO.4.58.0501071302470.12978@korppi.cs.tut.fi>

On Fri, 7 Jan 2005, David Dorward wrote:

> > > 0. Is <li /> correct XHTML 1.1 (and correct XHTML 1.0 Strict)?
>
> > Yes, but not recommended, since you should use the notation only for
> > elements with EMPTY declared content.
>
> The XHTML 1.0 spec (section 4.3) says:

The whole section 4 is explicitly described as informative,
i.e. non-normative. It is also erroneous, since for example
well-formedness requirement is _not_ different from HTML rules
(though it differs from browser practice, but this applies to many other
features as well, and the section starts with the statement "Due to the
fact that XHTML is an XML application, certain practices that were
perfectly legal in SGML-based HTML 4 [HTML4] must be changed").

>   All elements other than those declared in the DTD as EMPTY must have
>   an end tag. Elements that are declared in the DTD as EMPTY can have an
>   end tag or can use empty element shorthand (see Empty Elements).

It's just poor prose. And misleading, since it is _not_ advisable
to use <br></br> for example.

XHTML 1.0 is normatively defined as an application of XML, and there is no
normative statement that forbids <li />. Au contraire, the (in)famous
appendix C explicitly says:

"Given an empty instance of an element whose content model is not EMPTY
(for example, an empty title or paragraph) do not use the minimized form
(e.g. use <p> </p> and not <p />)."
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#C_3

Since this is in an _informative_ appendix, which is explicitly described
as specifying compatibility guidelines, it implies that <p /> or
<li /> _is_ valid and correct, though not recommended. The reasonable
meaning for "correct" is 'one that does not violate a normative statement
in a specification'. It would be completely pointless to give such a
recommendation in appendix C if <p /> or <li /> (or <p/> or <li/> for that
matter) were already prohibited by normative statements.

> I can't find anything to contrict this in the XHTML 1.1 spec.

The situation is the same as in XHTML 1.0.

> So doesn't this mean that <li /> is incorrect (although valid) XHTML 1.1?

No, it is valid and correct, but not recommended. A complying browser is
required to process it as equivalent to <li></li>.

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Friday, 7 January 2005 11:15:32 GMT

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