Open HeikoTheissen opened 2 months ago
Yes, this is an issue in dispatch action processing: the current context is ignored and the default context is used instead.
Please check replacing with: .bind_evaluate(this.subform, ctx, this.element)
The corresponding fix will be committed as soon as possible.
See https://stackoverflow.com/questions/78860549
The XPath expression
name(context())
appears twice in the following example, and XSLTForms evaluates both occurrences differently when the trigger is pressed:xf:dispatch/xf:name/@value
, the context is thedata
element at the top of the model instance. (Thexf:message
handler is executed, displaying "data".)xf:setvalue/@value
, the context is thebutton
element to which thexf:trigger
is bound. (The button label changes to "button".)I would have expected that the context is the same (the "in-scope evaluation context") in both cases.
(The stylesheet is loaded from http://www.agencexml.com/xsltforms/xsltforms/xsltforms.xsl.)
Reason seems to be that the in-scope evaluation context
ctx
is not passed as a second argument tobind_evaluate
whenxf:dispatch/xf:name/@value
is evaluated: https://github.com/AlainCouthures/xsltforms/blob/6e8fa26939252fd7b1bff777bbee28fa6b0d1476/src/js/actions/XFDispatch.js.xml#L50