Hi again to all,

I have manage to migrate to last xsltforms version. To solve this problems with 
XSLT engine, finally I have found a cleaner solution, including a comment 
entity, because including a non-breakable space had some side effects.

I send my changes in xsltforms.xsl, it may be useful for somebody with the same 
problem:

@@ -261,6 +261,7 @@
                                        </xsl:choose>
                                </xsl:for-each>
                                <xsl:apply-templates select="node()"/>
+                               <xsl:comment>_</xsl:comment>
                        </xsl:element>
                </xsl:when>
                <xsl:when test="self::xforms:instance">
@@ -364,9 +365,10 @@
                                        </xsl:choose>
                                </xsl:for-each>
                                <xsl:apply-templates select="node()"/>
+                               <xsl:comment>_</xsl:comment>
                        </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(), '.'))">
+               <xsl:when 
test="contains('.setvalue.insert.delete.update.dispatch.delay.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(), '.'))">
                        <xsl:element name="{$elt_name}" 
namespace="{$elt_nsuri}">
                                <xsl:if test="$custom_name != $elt_name">
                                        <xsl:attribute 
name="xforms-name"><xsl:value-of select="local-name()"/></xsl:attribute>
@@ -405,6 +407,7 @@
                                        </xsl:choose>
                                </xsl:for-each>
                                <xsl:apply-templates select="node()"/>
+                               <xsl:comment>_</xsl:comment>
                        </xsl:element>
                </xsl:when>
                <xsl:otherwise>

Note: It is also included the correction to the 'delay' problem that I sent 
some days ago to the mailing list.

Best Regards,
Javier

El 14/6/21 a las 8:59, 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.

Hi Alain,

in my case we are using xalan (http://xalan.apache.org/), it's a java project. 
If I have spare time, I will try to check it with saxon.

Best regards,
Javier

El 13/6/21 a las 17:55, Alain Couthures escribió:

EXTERNAL EMAIL - Do not click any links or open any attachments unless you 
trust the sender and know the content is safe.

Hi Javier,

Thank you for fixing this issue with the XSLT transformation when performed at 
server side.

I would like to know which XSLT engine you are using because browsers are not 
impacted (valid HTML serialization).

Extra non-breakable spaces can be avoided for browsers but, maybe, also with 
other XSLT engines...

Kind regards

--Alain
Le 11/06/2021 02:38, Javier Diazestebaranz(UST, ES) via Xsltforms-support 
<[email protected]><mailto:[email protected]>
 a écrit :


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>&#160;</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>&#160;</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


_______________________________________________ Xsltforms-support mailing list 
[email protected]<mailto:[email protected]>
 https://lists.sourceforge.net/lists/listinfo/xsltforms-support





_______________________________________________
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
  • [Xsltforms-support] E... Javier Diazestebaranz(UST, ES) via Xsltforms-support
    • Re: [Xsltforms-s... Steven Pemberton
      • Re: [Xsltfor... Javier Diazestebaranz(UST, ES) via Xsltforms-support
        • Re: [Xsl... Javier Diazestebaranz(UST, ES) via Xsltforms-support
          • Re: ... Alain Couthures
            • ... Javier Diazestebaranz(UST, ES) via Xsltforms-support
              • ... Javier Diazestebaranz(UST, ES) via Xsltforms-support
                • ... Alain Couthures
                • ... Javier Diazestebaranz(UST, ES) via Xsltforms-support
                • ... Alain Couthures
                • ... Javier Diazestebaranz(UST, ES) via Xsltforms-support

Reply via email to