W3C home > Mailing lists > Public > public-xformsusers@w3.org > March 2019

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

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Wed, 6 Mar 2019 07:08:14 -0800
Message-ID: <CAAc0PEUuhPq+39Yd1evY1=ynSQam1cL0zD9H=Z91+u+k26pS7Q@mail.gmail.com>
To: Steven Pemberton <steven.pemberton@cwi.nl>
Cc: XForms <public-xformsusers@w3.org>
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.


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

> 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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:51 UTC