Re: Evaluation context

>
> 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).

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).

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.


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

I would say that too.

(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_Expressi
> ons_Module#The_context.28.29_Functio
> <https://www.w3.org/community/xformsusers/wiki/XPath_Expressions_Module#The_context.28.29_Function>


Yes.

-Erik


> Steven
>
>

Received on Wednesday, 21 December 2016 05:19:12 UTC