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/03/09 00:05:00 UTC
[Bug 909] New - Scope of xsl:param is wrong
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=909
*** shadow/909 Thu Mar 8 15:05:00 2001
--- shadow/909.tmp.27185 Thu Mar 8 15:05:00 2001
***************
*** 0 ****
--- 1,50 ----
+ +============================================================================+
+ | Scope of xsl:param is wrong |
+ +----------------------------------------------------------------------------+
+ | Bug #: 909 Product: XalanJ2 |
+ | Status: NEW Version: 2.0.0 |
+ | Resolution: Platform: PC |
+ | Severity: Critical OS/Version: Linux |
+ | Priority: Component: org.apache.xalan.templa |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xalan-dev@xml.apache.org |
+ | Reported By: jtl@schlund.de |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ xsl:param declarations behave as if they were scoped over a complete call to
+ xsl:apply-templates and not lexically to the template they are in.
+
+ Minimal example:
+
+ This xml:
+ <?xml version="1.0" encoding="iso-8859-1"?>
+ <b>
+ <a>One</a>
+ <a>Two</a>
+ </b>
+
+ This xsl:
+ <xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="b">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="a">
+ <xsl:param name="num"><xsl:value-of select="./text()"/></xsl:param>
+ * <xsl:value-of select="$num"/> (<xsl:value-of select="./text()"/>)
+ </xsl:template>
+ </xsl:stylesheet>
+
+ The output: (ignoring blank lines):
+
+ * One (One)
+ * One (Two)
+
+ Expected output (again, ignoring blank lines):
+
+ * One (One)
+ * Two (Two)