Re: Evaluation context

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

>> AVTs: do we agree? (The spec examples are inconsistent, so we have to  
>> decide). Which of these two is right?
>>
>>        <output ref="total" class="{if (total ge 0) then 'positive' else  
>> 'negative'}" />
>>        <output ref="total" class="{if (. ge 0) then 'positive' else  
>> 'negative'}" />
>
> We do the latter: relative to @ref (or @bind: that is relative to the  
> binding when present).
I agree that this is the best interpretation.

> Another way to look at it is that attributes which evaluate XPath  
> expressions work like expressions on nested elements (except @origin as  
> you >pointed out).

Exactly.

>
>> How about with:
>>        <itemset model="flavors" ref="flavor" label="{description}"  
>> copy="description"/>
>> (which is using (dynamic) element context).
>
> So same here, `description` is relative to `flavor`.
>
>> select/itemset/@copy: Element or in-scope?
>
> "element"
>
>> setindex/@index: Element or in-scope?
>
> There is no @ref/@bind on `setindex`, but there could be a @model or  
> @context. So relative to that.
Indeed.

>
>> insert/@at, delete/@at: I'm pretty sure that this means the element  
>> context.
>
> I would say that too.

Good.

Steven

>
>> (I have my own feelings about these, but I don't want to prejudice your  
>> thinking).
>>
>> 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_Functio
>
> Yes.
>
> -Erik
>> Steven

Received on Wednesday, 21 December 2016 11:47:40 UTC