You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/04/26 16:24:19 UTC

[Bug 1534] New - xsl:param used multiple times is not re-evaluated, subseq. param value is wrong

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1534

*** shadow/1534	Thu Apr 26 07:24:19 2001
--- shadow/1534.tmp.11183	Thu Apr 26 07:24:19 2001
***************
*** 0 ****
--- 1,63 ----
+ +============================================================================+
+ | xsl:param used multiple times is not re-evaluated, subseq. param value is  |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1534                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.0                   |
+ |   Resolution:                            Platform: Sun                     |
+ |     Severity: Normal                   OS/Version: Solaris                 |
+ |     Priority: Medium                    Component: org.apache.xalan.xsltc  |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xalan-dev@xml.apache.org                                     |
+ |  Reported By: tamiro@east.sun.com                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ [from SunMicrosystem's bug 4441378]
+ xsl:param values are set once, so on subsequent calls, the value is not reset.
+ Example is unit test var14.xsl:
+ 
+ <?xml version="1.0"?>
+ <xsl:stylesheet version="1.0"
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ 
+ <xsl:template match="list">
+    <xsl:apply-templates/>
+ </xsl:template>
+ 
+ <xsl:template  match="item" >
+    <xsl:param name="node" select="current()"/>
+    {<xsl:value-of  select="$node"/>}{<xsl:value-of  select="current()"/>}
+ </xsl:template>
+ 
+ </xsl:stylesheet>
+ 
+ Given the following input file : (var14.xml)
+ <?xml version="1.0"?>
+ <list>
+   <item>Red</item>
+   <item>Blue</item>
+   <item>Green</item>
+   <item>Yellow</item>
+ </list>
+ 
+ The param 'node' should be reset each time thru the template match on item,
+ so the output of the xsl:value-of statements should match as in the saxon output
+ below:
+ 
+ <?xml version="1.0" encoding="utf-8"?> 
+    {Red}{Red}  
+    {Blue}{Blue}  
+    {Green}{Green} 
+    {Yellow}{Yellow}
+ 
+ Xsltc does not produce this output, but instead produces the following :
+ <?xml version="1.0" encoding="utf-8" ?> 
+    {Red}{Red}  
+    {Red}{Blue}  
+    {Red}{Green}  
+    {Red}{Yellow}
+ 
+ which demonstrates that the param is not being re-evaluated, but is forever has
+ the value of 'Red' regardless of the current() value of the node.