Re: Evaluation context of @if @while and @iterate

In our implementation, we evaluate `if` and `while` in the "Element
evaluation context" as per the current spec.

I am not sure if that's good or bad but we have to pick.

`iterate` also comes into the mix:

    "Iterate changes the evaluation context for if and while attributes,
and is evaluated before either of the two."

Speaking of which, I see a contradiction in "14.3.3 The iterate attribute":

- "It [iterate] contains an expression that is evaluated once using the
element evaluation context"
- "Since the iterate expression is evaluated once using the in-scope
evaluation context"

In general, this is confusing and the best practice should probably be to
avoid combining `ref`, `if`/`while`, and/or `iterate` on a same element.
It's just pretty much impossible to know the order in which things happen.
Looking at the example provided, for example:

    <delete ref="." at="1" iterate="node[@selected='true']"/>

I have no idea what it does without looking up the spec or trying it.

-Erik

On Wed, Feb 27, 2019 at 8:02 AM Steven Pemberton <steven.pemberton@cwi.nl>
wrote:

> The text says to use the in-scope context, but the examples use the
> element context.
>
>
> https://www.w3.org/community/xformsusers/wiki/XForms_2.0#Conditional_and_Iterated_Execution_of_Actions
>
> I will change this to say the element evaluation context.
>
> Steven
>
>

Received on Wednesday, 6 March 2019 15:08:49 UTC