Hi again, forget my previous email, I have read in a previous Alain's email in this list the following : "HTML5 also considers that custom elements cannot be written with the auto-close notation." and I have realized that the problem is that instead putting: <xforms-label xf-ref="elm[1]"/> it should be '<xforms-label xf-ref="elm[1]"></xforms-label>'
We generate the html pages executing xslt in server side, using xsltforms.xsl
and then sending html to server, so the problem was in that transformation.
I have solved the problem doing the following change in xsltforms.xsl
@@ -363,7 +363,12 @@
</xsl:when>
</xsl:choose>
</xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="node()">
<xsl:apply-templates select="node()"/>
+ </xsl:when>
+ <xsl:otherwise> </xsl:otherwise>
+ </xsl:choose>
</xsl:element>
</xsl:when>
<xsl:when
test="contains('.setvalue.insert.delete.update.dispatch.property.targetid.name.action.load.toggle.send.setfocus.wrap.setselection.setindex.setnode.reset.retain.return.renew.refresh.rebuild.recalculate.revalidate.unload.hint.alert.help.value.item.itemset.copy.choices.filename.show.hide.method.resource.header.mediatype.message.control.',
concat('.', local-name(), '.'))">
@@ -404,7 +409,12 @@
</xsl:when>
</xsl:choose>
</xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="node()">
<xsl:apply-templates select="node()"/>
+ </xsl:when>
+ <xsl:otherwise> </xsl:otherwise>
+ </xsl:choose>
</xsl:element>
</xsl:when>
<xsl:otherwise>
So I force to insert at least a blank space to guarantee that there isn't any
auto-close notation and all the previously mentioned problems have been solved!.
Best Regards,
Javier
El 10/6/21 a las 19:21, Javier Diazestebaranz(UST, ES) via Xsltforms-support
escribió:
EXTERNAL EMAIL - Do not click any links or open any attachments unless you
trust the sender and know the content is safe.
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
_______________________________________________
Xsltforms-support mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/xsltforms-support
<<attachment: Javier_DiazEstebaranz.vcf>>
_______________________________________________ Xsltforms-support mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xsltforms-support
