Re: Evaluation context

On Wed, 21 Dec 2016 06:21:16 +0100, Erik Bruchez <ebruchez@orbeon.com>  
wrote:

>>>>> One other thing: I assume that it is right that context() returns  
>>>>> the in-scope context as specified in
>>> https://www.w3.org/community/xformsusers/wiki/XPath_Expressions_Module#The_context.28.29_Function
>>
>> Whereas position() and last() return the position and size of the  
>> element context.
>> https://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-position
>
> When there is a single-node binding, the context item always has a size  
> of 1 (or may be missing). This is a bit tricky. What does this do:
>
> <xf:repeat ref="1 to 10">
>  <xf:output value="position"/>
> </xf:repeat>
>
> vs.
>
> <xf:repeat ref="1 to 10">
>  <xf:group ref=".">
>    <xf:output value="position"/>
>  </group>
> </xf:repeat>

They both do the same thing, since a repeat object is a single item  
binding:

"a repeat object consisting of an implicitly generated group element that  
binds to the item, and containing a copy of the template."

I thought about this, and I can think of no place except for bind where a  
sequence binding is nested directly within a sequence binding.

Steven

Received on Wednesday, 21 December 2016 11:45:11 UTC