W3C home > Mailing lists > Public > www-html@w3.org > November 2003

Re: XHTML2 dt/dd Nesting

From: Ernest Cline <ernestcline@mindspring.com>
Date: Sun, 2 Nov 2003 02:22:40 -0500
Message-ID: <410-22003110272240296@mindspring.com>
To: "W3C HTML List" <www-html@w3.org>

> From: Lachlan Hunt <lhunt07@postoffice.csu.edu.au>

> Yes, a search of the archives reveals several threads on this topic; 
> many with a similar ideas, using various other tags instead of <df>, 
> such as <definition>, <di> and even <li>.
> Others have suggested nesting <dd> within <dt> like the following, both 
> with and without the <label> element, or similar.  The following example 
> was created by combining several suggestions from previous threads, and 
> does not cover every alternative.
> <dl>
>     <dt><label>Hello</label>
>         <dd xml:lang="en">A common greeting</dd>
>         <dd xml:lang="fr">Bonjour</dd>
>     </dt>
> </dl>
>   Just like most people who've discussed this (from what I've read), I 
> do agree that something needs to be done to improve the structure of a 
> dl.  Though, as to which method to use, I prefer the structure in the 
> example above, though each one has pros and cons that would need to be 
> very seriously considered before a final decision was made.

Well, limiting myself to just the alternatives given above, let me discuss
what I see as the pros and cons.

<li>
There are no pros here, only cons.  In order use <li> as an element for
grouping definition lists, one would need to have a different content model
for <li> depending upon whether it was inside a <dl> or one of the other
lists.

<definition> and <df>
Both of these have the advantage over <li> of being a grouping element
used only inside the <dl> element where a different content model applies
than in the other lists.  However both names have problems.  The first is
that both are likely to suffer from some confusion with the <def> element.
The second is that  despite the commonly associated name for <dl>
of "definition list" The <dl> element is used for non-definition lists.

Example of a non-definition list <dl>:
<dl>
  <dt>Dr. A</dt>
  <dd><dl>
    <dt>Office</dt>
    <dd>123</dd>
    <dt>Phone</dt>
    <dd>555-1234</dd>
  </dl></dd>
  <dt>Dr. B</dt>
  <dd><dl>
    <dt>Office</dt>
    <dd>321</dd>
    <dt>Phone</dt>
    <dd>555-4321</dd>
  </dl></dd>
  <dt>Grad Student D</dt>
  <dt>Grad Student E</dt>
  <dt>Grad Student F</dt>
  <dt>Grad Student G</dt>
  <dd><dl>
    <dt>Office</dt>
    <dd>444</dd>
    <dt>Phone</dt>
    <dd>555-5555</dd>
  </dl></dd>
</dl>

Actually given the actual usage of the <dl> element today, perhaps
a more descriptive name would be "definition or directory list"
since both dictionaries and directories have a indexing term <dt>
which is associated with data related to the term <dd>.  The above
is a bit of a mouthful, so I'll make use of the terms d-list, d-term, and
 d-data to refer to the current <dl>, <dt> and <dd> respectively for
the rest of this post.

<di>
I'll admit to a certain bias in favor of this form as I proposed it.
It has none of the drawbacks mentioned above and the merit
of suggesting  that it has something to do with a d-list form its
form, altho <ddiv>, <dsection>, <dgroup> and a variety of other
names would do as well in that regard.  My preference for <di>
came from the fact that it is short and that also parallels the
name <li>.  However, that parallel could also be seen as a drawback
as in CSS terms, a <di> is most certainly not a list-item.

<The proposal given by Lachlan above>
There are two problems with the proposal, either of which
would be enough in my opinion to make it undesirable.

First there is the fact that placing the <dd> inside the <dt> element
calls for a radical change in the content model from existing
practice for existing elements.  That is a not a good thing in my
opinion.  The second is that it assumes there is but a single d-term
that is associated with one or more blocks of d-data.  That is not
the current model and indeed is the inverse of what HTML 2.0
originally called for, namely that each block of d-data would be
associated with one or more d-terms.
Received on Sunday, 2 November 2003 02:22:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:09 UTC