[Bug 3810] Doesn't correctly validate non "empty" elements that use shortcut

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3810





------- Comment #1 from ot@w3.org  2006-10-13 02:38 -------
Hi Brett,

(In reply to comment #0)
> When using XHTML, according to the specification (XHTML1 spec, section 4.3,
> http://www.w3.org/TR/xhtml1/#h-4.3) it is required that any element that has
> not got EMPTY declared in the DTD should always use the form <tag></tag>, but
> testing this, for example with a simple XHTML document containing <div />
> passes validation.

My interpretation of the specification is:

* 4.3 says end tags are necessary, unlike in HTML <= 4.01
However, according to XML rules, for elements without content, minimization
such as <foo /> is equivalent to having a start and end tag for the element.

* 4.6 says [[ Empty elements must either have an end tag or the start tag must
end with />. ]]

* The (informative) appendix C for the compatibility of XHTML 1.0 documents
served as text/html specifies that [[ 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 />). ]] That is,
however, beyond the realm of validation, and an informative guideline, as far
as I can tell. 


This aspect of the specification is confusing to me, I confess. Partly because
"empty elements" are not defined anywhere, and are sometimes meant as "elements
defined as EMPTY in the DTD", sometimes as the generally accepted definition of
an element without content.

Discussion threads I could find on the matter seem to dodge the question by
stating that non EMPTY (as in, not declared EMPTY in the DTD) should never be
empty (as in, no content), and that <div /> makes no sense. Still, my
interpretation of the spec is that <div /> is a valid and well-formed
construct, however not recommended for content served as text/html.

That's probably worth asking the HTML working group, responsible for the
edition (and exegesis) of the spec, for clarifications. I'll try to get their
attention on this bug report.

Thanks.

Received on Friday, 13 October 2006 02:38:56 UTC