W3C home > Mailing lists > Public > public-html-comments@w3.org > April 2011

dl elements and non-dt, non-dd content

From: T.J. Crowder <tj@crowdersoftware.com>
Date: Fri, 8 Apr 2011 11:47:21 +0100
Message-ID: <BANLkTim7Ossb31xQ3fg7CMOXruAG7HG1Gw@mail.gmail.com>
To: public-html-comments <public-html-comments@w3.org>
To my non-spec-reading eyes, the current spec disallows any content other
than dt and dd elements within dl elements (although there's some slight
ambiguity; more below, that's not my main point/question).

In some documents, one needs to label each term definition with a reference
number or similar (I've seen this in specifications on large software
projects, for instance). The number isn't a term, so it doesn't make sense
to make it a dt, but it's not a definition either, so it's not a dd.

Is there a valid way to do that per current spec? It seems kludgy to put
each definition in its own dl purely in order to label it, although of
course that does allow the label to apply to the dt+dd pair as a pair.

If there isn't, should there be? Or is the idea that different dl elements
is an appropriate choice in that situation?

About the slight ambiguity I mentioned above. The header for dl says:

Content model:
> Zero or more groups each consisting of one or more dt elements followed by
> one or more dd elements.

Quite clear, but then the text below says:

If a dl element contains non-whitespace text nodes, or elements other than
> dt and dd, then those elements or text nodes do not form part of any
> groups in that dl.

...which softens that a bit. The validator seems to agree with the former,
disallowing (say) a p or span. Is the latter simply giving an indication of
how invalid content should be treated?

T.J. Crowder
Received on Friday, 8 April 2011 13:39:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:27 UTC