W3C home > Mailing lists > Public > public-xformsusers@w3.org > November 2016

in-scope evaluation context

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 02 Nov 2016 10:12:44 +0100
To: "public-xformsusers@w3.org" <public-xformsusers@w3.org>
Message-ID: <op.yqamjifosmjzpq@steven-aspire-s7>
One last issue before I send out the agenda.

I spent all of yesterday struggling with the in-scope evaluation context.

A quick summary.

First you find an initial context, that gets used to find the actual  
in-scope evaluation context.

If a binding doesn't have an ancestor binding, then the initial context is  
top-level document element node of the default instance of the model that
contains the binding, if any, and otherwise of the default model.

     <input ref="i"/>

If there is an ancestor single-item binding then the initial context size  
position are 1 and the context item is the one resulting from the Single
Item Binding.

     <select ref="order" label="Flavors">
       <itemset ref="../flavors/flavor" label"{description}"  

If there is an ancestor Sequence Binding then the context position is 1,  
and the context size is the size of the sequence and the context item is  
the sequence's first item.

Furthermore an occurrence of the original binding element is generated for  
each of the items in the sequence, with a dynamic in-scope evaluation  
context which has a context size equal to the size of the sequence, the  
context item is the item of the sequence for which the occurrence was  
generated and the position is equal to the position of the generated item  
in the sequence.

     <repeat ref="flavors/flavor"><output ref="description"/></repeat>

Now here comes the funny bit:

Once the initial context has been found, if the binding element has a  
model attribute that refers to a model other than the one containing the  
context item, then the context item is changed to be the top-level  
document element node of the default instance of the referenced model, and  
the context position and size are changed to 1.

     <select ref="order" label="Flavors">
       <itemset model="flavors" ref="flavor" label"{description}"  

(and after that @context gets evaluated)

What I don't understand is why the @model treatment happens so late. It  
seems to me that it ought to happen before any of the other stuff. Can  
anyone enlighten me?

Received on Wednesday, 2 November 2016 09:13:25 UTC

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