In xsltforms r403 and earlier versions, setvalue inside the
xforms-submit-done handler of a submission caused by
ev:event="xforms-value-changed" fails to get values of the
submission/@instance target instance data. Instead, it gets data prior
to the replace="instance".
However, when this same submission is triggered by a <submit> control,
it works fine.
<submission id="update-requestor" method="get" resource="lookup.xml"
ref="instance('main')/requestor" replace="instance" instance="names" >
<message ev:event="xforms-submit-error" level="modal">OOPS</message>
This effect is most obvious if the result of the submission resource
varies with the input, becuase you can see it's the previous set of values.
In the example posted at
http://xformstest.org/klotz/2010/05/submit/test.xml the lookup.xml is a
static file, so it returns static data, and so the effect is that the
first time, you get nothing, and the second time, you see the setvalue
results from the previous time.