The context() function, at least when used on setvalue, returns the
context node of the setvalue instead of the context of the parent node.
Here's the example from the XForms 1.1 Recommendation:
<setvalue ref="x" value="context()/y"/>
This action sets node |x| to the value of node |y|, where both nodes
are children of the in-scope evaluation context node for the
Here's an test case that shows that the value of context() in this case
would be the "x" node, which is incorrect.
Note that we are considering a context(id) function for XForms 1.2,
where the id would specify the id of an element in current scope, so a
fix that makes implementing context(id) easier would be valuable to
XSLTForms as well.