Re: itemset/@copy

On Thu, 14 Mar 2019 16:19:36 +0100, Steven Pemberton  
<steven.pemberton@cwi.nl> wrote:

> https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_itemset_Element
>
> I don't think we illustrate well enough how @copy works (copying a whole  
> subtree). I propose we use a better example that shows a subtree being  
> copied. I'll think about a better example.
>
> (Also the description of the copy attribute is weak).
>
> Steven
>


Something like this?

   <model xmlns="http://www.w3.org/2002/xforms">
     <instance>
       <transaction xmlns="">
 <addressee/>
       </transaction>
     </instance>
     <instance id="contacts">
       <contacts xmlns="">
 <address>
   <name>John Smith</name>
   <street>11 Main Street</street>
   <city>London</city>
   <postcode>W1 1AA</postcode>
   <land>UK</land>
 </address>
 <address>
   <name>Jane Bond</name>
   <street>7 License Lane</street>
   <city>Killarney</city>
   <postcode></postcode>
   <land>Ireland</land>
 </address>
 <address>
   <name>Frederick Angel</name>
   <street>123 Marks Street</street>
   <city>New York</city>
   <postcode>123456</postcode>
   <land>USA</land>
 </address>
       </contacts>
     </instance>
   </model>

   <group xmlns="http://www.w3.org/2002/xforms">
     <select1 ref="addressee">
       <label>Choose address</label>
       <itemset ref="instance('contacts')/address"><label ref="name"/><copy  
ref="."/></itemset>
     </select1>
     <group ref="addressee/address">
       <output ref="street"/>
       <output ref="city"/>
       <output ref="postcode"/>
       <output ref="land"/>
     </group>
   </group>

Steven

Received on Monday, 18 March 2019 14:40:38 UTC