[ 
https://issues.apache.org/jira/browse/XALANJ-2787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17886369#comment-17886369
 ] 

Mukul Gandhi commented on XALANJ-2787:
--------------------------------------

[~martin.honnen] There were code improvements committed to Xalan-J's xsl 3 dev 
repos branch few minutes ago, related to implementation of XPath 3.1 
'intersect' and 'except' operators. You may try running your XSL example by 
using latest code available on Xalan-J repos.

Also currently, Xalan-J's XPath 'intersect' and 'except' operator 
implementations cannot handle literal sequence argument(s), that your XSL 
example in this bug report uses.

The following workaround currently works fine, for your XSL example provided in 
this big report (i.e, we can use a variable referring to a literal sequence),
<xsl:variable name="seq" select="(foo, bar)"/>
<xsl:apply-templates select="* except $seq"/>



> java.lang.StackOverflowError with except operator in XSLT 3 code
> ----------------------------------------------------------------
>
>                 Key: XALANJ-2787
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2787
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>          Components: transformation, Xalan, Xalan-CmdLine
>    Affects Versions: The Latest Development Code
>         Environment: Windows 11, Java 8
>            Reporter: Martin Honnen
>            Priority: Major
>         Attachments: except-input-sample2.xml, except-test2.xsl
>
>
> This is a bug report on the XSLT 3.0 development branch of Xalan.
> I have tried to use the newly implemented `except` operator but get a 
> java.lang.StackOverflowError with a simple test case that runs fine with 
> Saxon HE 12 Java.
> XSLT code:
>  
> {code:java}
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>   version="3.0"
>   xmlns:xs="http://www.w3.org/2001/XMLSchema";
>   exclude-result-prefixes="xs">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="@* | node()">
>     <xsl:copy>
>       <xsl:apply-templates select="@* | node()"/>
>     </xsl:copy>
>   </xsl:template>
>   <xsl:template match="/*">
>     <xsl:copy>
>       <xsl:apply-templates select="* except (foo, bar)"/>
>     </xsl:copy>
>   </xsl:template>
>   <xsl:template match="/">
>     <xsl:copy>
>       <xsl:apply-templates/>
>       <xsl:comment>Run with <xsl:value-of 
> select="system-property('xsl:vendor')"/> at <xsl:value-of 
> select="current-dateTime()"/></xsl:comment>
>     </xsl:copy>
>   </xsl:template> 
> </xsl:stylesheet>
> {code}
>  
> XML input sample:
> {code:java}
> <root>
>   <foo>foo 1</foo>
>   <bar>bar 1</bar>
>   <baz>baz 1</baz>
>   <foo>foo 2</foo>
>   <baz>baz 2</baz>
> </root>{code}
> Result with Xalan:
>  
> {noformat}
> file:///C:/Users/marti/IdeaProjects/xalan-java/../../OneDrive/Documents/xslt/blog-xslt-3-by-example/xalan-xslt3-tests/except-test2.xsl;
>  Zeilennummer17; Spaltennummer58; Erwartet wurde ), gefunden wurde: ,
> file:///C:/Users/marti/IdeaProjects/xalan-java/../../OneDrive/Documents/xslt/blog-xslt-3-by-example/xalan-xslt3-tests/except-test2.xsl;
>  Zeilennummer17; Spaltennummer58; Erwartet wurde ), gefunden wurde: ,
> (Position des Fehlers unbekannt)XSLT-Fehler (java.lang.StackOverflowError): 
> null
> Exception in thread "main" java.lang.RuntimeException
>         at org.apache.xalan.xslt.Process.doExit(Process.java:1176)
>         at org.apache.xalan.xslt.Process.main(Process.java:1149)
> {noformat}
> Result with Saxon:
>  
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>                                        
>     <root>                                       
>    <baz>baz 1</baz>
>    <baz>baz 2</baz>
> </root>
> <!--Run with Saxonica at 2024-10-02T13:35:37.9336156+02:00-->{code}
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to