W3C home > Mailing lists > Public > public-xformsusers@w3.org > April 2019

inserting into an empty list

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 03 Apr 2019 14:24:35 +0200
To: public-xformsusers@w3.org
Message-ID: <op.zzn7e9f9smjzpq@steven-xps>
What does this output? (Answer supplied in a following mail: but it caught  
me out!).

       <model>
	 <instance>
	    <data xmlns="">
	       <list/>
	    </data>
	 </instance>
	 <instance id="s">
	    <data xmlns="">
	       <v>1</v>
	       <v>2</v>
	       <v>3</v>
	       <v>4</v>
	       <v>5</v>
	    </data>
	 </instance>
	 <action ev:event="xforms-ready">
	    <insert ref="list/v" origin="instance('s')/v[1]"/>
	    <insert ref="list/v" origin="instance('s')/v[2]"/>
	    <insert ref="list/v" origin="instance('s')/v[3]"/>
	    <insert ref="list/v" origin="instance('s')/v[4]"/>
	    <insert ref="list/v" origin="instance('s')/v[5]"/>
	    <insert context="list" ref="v" origin="instance('s')/v[1]"/>
	    <insert context="list" ref="v" origin="instance('s')/v[2]"/>
	    <insert context="list" ref="v" origin="instance('s')/v[3]"/>
	    <insert context="list" ref="v" origin="instance('s')/v[4]"/>
	    <insert context="list" ref="v" origin="instance('s')/v[5]"/>
	 </action>
       </model>
       <group>
	 <repeat ref="v"     ><output value="."/></repeat>
	 <repeat ref="list/v"><output value="."/></repeat>
       </group>

Steven
Received on Wednesday, 3 April 2019 12:24:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 3 April 2019 12:25:00 UTC