Hi all,
    The XSLT stylesheet use case referred within my below cited mail,
could be solved with XSLT 3.0 xsl:function element as well. The XalanJ
latest codebase on dev repos branch xalan-j_xslt3.0 is able to do
that. .

The following XSLT stylesheets, from XalanJ's XSLT 3.0 test cases,
illustrate the stylesheet solution using the xsl:function element,

https://github.com/apache/xalan-java/blob/xalan-j_xslt3.0/tests/xsl_function/test16.xsl
https://github.com/apache/xalan-java/blob/xalan-j_xslt3.0/tests/xsl_function/test17.xsl

It'll be nice if, the same could be achieved with XPath 3.1 dynamic
function calls as well. This is currently not possible with XalanJ
codebase on dev repos branch xalan-j_xslt3.0, as I've mentioned within
my mail below.

If anyone wishes to provide a fix for this issue, for the XalanJ
codebase on dev repos branch xalan-j_xslt3.0, the support will be
appreciated.

On Sat, Oct 14, 2023 at 4:55 PM Mukul Gandhi <muk...@apache.org> wrote:
> There seems to be a codebase implementation issue on the, XalanJ
> dev repos branch xalan-j_xslt3.0, as described below.
>
> Please consider the following XSLT 3.0 stylesheet,
>
> <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:output method="xml" indent="yes"/>
>
>   <xsl:variable name="isInteger" select="function($a as item()) as
> xs:boolean { $a instance of xs:integer }"/>
>
>   <xsl:template match="/">
>       <result>
>            <one><xsl:value-of select="$isInteger('abc') and
> $isInteger(5)"/></one>
>       </result>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> The correct XSLT stylesheet transformation result of the above cited
> stylesheet is following,
>
> <?xml version="1.0" encoding="UTF-8"?><result>
>   <one>false</one>
> </result>
>
> But the current XSLT 3.0 and XPath 3.1 implementations, on the XalanJ
> dev repos branch xalan-j_xslt3.0, produces following stylesheet
> transformation result for above cited stylesheet example,
>
> <?xml version="1.0" encoding="UTF-8"?><result>
>      <one>true</one>
> </result>
>
> (i.e, boolean true instead of false)
>
> I'm able to see that, most of (I guess all) XPath 3.1 binary operators
> that have both operands as dynamic function calls, has the same issue
> as described above (for the XalanJ dev repos branch xalan-j_xslt3.0).
> For example, $func1(args) + $func2(args) shall also produce a wrong
> result with current XalanJ implementation on dev repos branch
> xalan-j_xslt3.0.
>
> If anyone could, look at XalanJ implementation on dev repos branch
> xalan-j_xslt3.0, and suggest a fix for above cited implementation
> issues, that'll be great and shall be helpful to the XalanJ project.


-- 
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