Repeat item context

6.1 Evaluation Context

All expressions are evaluated in an evaluation context, which consists of  
a context item, a size, and a position. In general, the context item is  
some element of a sequence, the size is the size of that sequence, and the  
position is the position of the context item within the sequence.

https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Evaluation_Context

For each item in the repeat collection, a repeat item is defined,  
consisting of
* the item,
* its position in the repeat collection called the repeat position, and
* a repeat object consisting of an implicitly generated group element that  
binds to the item, and containing a copy of the template. ***Unlike an  
explicit group, the binding to the item does not reset the size and  
position of its context.***

(My emphasis)
https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Repeat_Processing

Now with this:

  <instance>
     <data xmlns="">
        <item>one</item><item>two</item><item>three</item>
     </data>
  </instance>

  <repeat ref="item">
     <output ref="."/>,
     <output value="last()"/>,
     <output value="position()"/>
  </repeat>

Question one:

Should it output

  one, 1, 1
  two, 1, 2
  three, 1, 3

or

  one, 3, 1
  two, 3, 2
  three, 3, 3
?

Question two: What is the difference between the 'repeat position', and  
the position of the repeat item context?

I won't say what I think, to see if you agree with me.

Steven

Received on Tuesday, 23 January 2018 14:02:57 UTC