Hello Steven, thanks a lot for your help.
First of all, I have realized that I sent a wrong test case. In the setvalue
'error' I sent you the following: '<xforms-setvalue
xf-ref="instance('salida')/datosTarea/numeroOrden" xf-value="aa"/>' instead
'<xforms-setvalue xf-ref="instance('salida')/datosTarea/numeroOrden"
xf-value=""/>. The original XForms source was as you thought, '<setvalue
ref="foo" value=""/>'. It seems that older version ignored that emtpy value and
cleared the value of the element in that case. We have corrected it (with
<setvalue ref="foo"/>) and now it doesn't fail.
The other problem related with 'bind', I also sent a bad test case. We have
discovered that it only fails when 'bind' elements are not at the end of model
part. So, if you put:
(..)
<xforms-submission id="enviar" xf-method="get" xf-mode="synchronous"
xf-ref="instance('salida')/datosTarea" xf-resource="fake">
<xforms-action ev-event="xforms-submit-error">
<xforms-setvalue
xf-ref="instance('salida')/datosTarea/numeroOrden"/>
</xforms-action>
</xforms-submission>
<xforms-bind id="bind_numeroOrden"
xf-ref="instance('salida')/datosTarea/numeroOrden" xf-required="true()"
xf-type="xsd:string"/>
</xforms-model>
(...)
It works ok, but if you put:
(...)
<xforms-bind id="bind_numeroOrden"
xf-ref="instance('salida')/datosTarea/numeroOrden" xf-required="true()"
xf-type="xsd:string"/>
<xforms-submission id="enviar" xf-method="get" xf-mode="synchronous"
xf-ref="instance('salida')/datosTarea" xf-resource="fake">
<xforms-action ev-event="xforms-submit-error">
<xforms-setvalue
xf-ref="instance('salida')/datosTarea/numeroOrden"/>
</xforms-action>
</xforms-submission>
</xforms-model>
(...)
It fails. Is there any rule about the order of the model elements? In older
version we mixed them and there wasn't any error.
We have also found another problem, regarding select1 and itemset, recovering
the values from other instance (I send a testcase about this problem). If I put:
<xforms-itemset xf-ref="instance('inst_tarea')/vct">
<xforms-label xf-ref="elm[1]"/>
<xforms-value xf-ref="elm[2]"/>
</xforms-itemset>
Label is shown but value it is not processed and a 'undefined' value appears if
I choose some element. If I change the order of the elements:
<xforms-itemset xf-ref="instance('inst_tarea')/vct">
<xforms-value xf-ref="elm[2]"/>
<xforms-label xf-ref="elm[1]"/>
</xforms-itemset>
There is no label shown, but the value is selected correctly. We have tried to
change it in another way, but we had no luck.
Thank you,
Javier
El 10/6/21 a las 10:29, Steven Pemberton escribió:
On Thu, 10 Jun 2021 01:19:45 +0200, Javier Diazestebaranz(UST, ES) via
Xsltforms-support
<[email protected]><mailto:[email protected]>
wrote:
Hello,
we are using a very ,very old Xsltforms implementation (r574, more than 8 years
ago) with some local changes, and we want to migrate to last stable version.
Before starting the migration, I have been testing some of our xforms pages
with last version (downloaded from here:
https://github.com/AlainCouthures/declarative4all/blob/master/public/direct/xsltforms.zip
, I m not sure if it is a stable one), and I came across some problems.
I have made a small test case, to check if we have some error in our code,
there have been some syntax changes in xforms and we have to modify our code,
or there is some error in last xsltform version, I hope somebody can help us.
I send attached the code (submission.html). We use the .xml version (we don't
want to rewrite all our old code), but i think is easier to analyse the problem
with .html version.
* The first error that appears when the form load is:
XSLTForms Exception
--------------------------
Error parsing the following XPath expression :
Unexpected char at ''
It seems this line have some problem, because when I comment out it, the error
dissapears:
<xforms-setvalue xf-ref="instance('salida')/datosTarea/numeroOrden"
xf-value=""/>
So this is the generated code, not your original XForms source, so I'm guessing
here, but to set a value to the empty string, you use either
<setvalue ref="foo" value="''"/>
or equally good
<setvalue ref="foo"/>
This is not good:
<setvalue ref="foo" value=""/>
because @value has to be an expression.
Steven
<<attachment: Javier_DiazEstebaranz.vcf>>
_______________________________________________ Xsltforms-support mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xsltforms-support
