You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Helge Schulz (JIRA)" <xa...@xml.apache.org> on 2008/03/16 18:54:24 UTC

[jira] Created: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

[PATCH] XSLTC ignores XPath predicates in xsl:key elements
----------------------------------------------------------

                 Key: XALANJ-2438
                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
             Project: XalanJ2
          Issue Type: Bug
          Components: XSLTC
    Affects Versions: The Latest Development Code
         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
            Reporter: Helge Schulz
            Priority: Blocker
             Fix For: The Latest Development Code


The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
was rearranged in august 2003 to reorder the compilation of top level
XSLT elements (including keys) to respect dependencies between global
XSLT variables and keys. Method 'compileTopLevel' was changed to emit
code also for key elements and not emit code calling the method generated
by 'compileBuildKeys'. For this reason the byte code for each key element
is generated twice: First time into generated method 'buildKeys' from
'compileBuildKeys' and second time into generated method 'topLevel'
from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
it is called by the XSLT 'document' function, if additional input
documents are loaded later.

Unfortunately the translate method of some XPath elements expected to
be called only once and they remove sub elements while their first execution.
So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
the '_predicates' container while the execution from 'compileBuildKeys'.
So 'compileTopLevel' generates wrong code for all key elements containing
predicates in their XPath expressions.

The attached patch changes the 'FilterExpr' and 'Step' class to use an
index variable to determine the current predicate and to not remove them.
This patch was tested with the current Subversion version of Xalan
(last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
1.5.0_15, 1.6.0_04 and 1.6.0_05.

This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
(since 1.5.0_12 up to 1.5.0_15) in classes
'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
test JAR file contains also patches for these versions and fixes in form
of JAR files to be installed into '../jre/lib/endorsed' directories of
Sun JRE installations. The last Sun JRE version with correct handling
of xls:key elements is 1.5.0_11.

Please add the attached test files to the Xalan test suite. I have
released them under Apache license  version 2.0.

Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802365#action_12802365 ] 

Henry Zongaro commented on XALANJ-2438:
---------------------------------------

Hi, Helge.  I spent some time looking at your patch.  I didn't see an obvious problem, but when I tried applying it and running the conformance tests, I got a StackOverflowError while processing test case axes13.  So it looks like you've introduced an infinite recursion with the patch.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832998#action_12832998 ] 

Henry Zongaro commented on XALANJ-2438:
---------------------------------------

Hi, Helge.

I hadn't noticed it before, but it's come to my attention that two of the files you attached to this bug report -- PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar and PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar -- might contain Sun copyrighted code.  That code is licensed under different terms than the Apache license agreement.  I hope you'll understand if I remove them from the bug report.

Now that I understand that you have accessed the Sun reference implementation of JAXP, I won't be able to review and apply your patches.  That's because there's a risk that some of the changes you have contributed or might contribute in the future are covered by Sun's copyright.  As I am not an employee of Sun or Oracle, I don't have the authority to contribute Sun copyright code to the Apache project.  Only an employee of Sun or Oracle who has signed an Apache CLA can contribute such code.

Thanks for your understanding,
Henry




> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805257#action_12805257 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

I have submitted my patch to the Sun JAXP project and started a discussion topic about this patch and the consequences to the
OpenSHORE open source project:

<http://jaxp.dev.java.net/issues/show_bug.cgi?id=60>

<http://sourceforge.net/projects/openshore/forums/forum/223377/topic/3530816>

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "David Marston (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579717#action_12579717 ] 

David Marston commented on XALANJ-2438:
---------------------------------------

The input file can be shared across test cases. There should be separate stylesheets for each increment of difficulty. You submitted:
  <xsl:key name="seperator-key" match="seperator" use="@level" /> 
  <xsl:key name="para1-key" match="para[preceding::seperator[1]/@level = 1]" use="1" /> 
  <xsl:key name="para2-key" match="para[preceding::*[@level][1][@level = 2]]" use="2" /> 
  <xsl:key name="level-key" match="para" use="preceding::seperator[1]/@level" /> 
  <xsl:key name="structure-key" match="*" use="generate-id(((ancestor::*|preceding::*)[ self::document or ( @level and (not(current()/@level) or (@level < current()/@level)) ) ])[last()])" /> 

The first one, name="seperator-key", is probably tested adequately already. One step up in difficulty is to put a predicate on the match pattern, as in
match="seperator[@level=1]"
then have two sequential predicates, then nested predicates as in the name="para1-key" example.

The name="structure-key" key has several complications that should be isolated:
use of a union
predicates on a parenthesized nodeset
predicates on self or preceding (I think predicates on ancestor might be covered)
use of [last()]
use of [last()] against preceding
use of and/or/not in a predicate
use of generate-id() in general in keying
use of generate-id() as shown, on an element that is essentially unrelated to the one that was matched

I hope that clarifies what I'm advocating. I expect that the code will pass some of those cases, but apparently not all.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "David Bertoni (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920257#action_12920257 ] 

David Bertoni commented on XALANJ-2438:
---------------------------------------

Per Sam's comment, this patch seems fine. I will send an email to the PMC members to see if there are any objections to accepting it.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Re: [jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by Santiago Pericas-Geertsen <Sa...@Sun.COM>.
Helge,

 To expedite the Sun part, please file an issue on [1] and also check the terms of use [2], especially clause 4. Once the issue is filed, an engineer from Sun will review and commit your patch.

 Thanks.

-- Santiago

[1] https://jaxp.dev.java.net/servlets/ProjectIssues
[2] http://www.java.net/javanet-web-site-terms-use

On Jan 24, 2010, at 5:53 PM, Helge Schulz (JIRA) wrote:

> 
>    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804317#action_12804317 ] 
> 
> Helge Schulz commented on XALANJ-2438:
> --------------------------------------
> 
> Hello XML user and Java developer,
> 
> please help us to fix this bug in Sun Microsystems JRE versions. You can add your vote/comment to
> 
> <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6689809>
> 
> or submit this bug as an official support request to Sun, if your organization has a support contract with Sun. Thank you!
> 
> --
> Helge Schulz - http://OpenSHORE.org
> 
>> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
>> ----------------------------------------------------------
>> 
>>                Key: XALANJ-2438
>>                URL: https://issues.apache.org/jira/browse/XALANJ-2438
>>            Project: XalanJ2
>>         Issue Type: Bug
>>         Components: XSLTC
>>   Affects Versions: The Latest Development Code
>>        Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>>           Reporter: Helge Schulz
>>           Priority: Blocker
>>            Fix For: The Latest Development Code
>> 
>>        Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>> 
>> 
>> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
>> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
>> was rearranged in august 2003 to reorder the compilation of top level
>> XSLT elements (including keys) to respect dependencies between global
>> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
>> code also for key elements and not emit code calling the method generated
>> by 'compileBuildKeys'. For this reason the byte code for each key element
>> is generated twice: First time into generated method 'buildKeys' from
>> 'compileBuildKeys' and second time into generated method 'topLevel'
>> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
>> it is called by the XSLT 'document' function, if additional input
>> documents are loaded later.
>> Unfortunately the translate method of some XPath elements expected to
>> be called only once and they remove sub elements while their first execution.
>> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
>> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
>> the '_predicates' container while the execution from 'compileBuildKeys'.
>> So 'compileTopLevel' generates wrong code for all key elements containing
>> predicates in their XPath expressions.
>> The attached patch changes the 'FilterExpr' and 'Step' class to use an
>> index variable to determine the current predicate and to not remove them.
>> This patch was tested with the current Subversion version of Xalan
>> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
>> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
>> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
>> (since 1.5.0_12 up to 1.5.0_15) in classes
>> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
>> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
>> test JAR file contains also patches for these versions and fixes in form
>> of JAR files to be installed into '../jre/lib/endorsed' directories of
>> Sun JRE installations. The last Sun JRE version with correct handling
>> of xls:key elements is 1.5.0_11.
>> Please add the attached test files to the Xalan test suite. I have
>> released them under Apache license  version 2.0.
>> Helge Schulz - OpenSHORE.org
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xalan-dev-help@xml.apache.org
> 


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804317#action_12804317 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Hello XML user and Java developer,

please help us to fix this bug in Sun Microsystems JRE versions. You can add your vote/comment to

<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6689809>

or submit this bug as an official support request to Sun, if your organization has a support contract with Sun. Thank you!

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Michael Glavassevich (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833616#action_12833616 ] 

Michael Glavassevich commented on XALANJ-2438:
----------------------------------------------

Derivative works such as the Sun JAXP RI are permitted by the Apache License to distribute their software with different or additional license terms provided that they comply to the redistribution terms of the Apache License. Depending on those extra / different terms the resulting work may not be able to be included in an ASF project. It may not even be open source anymore. The concern with developers studying and contributing to the JAXP RI is the potential for contamination of the ASF project with code that carries license terms which are incompatible with Apache's licensing policy [1]. To my knowledge I don't believe any of Sun's distributions (even the OpenJDK one which I believe is a modified GPL) meets these requirements. Note that I haven't reviewed Sun's licensing terms myself in detail and I'm not a lawyer, so feel free to start a thread on legal-discuss@apache.org [2] if you have doubts.

Regarding source contamination, it can happen inadvertently. You may have been reading code that Sun never donated to the ASF and that could have inspired (some of) the contents of your patch without realizing that it may not have been your original idea. Did that happen here? I don't know but there's a risk that it did and can understand why Henry feels this would need to be assessed / committed by a Sun or Oracle employee since they own the copyright on any modifications / additions that have been made since forking from the ASF codebase.

Thanks.

[1] http://www.apache.org/legal/3party.html
[2] http://mail-archives.apache.org/mod_mbox/www-legal-discuss/

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804314#action_12804314 ] 

Helge Schulz edited comment on XALANJ-2438 at 1/24/10 11:18 PM:
----------------------------------------------------------------

Hello Xalan committer,

I have uploaded a new version of my patch, which avoids the infinite recursion in certain XPath expressions discovered by Henry Zongaro. I tested this new version with all XSL files from the sections 'accept', 'conf' and 'contrib' from the Xalan test archive (see <http://svn.apache.org/repos/asf/xalan/test/trunk/tests/>) and compare the output files against them of a run of an unpatched version:

run-conformance-test:
test-xslt-all:
     [echo] Testing file 'accept/collation/collation01.xsl'
     [echo] Testing file 'accept/collation/collation02.xsl'
     ...
     [echo] Testing file 'contrib/xsltc/schemasoft/selectHREF.xsl'
     [echo] Testing file 'contrib/xsltc/schemasoft/suppressEmptyElements.xsl'
     [echo] Compare output files of latest and fixed Xalan version
   [concat]          
   [concat] 1762 of 1762 Xalan conformance test output files are identical.
   [concat]          
Total time: 32 minutes 15 seconds 

I also add a new test case to my test JAR file to check the infinite recursion case (see PredicateInKey-15-ChainedElementPath.xsl in the JAR file). You can run these tests with the command:

java -jar PredicateInKey-XSLT-Test-1.3.jar -stepwise 

I tested the new patch additionally with all regression JUnit test cases of the JAXP project (see <https://jaxp-sources.dev.java.net/source/browse/jaxp-sources/jaxp-ri/src/unit-test>). This JUnit classes corresponds to bugs and their bug number fixed by Sun in their JDK/JRE versions. As you can see not all tests succeed with the current JDK version 1.6.0_18 and many tests are failing with the Apache Xalan versions. But there is no difference between the original and patched version. 

update-jaxp-tests:
        [echo] Update JAXP tests from JAVA-NET (jaxp-ri/src/unit-test)

test-jaxp-fixed:

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with original JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with latest Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>
BUILD SUCCESSFUL
Total time: 10 minutes 42 seconds  

--
Helge Schulz - http://OpenSHORE.org

      was (Author: heschulz):
    Hello Xalan committer,

I have uploaded a new version of my patch, which avoids the infinite recursion in certain XPath expressions discovered by . I tested this new version with all XSL files from the sections 'accept', 'conf' and 'contrib' from the Xalan test archive (see http://svn.apache.org/repos/asf/xalan/test/trunk/tests/) and compare the output files against them of a run of an unpatched version:

run-conformance-test:
test-xslt-all:
     [echo] Testing file 'accept/collation/collation01.xsl'
     [echo] Testing file 'accept/collation/collation02.xsl'
     ...
     [echo] Testing file 'contrib/xsltc/schemasoft/selectHREF.xsl'
     [echo] Testing file 'contrib/xsltc/schemasoft/suppressEmptyElements.xsl'
     [echo] Compare output files of latest and fixed Xalan version
   [concat]          
   [concat] 1762 of 1762 Xalan conformance test output files are identical.
   [concat]          
Total time: 32 minutes 15 seconds 

I also add a new test case to my test JAR file to check the infinite recursion case (see PredicateInKey-15-ChainedElementPath.xsl in the JAR file). You can run these tests with the command:

java -jar PredicateInKey-XSLT-Test-1.3.jar -stepwise 

I tested the new patch additionally with all regression JUnit test cases of the JAXP project (see https://jaxp-sources.dev.java.net/source/browse/jaxp-sources/jaxp-ri/src/unit-test). This JUnit classes corresponds to bugs and their bug number fixed by Sun in their JDK/JRE versions. As you can see not all tests succeed with the current JDK version 1.6.0_18 and many tests are failing with the Apache Xalan versions. But there is no difference between the original and patched version. 

update-jaxp-tests:
        [echo] Update JAXP tests from JAVA-NET (jaxp-ri/src/unit-test)

test-jaxp-fixed:

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with original JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with latest Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>
BUILD SUCCESSFUL
Total time: 10 minutes 42 seconds  

--
Helge Schulz - http://OpenSHORE.org
  
> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831768#action_12831768 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Joe Wang from Oracle/Sun Microsystems has started to work on the corresponding issue in the JDK/JAXP tracker. See:

<http://jaxp.dev.java.net/issues/show_bug.cgi?id=60>

Unfortunately my patch was not included in JAXP 1.4.3 released end of Januar 2010 (2010-01-27):

<http://jaxp.dev.java.net/1.4/1.4.3/changelog.html>

 -- 
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832724#action_12832724 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Joe Wang from Oracle has applied my patch to the JAXP/JDK version of Xalan-J and verified that the new patch passed 
all JAXP regression tests. See:

<http://jaxp-sources.dev.java.net/source/browse/jaxp-sources/xml-xalan/java/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FilterExpr.java?view=markup>
<http://jaxp-sources.dev.java.net/source/browse/jaxp-sources/xml-xalan/java/src/com/sun/org/apache/xalan/internal/xsltc/compiler/ParentLocationPath.java?view=markup>
<http://jaxp-sources.dev.java.net/source/browse/jaxp-sources/xml-xalan/java/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Step.java?view=markup>

The priority of the corresponding JDK bug 6689809 was raised from '4-Low' to '3-Medium' and has now chances to go into a new JDK distribution. See:

<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6689809>

The corresponding JAXP issue 60 has now the state 'RESOLVED' with resolution 'FIXED':

<http://jaxp.dev.java.net/issues/show_bug.cgi?id=60>

I hope my patch will go sometime also in the Apache Xalan-J version.

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804314#action_12804314 ] 

Helge Schulz edited comment on XALANJ-2438 at 1/24/10 11:19 PM:
----------------------------------------------------------------

Hello Xalan committer,

I have uploaded a new version of my patch, which avoids the infinite recursion in certain XPath expressions discovered by Henry Zongaro. I tested this new version with all XSL files from the sections 'accept', 'conf' and 'contrib' from the Xalan test archive (see http://svn.apache.org/repos/asf/xalan/test/trunk/tests/ ) and compare the output files against them of a run of an unpatched version:

run-conformance-test:
test-xslt-all:
     [echo] Testing file 'accept/collation/collation01.xsl'
     [echo] Testing file 'accept/collation/collation02.xsl'
     ...
     [echo] Testing file 'contrib/xsltc/schemasoft/selectHREF.xsl'
     [echo] Testing file 'contrib/xsltc/schemasoft/suppressEmptyElements.xsl'
     [echo] Compare output files of latest and fixed Xalan version
   [concat]          
   [concat] 1762 of 1762 Xalan conformance test output files are identical.
   [concat]          
Total time: 32 minutes 15 seconds 

I also add a new test case to my test JAR file to check the infinite recursion case (see PredicateInKey-15-ChainedElementPath.xsl in the JAR file). You can run these tests with the command:

java -jar PredicateInKey-XSLT-Test-1.3.jar -stepwise 

I tested the new patch additionally with all regression JUnit test cases of the JAXP project (see https://jaxp-sources.dev.java.net/source/browse/jaxp-sources/jaxp-ri/src/unit-test ). This JUnit classes corresponds to bugs and their bug number fixed by Sun in their JDK/JRE versions. As you can see not all tests succeed with the current JDK version 1.6.0_18 and many tests are failing with the Apache Xalan versions. But there is no difference between the original and patched version. 

update-jaxp-tests:
        [echo] Update JAXP tests from JAVA-NET (jaxp-ri/src/unit-test)

test-jaxp-fixed:

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with original JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with latest Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>
BUILD SUCCESSFUL
Total time: 10 minutes 42 seconds  

--
Helge Schulz - http://OpenSHORE.org

      was (Author: heschulz):
    Hello Xalan committer,

I have uploaded a new version of my patch, which avoids the infinite recursion in certain XPath expressions discovered by Henry Zongaro. I tested this new version with all XSL files from the sections 'accept', 'conf' and 'contrib' from the Xalan test archive (see <http://svn.apache.org/repos/asf/xalan/test/trunk/tests/>) and compare the output files against them of a run of an unpatched version:

run-conformance-test:
test-xslt-all:
     [echo] Testing file 'accept/collation/collation01.xsl'
     [echo] Testing file 'accept/collation/collation02.xsl'
     ...
     [echo] Testing file 'contrib/xsltc/schemasoft/selectHREF.xsl'
     [echo] Testing file 'contrib/xsltc/schemasoft/suppressEmptyElements.xsl'
     [echo] Compare output files of latest and fixed Xalan version
   [concat]          
   [concat] 1762 of 1762 Xalan conformance test output files are identical.
   [concat]          
Total time: 32 minutes 15 seconds 

I also add a new test case to my test JAR file to check the infinite recursion case (see PredicateInKey-15-ChainedElementPath.xsl in the JAR file). You can run these tests with the command:

java -jar PredicateInKey-XSLT-Test-1.3.jar -stepwise 

I tested the new patch additionally with all regression JUnit test cases of the JAXP project (see <https://jaxp-sources.dev.java.net/source/browse/jaxp-sources/jaxp-ri/src/unit-test>). This JUnit classes corresponds to bugs and their bug number fixed by Sun in their JDK/JRE versions. As you can see not all tests succeed with the current JDK version 1.6.0_18 and many tests are failing with the Apache Xalan versions. But there is no difference between the original and patched version. 

update-jaxp-tests:
        [echo] Update JAXP tests from JAVA-NET (jaxp-ri/src/unit-test)

test-jaxp-fixed:

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with original JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with latest Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>
BUILD SUCCESSFUL
Total time: 10 minutes 42 seconds  

--
Helge Schulz - http://OpenSHORE.org
  
> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Sam Ruby (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910587#action_12910587 ] 

Sam Ruby commented on XALANJ-2438:
----------------------------------

Reviewing the patch, I have no concern.  I see a report of a bug, complete with a test case.  I see a fix that is localized to a single source file, and every change appears to be directly related to addressing that bug.

As Oracle's implementation was originally based on Apache's, it seems quite likely that they would have a similar bug, and that a similar fix would be in order.  In fact, the indication from the original reporter that a similar bug exists in the Oracle implementation makes it rather unlikely that Helge -- intentionally or inadvertently -- copied GPL licensed code into this patch.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589732#action_12589732 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

On 2008/Apr/08 04:09 pm Brian Minchau wrote:
>
> Hi Helge.
>
> I'm afraid you can't assign someone to review.  However I will have a look
> at your patch.

Any progress in reviewing my patch?

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "David Marston (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579520#action_12579520 ] 

David Marston commented on XALANJ-2438:
---------------------------------------

The test case should be split up into several, so that individual keying situations can be isolated. I am particularly concerned about taking the union of ancestor and preceding. Each of those should be tested individually, in addition to testing the union. Testing of generate-id() as part of the key should be isolated, including isolation of any dependency on generate-id() taking the first member if its argument is a multi-node set. Nested predicates should be tested separately, after testing simple predicates.

I'm not saying Helge has to do this, but someone should split the test case.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Re: [jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by Brian Minchau <mi...@ca.ibm.com>.
Hi Helge.

I'm afraid you can't assign someone to review.  However I will have a look
at your patch.

- Brian



                                                                           
             "Helge Schulz                                                 
             (JIRA)"                                                       
             <xalan-dev@xml.ap                                          To 
             ache.org>                 xalan-dev@xml.apache.org            
                                                                        cc 
             04/08/2008 02:09                                              
             AM                                                    Subject 
                                       [jira] Commented: (XALANJ-2438)     
                                       [PATCH] XSLTC ignores XPath         
             Please respond to         predicates in xsl:key elements      
             xalan-dev@xml.apa                                             
                  che.org                                                  
                                                                           
                                                                           
                                                                           
                                                                           





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

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Is something still missing to review and apply this patch?

How can I assign this issue to a reviewer or committer?

Brian Minchau and other PMC members did not respond to mail requests for
help.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0
_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r584164.patch,
PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test.jar,
PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first
execution.
> So all XPath predicates get lost in class
'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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




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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586666#action_12586666 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Is something still missing to review and apply this patch?

How can I assign this issue to a reviewer or committer?

Brian Minchau and other PMC members did not respond to mail requests for help.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802122#action_12802122 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Why it takes almost two years to review and commit my patch?

Is there still an active commiter in this project?

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833002#action_12833002 ] 

Henry Zongaro commented on XALANJ-2438:
---------------------------------------

Further to my previous comment, I believe that PredicateInKey-XSLT-Test-1.3.jar and perhaps the other "Test" jar files attached to this bug report contain code from Sun's implementation of JAXP.  Could I ask you to remove any such code and patches from those jar files?  I don't want to remove them entirely, as I believe you also have test case code in those jar files, and I can't make the judgment myself about what should remain and what should be removed.

Thanks again for you understanding,
Henry

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804314#action_12804314 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Hello Xalan committer,

I have uploaded a new version of my patch, which avoids the infinite recursion in certain XPath expressions discovered by . I tested this new version with all XSL files from the sections 'accept', 'conf' and 'contrib' from the Xalan test archive (see http://svn.apache.org/repos/asf/xalan/test/trunk/tests/) and compare the output files against them of a run of an unpatched version:

run-conformance-test:
test-xslt-all:
     [echo] Testing file 'accept/collation/collation01.xsl'
     [echo] Testing file 'accept/collation/collation02.xsl'
     ...
     [echo] Testing file 'contrib/xsltc/schemasoft/selectHREF.xsl'
     [echo] Testing file 'contrib/xsltc/schemasoft/suppressEmptyElements.xsl'
     [echo] Compare output files of latest and fixed Xalan version
   [concat]          
   [concat] 1762 of 1762 Xalan conformance test output files are identical.
   [concat]          
Total time: 32 minutes 15 seconds 

I also add a new test case to my test JAR file to check the infinite recursion case (see PredicateInKey-15-ChainedElementPath.xsl in the JAR file). You can run these tests with the command:

java -jar PredicateInKey-XSLT-Test-1.3.jar -stepwise 

I tested the new patch additionally with all regression JUnit test cases of the JAXP project (see https://jaxp-sources.dev.java.net/source/browse/jaxp-sources/jaxp-ri/src/unit-test). This JUnit classes corresponds to bugs and their bug number fixed by Sun in their JDK/JRE versions. As you can see not all tests succeed with the current JDK version 1.6.0_18 and many tests are failing with the Apache Xalan versions. But there is no difference between the original and patched version. 

update-jaxp-tests:
        [echo] Update JAXP tests from JAVA-NET (jaxp-ri/src/unit-test)

test-jaxp-fixed:

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with original JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed JDK Xalan and JRE 1.6.0_18
       [junit] Test bug6537913.Test FAILED (crashed)
      [concat]          
      [concat] 125 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with latest Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>

run-jaxp-tests:
        [echo] Running JAXP JUnit tests with fixed Apache Xalan and JRE 1.6.0_18
       [junit] Test bug4892774.Bug FAILED
       [junit] Test bug4969042.Bug FAILED
       [junit] Test bug4991857.Bug FAILED
       [junit] Test bug6175602.Test FAILED
       [junit] Test bug6290947.Bug FAILED
       [junit] Test bug6309988.Bug FAILED
       [junit] Test bug6311448.UTF16Test FAILED
       [junit] Test bug6320118.Test FAILED
       [junit] Test bug6339023.Bug FAILED
       [junit] Test bug6384805.Test FAILED
       [junit] Test bug6451633.Bug FAILED
       [junit] Test bug6490380.Bug FAILED
       [junit] Test bug6490921.Bug FAILED
       [junit] Test bug6509668.Bug FAILED
       [junit] Test bug6513892.Test FAILED
       [junit] Test bug6521260.Test FAILED
       [junit] Test bug6526547.Test FAILED
       [junit] Test bug6537898.Test FAILED
       [junit] Test bug6537913.Test FAILED (crashed)
       [junit] Test bug6540545.Test FAILED
       [junit] FATAL ERROR:  'Could not compile stylesheet'
       [junit] Test bug6541384.Test FAILED
       [junit] Test bug6564400.Test FAILED
       [junit] Test bug6565260.Test FAILED
       [junit] Test bug6594813.Bug FAILED
       [junit] Test bug6863312.SecureProcessingTest FAILED
      [concat]          
      [concat] 101 of 126 JAXP JUnit tests classes succeeded.
      [concat]          
      [concat] Links to bug database entries of failed tests:
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4892774>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4969042>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4991857>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6175602>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6290947>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6309988>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311448>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6320118>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6339023>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384805>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6451633>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490380>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6490921>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6509668>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6513892>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6526547>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537898>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6537913>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6540545>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6541384>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6564400>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6565260>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6594813>
      [concat] <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6863312>
BUILD SUCCESSFUL
Total time: 10 minutes 42 seconds  

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802269#action_12802269 ] 

Henry Zongaro commented on XALANJ-2438:
---------------------------------------

The simple answer is there are too few committers remaining and those that are remaining don't have very much time to contribute to the project anymore.  I will try to spend an hour in the next day or two to review your patch.
I can't do anything about getting the bug fixed in the Sun Java run-time however; only in Xalan-J.

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Michael Glavassevich (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833616#action_12833616 ] 

Michael Glavassevich edited comment on XALANJ-2438 at 2/14/10 8:00 PM:
-----------------------------------------------------------------------

Derivative works such as the Sun JAXP RI are permitted by the Apache License to distribute their software with different or additional license terms provided that they comply to the redistribution terms of the Apache License. Depending on those extra / different terms the resulting work may not be able to be included in an ASF project. It may not even be open source anymore. The concern with developers studying and contributing to the JAXP RI is the potential for contamination of the ASF project with code that carries license terms which are incompatible with Apache's licensing policy [1]. To my knowledge I don't believe any of Sun's distributions (even the OpenJDK one which I believe is a modified GPL) meets these requirements. Note that I haven't reviewed Sun's licensing terms myself in detail and I'm not a lawyer, so feel free to start a thread on legal-discuss@apache.org [2] if you have doubts.

Regarding source contamination, it can happen inadvertently. You may have been reading code that Sun never donated to the ASF and that could have inspired (some of) the contents of your patch without realizing that it may not have been your original idea. Did that happen here? I don't know but there's a risk that it did and can understand why Henry feels this would need to be assessed / committed by a Sun or Oracle employee since they own the copyright on modifications / additions that have been made since forking from the ASF codebase.

Thanks.

[1] http://www.apache.org/legal/3party.html
[2] http://mail-archives.apache.org/mod_mbox/www-legal-discuss/

      was (Author: mrglavas@ca.ibm.com):
    Derivative works such as the Sun JAXP RI are permitted by the Apache License to distribute their software with different or additional license terms provided that they comply to the redistribution terms of the Apache License. Depending on those extra / different terms the resulting work may not be able to be included in an ASF project. It may not even be open source anymore. The concern with developers studying and contributing to the JAXP RI is the potential for contamination of the ASF project with code that carries license terms which are incompatible with Apache's licensing policy [1]. To my knowledge I don't believe any of Sun's distributions (even the OpenJDK one which I believe is a modified GPL) meets these requirements. Note that I haven't reviewed Sun's licensing terms myself in detail and I'm not a lawyer, so feel free to start a thread on legal-discuss@apache.org [2] if you have doubts.

Regarding source contamination, it can happen inadvertently. You may have been reading code that Sun never donated to the ASF and that could have inspired (some of) the contents of your patch without realizing that it may not have been your original idea. Did that happen here? I don't know but there's a risk that it did and can understand why Henry feels this would need to be assessed / committed by a Sun or Oracle employee since they own the copyright on any modifications / additions that have been made since forking from the ASF codebase.

Thanks.

[1] http://www.apache.org/legal/3party.html
[2] http://mail-archives.apache.org/mod_mbox/www-legal-discuss/
  
> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833479#action_12833479 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Hello Henry,

I would have wished that you had taken a closer look on the files you have removed or you had asked me before about the source of their content. The removed files PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar and PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar contained only Java source files (*.jar, *.orig) and compilation results of them (*.class) that are copyrighted by the Apache Software Foundation and are licensed under the Apache License 2.0. You would have checked this with the following command and resulting output:

unzip -p PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar *.java *.orig | egrep "(Copyright)|(Licensed)"
 * Copyright 2001-2005 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2005 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2005 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2005 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2005 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2005 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");

unzip -p PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar *.java *.orig | egrep "(Copyright)|(Licensed)"
 * Copyright 2001-2004 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2004 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2004 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2004 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2004 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Copyright 2001-2004 The Apache Software Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");

I have extracted the original Version of theses source files (*.orig) from the 'src.zip' file of the corresponding Sun JDK distribution. These files contain an unmodified Apache copyright header. Additional Sun confirms in the 'THIRDPARTYLICENSEREADME.txt' file in the used JDK/JRE distributions, that Xalan J2 in the JDK/JRE is governed by the terms of the Apache 2.0 license. Here is the quote:

"The following software may be included in this product:  Xalan J2; Use of any of this
software is governed by the terms of the license below:

                                Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/
..."

I have submitted my patch also under Apache 2.0 license, so in my understanding the removed files have contained only material governed by the Apache 2.0 license.

I understand that the command output above, do not prove the authenticity of the files. I would like to suggest, that I will contact PMC chair David Bertoni directly how we can prove (in example with the assistance of an Apache lawyer), that the questioned files contain only Apache 2.0 licensed material.

Until this issue is resolved, I will upload a new version of my test case, without any Apache 2.0 licensed material from Sun sources as you requested

To the best of my knowledge Sun has never modified the three files, I have modified to fix the JDK/JRE version, since they copied Xalan-J in the 'com.sun.org.apache.internal' package and start to distribute them in every JDK/JRE version. Therefore the original files are identical accept of the package name with old versions in the Xalan-J version control system. Even if Sun would have modified these files, they would have publish these changes under Apache 2.0 license by using an unmodified Apache copyright header and confirming the license inside their third party software statement. So in my understanding, every Xalan-J enhancement inside an JDK/JRE distribution can be added to the Apache Xalan-J version. But this is a subject for a discussion at another place.

Henry Zongaro wrote at 12/Feb/10 02:01 PM:
>
> Now that I understand that you have accessed the Sun reference implementation of JAXP,
> I won't be able to review and apply your patches. That's because there's a risk that some
> of the changes you have contributed or might contribute in the future are covered by
> Sun's copyright. As I am not an employee of Sun or Oracle, I don't have the authority to
> contribute Sun copyright code to the Apache project. Only an employee of Sun or Oracle
> who has signed an Apache CLA can contribute such code.

As I explained above, I did not use any JAXP material for developing the Xalan-J patch (only Apache 2.0 material). I only contribute my patch to the JAXP project, because for me the Xalan-J project seems to be dead after waiting nearly two years for a review and receiving no answers for dozens of mails. The contribution for the JAXP project was an advice from the Xalan-J PMC (ex- ?) member Santiago Pericas-Geertsen to expedite the bug fixing in JDK/JRE (see his xalan-dev posting from 2010-01-26, archived at <http://mail-archives.apache.org/mod_mbox/xml-xalan-dev/201001.mbox/browser>).

Does Henry's statement above mean, that I am no longer welcome to contribute any patches to Xalan-J by following Santiagos advice or does it mean, that only an Oracle employe and PMC member can check in my patch (Who)?

If I am no longer welcome, I would have made a big mistake and what would have then been the correct way to contribute a patch to Xalan-J and JDK (over JAXP, which is the only source for XML updates) simultaneously?

Did you or any Apache member receive a request from Oracle/Sun to remove the discussed files?

Regards, Helge

--
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test-1.3.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802546#action_12802546 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

Hello Henry,

thank you for looking at my patch.

I can confirm the infinite recursion with axes13.xsl. It is in the call path Step.translate -> Step.translateStep -> Step.translatePredicates -> ParentLocationPath.translate -> Step.translate. In the old version it ends, because predicates are removed from Step._predicates.

I think we have found another bug, because the evaluation of remaining predicates in ParentLocationPath.translate -> Step.translate is wrong. Therefore remaining predicates will check the wrong element. If I prevent evaluation of predicates in ParentLocationPath.translate by removing them temporally from the step, the infinite recursion is gone and the test creates the right output. This can be done by

		// Otherwise we create a parent location path with this Step and
		// the predicates Step, and place the node test on top of that
		else {
		    ParentLocationPath path = new ParentLocationPath(this,step);
		    try {
			path.typeCheck(getParser().getSymbolTable());
		    }
		    catch (TypeCheckError e) { }
		    Vector oldPredicates = _predicates;
		    _predicates = null;
		    path.translate(classGen, methodGen);
		    _predicates = oldPredicates;
		    il.append(new ICONST(DOM.RETURN_PARENT));
		}

near line 407 in Step.java.

I will investigate this further tomorrow.

-- 
Helge Schulz - http://OpenSHORE.org

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Sun-JRE-1_5_0_22-Fix.jar, PredicateInKey-Sun-JRE-1_6_0_18-Fix.jar, PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-Xalan-SVN-r889881.patch, PredicateInKey-XSLT-Test-1.1.jar, PredicateInKey-XSLT-Test-1.2.jar, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XALANJ-2438) [PATCH] XSLTC ignores XPath predicates in xsl:key elements

Posted by "Helge Schulz (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579636#action_12579636 ] 

Helge Schulz commented on XALANJ-2438:
--------------------------------------

David: Do you want separate stylesheet files, input files and expected output files for every keying situation?

All: Is the splitting of my test case a precondition for the evaluation or acceptance of my patch?

> [PATCH] XSLTC ignores XPath predicates in xsl:key elements
> ----------------------------------------------------------
>
>                 Key: XALANJ-2438
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2438
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XSLTC
>    Affects Versions: The Latest Development Code
>         Environment: Linux and Windows XP with Sun JRE 1.5.0_14, 1.5.0_15, 1.6.0_04 and 1.6.0_05
>            Reporter: Helge Schulz
>            Priority: Blocker
>             Fix For: The Latest Development Code
>
>         Attachments: PredicateInKey-Xalan-SVN-r584164.patch, PredicateInKey-XSLT-Test.jar, PredicateInKey.out, PredicateInKey.xml, PredicateInKey.xsl
>
>
> The Xalan XSLT compiler (XSLTC) ignores XPath predicates in xsl:key
> elements since the class 'org.apache.xalan.xsltc.compiler.Stylesheet'
> was rearranged in august 2003 to reorder the compilation of top level
> XSLT elements (including keys) to respect dependencies between global
> XSLT variables and keys. Method 'compileTopLevel' was changed to emit
> code also for key elements and not emit code calling the method generated
> by 'compileBuildKeys'. For this reason the byte code for each key element
> is generated twice: First time into generated method 'buildKeys' from
> 'compileBuildKeys' and second time into generated method 'topLevel'
> from 'compileTopLevel'. Method 'buildKeys' is still necessary, because
> it is called by the XSLT 'document' function, if additional input
> documents are loaded later.
> Unfortunately the translate method of some XPath elements expected to
> be called only once and they remove sub elements while their first execution.
> So all XPath predicates get lost in class 'org.apache.xalan.xsltc.compiler.FilterExpr'
> and 'org.apache.xalan.xsltc.compiler.Step' by a remove operation on
> the '_predicates' container while the execution from 'compileBuildKeys'.
> So 'compileTopLevel' generates wrong code for all key elements containing
> predicates in their XPath expressions.
> The attached patch changes the 'FilterExpr' and 'Step' class to use an
> index variable to determine the current predicate and to not remove them.
> This patch was tested with the current Subversion version of Xalan
> (last change of Xalan tree in revision 584164) and with Sun JDK 1.5.0_14,
> 1.5.0_15, 1.6.0_04 and 1.6.0_05.
> This bug exists also in Sun JRE 1.6 (1.6.0 up to 1.6.0_05) and JRE 1.5
> (since 1.5.0_12 up to 1.5.0_15) in classes
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.FilterExpr' and
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.Step'. The attached
> test JAR file contains also patches for these versions and fixes in form
> of JAR files to be installed into '../jre/lib/endorsed' directories of
> Sun JRE installations. The last Sun JRE version with correct handling
> of xls:key elements is 1.5.0_11.
> Please add the attached test files to the Xalan test suite. I have
> released them under Apache license  version 2.0.
> Helge Schulz - OpenSHORE.org

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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