The code
<xf:setvalue ref="instance('data')/error" value="substring-before(substring-after(event('response-body'),'s:Text xml:lang="ru-RU">'),'</s:Text')"/>
translates into
XPath.create("substring-before(substring-after(event('response-body'),'s:Text xml:lang="ru-RU">'),'</s:Text')",new FunctionCallExpr('http://www.w3.org/2005/xpath-functions substring-before',new FunctionCallExpr('http://www.w3.org/2005/xpath-functions substring-after',new FunctionCallExpr('http://www.w3.org/2002/xforms event',new CteExpr('response-body')),new CteExpr('s:Text xml:lang="ru-RU">')),new CteExpr('</s:Text')));
Note that "ru-RU" is not escaped. This causes
XSLTForms Exception -------------------------- Incorrect Javascript code generation
xf document