W3C home > Mailing lists > Public > www-forms@w3.org > July 2006

Re: Wildcard in the <value> element

From: Aaron Reed <aaronr@us.ibm.com>
Date: Fri, 21 Jul 2006 14:46:06 -0500
To: www-forms@w3.org
Message-ID: <e9rau1$rdk$1@sea.gmane.org>

Hi Alessandro,

Alessandro Triglia wrote:

> As for <itemset>, it is unclear to me how <value> can be used within an <itemset>, given that a <value> would provide a single value and not a nodeset.   The specification of the <itemset> element describes the use of the <copy> element but not the use of the <value> element.

Since xf:value allows for single node binding, you could use value with 
an itemset by making its value relevant to the nodeset.  For example:

If I had instance data:
<persons>
   <person>
     <name>Bob Smith</name>
     <ssn>123-45-6789</ssn>
   </person>
   <person>
     <name>Mary Smith</name>
     <ssn>987-65-4321</ssn>
   </person>
   <selectedPerson/>
</persons>

<xf:select ref="selectedPerson">
   <xf:itemset nodeset="persons/person">
     <xf:label ref="name"/>
     <xf:value ref="ssn"/>
   </xf:itemset>
</xf:select>

So this would effectively create two items:
<xf:item>
   <xf:label>Bob Smith</xf:label>
   <xf:value>123-45-6789</xf:value>
</xf:item>
<xf:item>
   <xf:label>Mary Smith</xf:label>
   <xf:value>987-65-4321</xf:value>
</xf:item>

> 
> So my question is, in what cases (if any) would a <value> element contain a child element?
> 

I can't think of an example of this off of the top of my head.

--Aaron
Received on Friday, 21 July 2006 20:11:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:05 GMT