Re: The xforms-rebuild Event

On Tue, 15 Nov 2016 11:26:49 +0100, Nick Van den Bleeken  
<Nick.Van.den.Bleeken@inventivegroup.com> wrote:

> Steven,
>
> Not sure about you proposed change. In fact the binds of the child binds  
> need to be processed as described in the three points of this list for  
> every item (including its position) in the selected sequence of items  
> for the current processed binding. And this needs of course to be done  
> recursively for every level of child bind elements.

I suppose I didn't explain my point properly, because I'm not proposing a  
change, just a better description. Point 2 already evaluates each item in  
the sequence, so it doesn't need to be done in point 3 as well. If I write  
it as a function, it might be more obvious:

Now:
xforms-rebuild(inscope, binds)
    for bind in binds:
        if bind has ref:
             seq= eval(inscope, ref);
        else: seq= inscope
        for v in seq:
             applymips(bind, v);
        if bind has bindchildren:
            for v in seq:
                process({v}, bindchildren}

Proposed:
xforms-rebuild(inscope, blist)
    for bind in binds:
        if bind has ref:
            seq= eval(inscope, b.ref);
        else: seq= inscope
        for v in seq:
             applymips(bind, v);
        if bind has bindchildren:
             process(seq, bindchildren}

Steven

>
> In the following example the bind nested bind needs to be evaluated for  
> all the items the outer bind returns by evaluating foo/bar :
> <xf:bind ref=”foo/bar” …>
>    <xf:bind ref=”baz” ..>
>
> Regards,
>
> Nick Van den Bleeken
> Product Evangelist
> Reach.
> www.scripturaengage.com <http://www.scripturaengage.com> •  
> www.inventivedesigners.com <http://www.inventivedesigners.com>
> Connect.
> +32 3 425 41 02 • (M) +32 499 51 85 02
> Engage.
> Facebook <http://www.facebook.com/inventivedesigners>  • Twitter  
> <http://www.twitter.com/scriptura> •  LinkedIn  
> <https://www.linkedin.com/company/13166?trk=tyah&trkInfo=idx%3A1-1-1%2CtarId%3A1424938899339%2Ctas%3Ainventive+designers>  
> •  Google+ <https://plus.google.com/+inventivedesigners> • YouTube  
> <https://www.youtube.com/user/InventiveDesigners> •  SlideShare  
> <http://www.slideshare.net/InventiveDesigners/>
>
>  <https://www.scripturaengage.com/event/V8-trainingweek-october2016>
>
>
> Scriptura Engage is an Inventive Designers solution. The following  
> disclaimer <https://www.inventivedesigners.com/about/legal> applies to  
> this message.
>
> On 14/11/2016, 14:41, "Steven Pemberton" <steven.pemberton@cwi.nl> wrote:
>
>     https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_xforms-rebuild_Event
>    When dealing with nested binds:
>     <bind ref="a" type="integer">
>       <bind readonly="true()"/>
>      </bind>
>    Point 3 says
>    "For each item in the selected sequence of items, any child bind  
> elements
>     are recursively processed as described in the three points of this  
> list."
>    Since a bind works on a sequence of items, I think this should really  
> say
>     (though it is probably equivalent)
>     "Any child bind elements are recursively processed as described in  
> the
>     three points of this list."
>    Steven

Received on Tuesday, 15 November 2016 11:56:04 UTC