Re: [Xsltforms-support] Errors in last version of xsltforms
Brought to you by:
alain-couthures
From: Alain C. <ala...@ag...> - 2021-06-23 19:06:47
|
<!doctype html> <html> <head> <meta charset="UTF-8"> </head> <body> <div> Hi Javier, </div> <div class="default-style"> <br> </div> <div class="default-style"> Before committing a new build, I will first try to write a fix based on @disable-output-escaping specifically for xalan-j to preserve the current transformation which has been successfully tested with browsers XSLT engines. </div> <div class="default-style"> <br> </div> <div class="default-style"> Have you also tried with another server-side engine? </div> <div class="default-style"> <br> </div> <div class="default-style"> Thanks! </div> <div class="default-style"> <br> </div> <div class="default-style"> --Alain </div> <blockquote type="cite"> <div> Le 23/06/2021 13:48, Javier Diazestebaranz(UST,ES) <jav...@us...> a écrit : </div> <div> <br> </div> <div> <br> </div>Hi again to all, <br> <br>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. <br> <br>I send my changes in xsltforms.xsl, it may be useful for somebody with the same problem: <br> <br><span style="font-family: monospace;">@@ -261,6 +261,7 @@<br> </xsl:choose><br> </xsl:for-each><br> <xsl:apply-templates select="node()"/><br>+ <xsl:comment>_</xsl:comment><br> </xsl:element><br> </xsl:when><br> <xsl:when test="self::xforms:instance"><br>@@ -364,9 +365,10 @@<br> </xsl:choose><br> </xsl:for-each><br> <xsl:apply-templates select="node()"/><br>+ <xsl:comment>_</xsl:comment><br> </xsl:element><br> </xsl:when><br>- <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(), '.'))"><br>+ <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(), '.'))"><br> <xsl:element name="{$elt_name}" namespace="{$elt_nsuri}"><br> <xsl:if test="$custom_name != $elt_name"><br> <xsl:attribute name="xforms-name"><xsl:value-of select="local-name()"/></xsl:attribute><br>@@ -405,6 +407,7 @@<br> </xsl:choose><br> </xsl:for-each><br> <xsl:apply-templates select="node()"/><br>+ <xsl:comment>_</xsl:comment><br> </xsl:element><br> </xsl:when><br> <xsl:otherwise></span> <br> <br>Note: It is also included the correction to the 'delay' problem that I sent some days ago to the mailing list. <br> <br>Best Regards, <br>Javier <br> <br> <div class="moz-cite-prefix"> El 14/6/21 a las 8:59, Javier Diazestebaranz(UST, ES) via Xsltforms-support escribió: <br> </div> <blockquote type="cite"> <p><br></p> <p style="margin: 0cm 0cm 8pt;"><strong><span style="background: silver; color: #e65e0a; line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt; mso-highlight: silver;">EXTERNAL EMAIL</span></strong><span style="background: #f1ebe5; line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt; mso-highlight: silver;"> - <span style="color: black;">Do not click any links or open any attachments unless you trust the sender and know the content is safe</span></span><span style="line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt;">.</span></p> <p><br></p>Hi Alain, <br> <br>in my case we are using xalan (<a href="http://xalan.apache.org/" class="moz-txt-link-freetext">http://xalan.apache.org/</a>), it's a java project. If I have spare time, I will try to check it with saxon. <br> <br>Best regards, <br>Javier <br> <br> <div class="moz-cite-prefix"> El 13/6/21 a las 17:55, Alain Couthures escribió: <br> </div> <blockquote type="cite"> <p style="margin: 0cm 0cm 8pt;"><strong><span style="background: silver; color: #e65e0a; line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt; mso-highlight: silver;">EXTERNAL EMAIL</span></strong><span style="background: #f1ebe5; line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt; mso-highlight: silver;"> - <span style="color: black;">Do not click any links or open any attachments unless you trust the sender and know the content is safe</span></span><span style="line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt;">.</span></p> <div> Hi Javier, </div> <div class="default-style"> <br> </div> <div class="default-style"> Thank you for fixing this issue with the XSLT transformation when performed at server side. </div> <div class="default-style"> <br> </div> <div class="default-style"> I would like to know which XSLT engine you are using because browsers are not impacted (valid HTML serialization). </div> <div class="default-style"> <br> </div> <div class="default-style"> Extra non-breakable spaces can be avoided for browsers but, maybe, also with other XSLT engines... </div> <div class="default-style"> <br> </div> <div class="default-style"> Kind regards </div> <div class="default-style"> <br> </div> <div class="default-style"> --Alain </div> <blockquote type="cite"> <div> Le 11/06/2021 02:38, Javier Diazestebaranz(UST, ES) via Xsltforms-support <a href="mailto:xsl...@li..." class="moz-txt-link-rfc2396E"> <xsl...@li...></a> a écrit : </div> <div> <br> </div> <div> <br> </div>Hi again, <br> <br>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>' <br> <br>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. <br> <br>I have solved the problem doing the following change in xsltforms.xsl <br> <br><span style="font-family: monospace;">@@ -363,7 +363,12 @@<br> </xsl:when><br> </xsl:choose><br> </xsl:for-each><br>+ <xsl:choose><br>+ <xsl:when test="node()"><br> <xsl:apply-templates select="node()"/><br>+ </xsl:when><br>+ <xsl:otherwise>&#160;</xsl:otherwise><br>+ </xsl:choose><br> </xsl:element><br> </xsl:when><br> <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(), '.'))"><br>@@ -404,7 +409,12 @@<br> </xsl:when><br> </xsl:choose><br> </xsl:for-each><br>+ <xsl:choose><br>+ <xsl:when test="node()"><br> <xsl:apply-templates select="node()"/><br>+ </xsl:when><br>+ <xsl:otherwise>&#160;</xsl:otherwise><br>+ </xsl:choose><br> </xsl:element><br> </xsl:when><br> <xsl:otherwise></span> <br> <br>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!. <br> <br>Best Regards, <br>Javier <br> <br> <div class="moz-cite-prefix"> El 10/6/21 a las 19:21, Javier Diazestebaranz(UST, ES) via Xsltforms-support escribió: <br> </div> <blockquote type="cite"> <p><br></p> <p style="margin: 0cm 0cm 8pt;"><strong><span style="background: silver; color: #e65e0a; line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt; mso-highlight: silver;">EXTERNAL EMAIL</span></strong><span style="background: #f1ebe5; line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt; mso-highlight: silver;"> - <span style="color: black;">Do not click any links or open any attachments unless you trust the sender and know the content is safe</span></span><span style="line-height: 107%; font-family: 'Arial',sans-serif; font-size: 10pt;">.</span></p> <p><br></p>Hello Steven, <br> <br>thanks a lot for your help. <br> <br>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. <br> <br>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: <br> <br>(..) <br> <xforms-submission id="enviar" xf-method="get" xf-mode="synchronous" xf-ref="instance('salida')/datosTarea" xf-resource="fake"> <br> <xforms-action ev-event="xforms-submit-error"> <br> <xforms-setvalue xf-ref="instance('salida')/datosTarea/numeroOrden"/> <br> </xforms-action> <br> </xforms-submission> <br> <xforms-bind id="bind_numeroOrden" xf-ref="instance('salida')/datosTarea/numeroOrden" xf-required="true()" xf-type="xsd:string"/> <br> </xforms-model> <br>(...) <br> <br>It works ok, but if you put: <br> <br>(...) <br> <xforms-bind id="bind_numeroOrden" xf-ref="instance('salida')/datosTarea/numeroOrden" xf-required="true()" xf-type="xsd:string"/> <br> <xforms-submission id="enviar" xf-method="get" xf-mode="synchronous" xf-ref="instance('salida')/datosTarea" xf-resource="fake"> <br> <xforms-action ev-event="xforms-submit-error"> <br> <xforms-setvalue xf-ref="instance('salida')/datosTarea/numeroOrden"/> <br> </xforms-action> <br> </xforms-submission> <br> </xforms-model> <br>(...) <br> <br>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. <br> <br>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: <br> <br> <xforms-itemset xf-ref="instance('inst_tarea')/vct"> <br> <xforms-label xf-ref="elm[1]"/> <br> <xforms-value xf-ref="elm[2]"/> <br> </xforms-itemset> <br> <br>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: <br> <br> <xforms-itemset xf-ref="instance('inst_tarea')/vct"> <br> <xforms-value xf-ref="elm[2]"/> <br> <xforms-label xf-ref="elm[1]"/> <br> </xforms-itemset> <br> <br>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. <br> <br>Thank you, <br>Javier <br> <br> <div class="moz-cite-prefix"> El 10/6/21 a las 10:29, Steven Pemberton escribió: <br> </div> <blockquote type="cite"> On Thu, 10 Jun 2021 01:19:45 +0200, Javier Diazestebaranz(UST, ES) via Xsltforms-support <a class="moz-txt-link-rfc2396E" href="mailto:xsl...@li..."> <xsl...@li...></a> wrote: <br> <br> <blockquote> Hello, <br> <br>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. <br> <br>Before starting the migration, I have been testing some of our xforms pages with last version (downloaded from here: <a class="moz-txt-link-freetext" href="https://github.com/AlainCouthures/declarative4all/blob/master/public/direct/xsltforms.zip"> https://github.com/AlainCouthures/declarative4all/blob/master/public/direct/xsltforms.zip</a> , I m not sure if it is a stable one), and I came across some problems. <br> <br>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. <br> <br>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. <br> <br>* The first error that appears when the form load is: <br> <br><span style="font-family: monospace;">XSLTForms Exception<br>--------------------------<br><br>Error parsing the following XPath expression :<br><br><br><br>Unexpected char at ''</span> <br> <br>It seems this line have some problem, because when I comment out it, the error dissapears: <br> <br><xforms-setvalue xf-ref="instance('salida')/datosTarea/numeroOrden" xf-value=""/> </blockquote> <div> 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 </div> <div> <br> </div> <div> <setvalue ref="foo" value="''"/> </div> <div> <br> </div> <div> or equally good </div> <div> <br> </div> <div> <div> <setvalue ref="foo"/> </div> <div> <br> </div> <div> This is not good: </div> <div> <br> </div> <div> <div> <setvalue ref="foo" value=""/> </div> <div> <br> </div> <div> because @value has to be an expression. </div> <div> <br> </div> <div> Steven </div> </div> </div> </blockquote> <br> <br> <br> <pre class="moz-quote-pre">_______________________________________________ Xsltforms-support mailing list <a class="moz-txt-link-abbreviated" href="mailto:Xsl...@li...">Xsl...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support">https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a> </pre> </blockquote> <br>_______________________________________________ Xsltforms-support mailing list <a href="mailto:Xsl...@li..." class="moz-txt-link-abbreviated"> Xsl...@li...</a> <a href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support" class="moz-txt-link-freetext"> https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a> </blockquote> </blockquote> <br> <br> <br> <pre class="moz-quote-pre">_______________________________________________ Xsltforms-support mailing list <a href="mailto:Xsl...@li..." class="moz-txt-link-abbreviated">Xsl...@li...</a> <a href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support" class="moz-txt-link-freetext">https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a> </pre> </blockquote> <br> </blockquote> </body> </html> |