W3C home > Mailing lists > Public > www-html@w3.org > September 2004

Name-value lists

From: Asbjørn Ulsberg <asbjorn@tigerstaden.no>
Date: Sat, 11 Sep 2004 22:47:03 +0000
To: "HTML List" <www-html@w3.org>
Message-ID: <opsd6o11zvuvpchu@quark>




In HTML 4.01, the <dl> element can mark up both strict definition lists  
and something more like «name, value» collections[1]. The meaning of the  
word «definition list», however, does not imho open for loose  
interpretations of the element, which seems to be how XHTML 2.0 has  
implemented it.

The XHTML 2.0 implementation of <dl> does leave a void, though. We no  
longer have a name-value type of list. I therefore wonder how the idea of  
such a list is read. In structure, it would probably be identical to <dl>,  
but in semantics and presentation, it would differ. Where definition lists  
often are presented like this:

   Dweeb
     young excitable person who may mature into a Nerd or Geek

   Hacker
     a clever programmer

   Nerd
     technically bright but socially inept person

Name-value lists would imho make most sense presented like this:

   Romeo:  You are like a shrine enclosing a holy relic, and I would be  
unforgivably
           uncouth to touch it with my unworthy hand except that I am ready  
to "kiss
           away" the damage I have done.

   Juliet: There's nothing wrong with your hand (I like it!), and  
handholding
           while we dance is quite legitimate; but you're being a little  
too bold in
           wanting to kiss me. If you're really a pilgrim, you should greet  
me only
           with your hand, as 'palmers' do.

   Romeo:  Hey, even holy pilgrims are human: they've got lips. Please let  
me kiss you.

   Juliet: Pilgrims use their lips for praying, not kissing.

The names and values could of course be anything. Definition lists are in  
a sense a more semantically specific version of name-value lists.

The markup could look like this:

   <nvl>
     <nvi>
       <name>Romeo</name>
       <value>
         You are like a shrine enclosing a holy relic, and I would be  
unforgivably
         uncouth to touch it with my unworthy hand except that I am ready  
to "kiss
         away" the damage I have done.
       </value>
     </nvi>
     <nvi>
       <name>Juliet</name>
       <value>
         There's nothing wrong with your hand (I like it!), and handholding  
while
         we dance is quite legitimate; but you're being a little too bold in
         wanting to kiss me. If you're really a pilgrim, you should greet  
me only
         with your hand, as 'palmers' do.
       </value>
     </nvi>
     <nvi>
       <name>Romeo</name>
       <value>
         Hey, even holy pilgrims are human: they've got lips. Please let me  
kiss you.
       </value>
     </nvi>
     <nvi>
       <name>Juliet</name>
       <value>Pilgrims use their lips for praying, not kissing.</value>
     </nvi>
   </nvl>

This is just one example, and probably not a good one. Other collections  
that could be marked up with a name-value list, is address information,  
electronic equipment specifications, etc.

Maybe, and just maybe, definition lists could use the same markup as  
name-value lists, but the meaning of the name-value list could be altered  
with an attribute.

____
[1] «Another application of DL, for example, is for marking up dialogues,  
with each
     DT naming a speaker, and each DD containing his or her words.»

     <url: http://www.w3.org/TR/html401/struct/lists.html#edef-DL>

-- 
Asbjørn Ulsberg    -=|=-     http://virtuelvis.com/quark/
«He's a loathsome offensive brute, yet I can't look away»
Received on Wednesday, 15 September 2004 17:00:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:00 GMT