Issue Details (XML | Word | Printable)

Key: XALANJ-2204
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Brian Minchau
Reporter: Filippo Munafò
Votes: 4
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
XalanJ2

Function Count on variable modifies number of nodes in variable.

Created: 23/Sep/05 07:57 AM   Updated: 12/Dec/07 10:55 AM
Return to search
Component/s: transformation
Affects Version/s: 2.7
Fix Version/s: 2.7.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works jira_2204.patch2.txt 2006-10-19 05:15 AM Brian Minchau 4 kB
Text File Licensed for inclusion in ASF works jira_2204.patch3.txt 2006-10-23 09:42 PM Brian Minchau 9 kB
Text File Licensed for inclusion in ASF works jira_2204.patch4.txt 2006-10-27 08:26 PM Brian Minchau 19 kB
Text File Licensed for inclusion in ASF works patch_jira_2204.txt 2006-01-28 05:05 AM Joanne Tong 0.7 kB
Issue Links:
Duplicate
 
Reference

Xalan info: PatchAvailable
Reviewer: Henry Zongaro
Resolution Date: 31/Oct/06 04:42 AM


 Description  « Hide
Transforming this XML:

<A>
<B>1</B>
<B>2</B>
</A>

with the following XSL:

<xsl:variable name="XML" select="/A"/>

<xsl:template match="/">
First:
<xsl:value-of select="count($XML[B=1])"/>
Second:
<xsl:value-of select="count($XML[B=1])"/>
Third:
<xsl:value-of select="count($XML[B=1])"/>
</xsl:template>

the output is:

First:
1
Second:
2
Third:
3

instead of:

First:
1
Second:
1
Third:
1

Using XALAN 2.6 everithing works as it should be.

Using:

     xalan.jar org.apache.xalan.xslt.Process -in %1 -xsl %2 -out %3

instead of:

     transformer.transform(xml, xsl)

the result is the right one!

Filippo

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order