Re: Teaser with model and bind

Erik,

I tested your teaser (I changed bind/@ref to bind/@nodeset):

    * EMC Formula: "banana"
    * Mozilla extension: "Joe"
    * XSLTForms: nothing

According to XForms 1.1 recommendation,

    * Every XPath expression requires an evaluation context consisting
      of a node, position, size, variable bindings, function set, and
      namespace context.
    * if the binding element expresses a |model| attribute that refers
      to a |model| other than the one containing the context node, then
      the context node of the in-scope evaluation context 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.
    * [the output Element] cannot bind to element nodes that have
      element children.
    * If element child nodes are present, then an
      |xforms-binding-exception| occurs.

So, my point of view is that an exception should occur and I'm still 
proud of XSLTForms for not being completely wrong ;-)

It might be easier for developer if context could consist of a node for 
each model... then "Joe" would be displayed, don't you think?

BTW, is there a price to win? ;-)

-Alain
> All,
>
> Here is a little puzzle:
>
> http://gist.github.com/401939
>
> What should the output sow, "Joe", or "banana"?
>
> First, is it clear that it is allowed to refer by id to a bind that
> does not belong to the current model?
>
> If so, since by specifying @model="model1" we are not actually
> changing the model in the sense that there is no ancestor @model
> attribute changing the model, should @model="model1" ensure that the
> nested xforms:output point to a node in model1 rather than model2?
>
> -Erik
>
>
>   

Received on Saturday, 15 May 2010 06:02:31 UTC