Hi all,
   I've just thought of mentioning these issues to this list (if
anyone has any thoughts for possible fixes, that'll be great to know).

The following XSLT 3.0 stylesheet produces, wrong numeric result when
run by the latest XalanJ XSLT 3.0 codebase on dev repos branch
xalan-j_xslt3.0,

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                         xmlns:xs="http://www.w3.org/2001/XMLSchema";
                         exclude-result-prefixes="xs"
                         version="3.0">

  <xsl:variable name="func1" select="function($x as xs:integer) as
xs:integer { $x + 3 }"/>

  <xsl:variable name="func2" select="function($x as xs:integer) as
xs:integer { $x * 2 }"/>

  <xsl:template match="/">
     <result>
          <xsl:value-of select="$func1(2) + $func2(3)"/>
     </result>
  </xsl:template>

</xsl:stylesheet>

Whereas, the following XSLT 3.0 stylesheet workaround works fine with
XalanJ on dev repos branch xalan-j_xslt3.0,

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                         xmlns:xs="http://www.w3.org/2001/XMLSchema";
                         exclude-result-prefixes="xs"
                         version="3.0">

  <xsl:variable name="func1" select="function($x as xs:integer) as
xs:integer { $x + 3 }"/>

  <xsl:variable name="func2" select="function($x as xs:integer) as
xs:integer { $x * 2 }"/>

  <xsl:template match="/">
        <result>
            <xsl:variable name="f1Result" select="$func1(2)"/>
            <xsl:variable name="f2Result" select="$func2(3)"/>
            <xsl:value-of select="$f1Result + $f2Result"/>
        </result>
  </xsl:template>

</xsl:stylesheet>


--
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to