Hi all,
   Wrt to issues that I've expressed concerns with few months ago as
illustrated within (my) mail below, I seem to have discovered a good
workaround to this as follows.

XPath 3.1 function fn:apply is able to solve this.

With an XSL variable declaration <xsl:variable name="isInteger"
select="function($a as item()) as xs:boolean { $a instance of
xs:integer }"/>

the following XPath expression works fine,

apply($isInteger,['abc']) and apply($isInteger,[5])

IMHO, therefore I don't see an urgent need to fix the issues mentioned
within mail below.

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