You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Alex Fuller <al...@oracle.com> on 2007/08/14 18:10:18 UTC

"Muenchian Method", for-each, variables, and id's

A few years back, there was a post about using the Muenchian Method in a sorted for-each that seems relevant to my problem, but I don't see any responses [http://marc.info/?l=xalan-j-users&m=109705190806154&w=2].  Does anyone know the resolution for Simon's issue?
 
In my case, I've got a stylesheet iterating over a distinct list formed from a Muenchian-style key.  Each pass includes a nested for-each across the same key that includes a sort.  In case1.xslt, the COUNT node using the same xpath as the for-each's select correctly shows that there are two CURRENCY_FLAG values, but the subsequent for-each iteration finds four.  Note that four unique ID's are discovered.  When I created a variable to hold the xpath's result (case2.xslt), both the COUNT and the number of iterations was correct.  
 
Can I infer that:
a) Sorting a key's list is performed by reference in memory and can alter the list itself.  This could affect nested sorts of keys.
b) Creating a variable creates a copy of the list, such that subsequent modifications do not affect the "variable-ized" list.
 
This is all using Xalan 2.7.1.  Files are attached.
 
Thanks,
Alex
 

RE: "Muenchian Method", for-each, variables, and id's

Posted by Alex Fuller <al...@oracle.com>.
> This is all using Xalan 2.7.1.
 
My mistake: it's Xalan 2.7.0.
 
Sorry for any confusion.

Re: "Muenchian Method", for-each, variables, and id's

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Alex.

"Alex Fuller" <al...@oracle.com> wrote on 2007-08-14 12:10:18 PM:
> A few years back, there was a post about using the Muenchian Method 
> in a sorted for-each that seems relevant to my problem, but I don't 
> see any responses [http://marc.info/?l=xalan-j-
> users&m=109705190806154&w=2].  Does anyone know the resolution for 
> Simon's issue?

I will have to investigate that.

> In my case, I've got a stylesheet iterating over a distinct list 
> formed from a Muenchian-style key.  Each pass includes a nested for-
> each across the same key that includes a sort.  In case1.xslt, the 
> COUNT node using the same xpath as the for-each's select correctly 
> shows that there are two CURRENCY_FLAG values, but the subsequent 
> for-each iteration finds four.  Note that four unique ID's are 
> discovered.  When I created a variable to hold the xpath's result 
> (case2.xslt), both the COUNT and the number of iterations was correct. 

Your test case looks like it is fixed by the patch for Jira issue 
XALANJ-2204.[1]  The fix will be included in the upcoming Xalan-J 2.7.1 
release.

Thanks,

Henry
[1] http://issues.apache.org/jira/browse/XALANJ-2204
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com