PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3490 *** shadow/3490 Fri Sep 7 07:26:38 2001 --- shadow/3490.tmp.29116 Fri Sep 7 07:26:38 2001 *************** *** 0 **** --- 1,164 ---- + +============================================================================+ + | xsltc fails conf test select08 node set assigne to param broken | + +----------------------------------------------------------------------------+ + | Bug #: 3490 Product: XalanJ2 | + | Status: NEW Version: CurrentCVS | + | Resolution: Platform: All | + | Severity: Blocker OS/Version: All | + | Priority: Other Component: org.apache.xalan.xsltc | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Looks like this test uncovered a major problem that may be due to the recent + enhancement enabling result tree fragments to be passed as node sets. + + This test covers the case where a global param is assigned a node set via a + select expression. A subsequent apply-templates selecting nodes using the + parameter shows the prameter is not functioning as a node set, because + no templates matchig the nodes get invoked. The problem is specific to + parameters vs variable. That is, there is no problem if you just change the + <xsl:param > to <xsl:variable>. + + I tested the following cases to determine whether the problem has anything to + do with how the variable/param is assigned the node set: by a select expression + versus a result tree fragment. Here's the results: + + param variable + select fail pass + global RTF fail pass + --------------------------------------- + select fail pass + local RTF fail pass + + In the 'select' case, the fail was reflected by a lack + of output. In the 'RTF' case, the fail was reflected by + a stack overflow and a screenfull of undesireable output. + + The following is the stylesheet with these 8 cases. I + just changed the name of the variable/param in the + apply-templates. + + <?xml version="1.0"?> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <xsl:param name="globalparamselect" select="/doc/*"/> + + <xsl:variable name="globalvarselect" select="/doc/*"/> + + <xsl:param name="globalparamrtf"> + <xsl:for-each select="/doc/*"> + <xsl:copy-of select="."/> + </xsl:for-each> + </xsl:param> + + <xsl:variable name="globalvarrtf"> + <xsl:for-each select="/doc/*"> + <xsl:copy-of select="."/> + </xsl:for-each> + </xsl:variable> + + <xsl:template match="doc"> + + <xsl:param name="localparamselect" select="/doc/*" /> + + <xsl:param name="localparamrtf"> + <xsl:for-each select="/doc/*"> + <xsl:copy-of select="."/> + </xsl:for-each> + </xsl:param> + + <xsl:variable name="localvarselect" select="/doc/*" /> + + <xsl:variable name="localvarrtf"> + <xsl:for-each select="/doc/*"> + <xsl:copy-of select="."/> + </xsl:for-each> + </xsl:variable> + + <out> + <xsl:apply-templates select="$localparamrtf" /> + </out> + </xsl:template> + + <xsl:template match="foo"> + <xsl:text>Got a foo node;</xsl:text> + </xsl:template> + + <xsl:template match="wiz"> + <xsl:text>Got a wiz node;</xsl:text> + </xsl:template> + + <xsl:template match="node()"> + <xsl:text>Got some other node; + </xsl:text> + </xsl:template> + + </xsl:stylesheet> + Here's the details for the select08 test itself. + + Expected Output + --------------- + <?xml version="1.0" encoding="UTF-8"?> + <out>Got a foo node;Got some other node; + Got some other node; + Got a wiz node;Got a foo node;</out> + + Obtained Output + --------------- + <?xml version="1.0" encoding="utf-8" ?> + <out/> + + select08.xsl + ------------ + <?xml version="1.0"?> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <!-- FileName: select08 --> + <!-- Document: http://www.w3.org/TR/xslt --> + <!-- DocVersion: 19991116 --> + <!-- Section: 11.4 Top-level parameters --> + <!-- Purpose: Test assignment of a node-set to a parameter, then use in + select. --> + <!-- Creator: David Marston --> + + <xsl:param name="truenodes" select="/doc/*[@test='true']"/> + + <xsl:template match="doc"> + <out> + <xsl:apply-templates select="$truenodes"/> + </out> + </xsl:template> + + <xsl:template match="foo"> + <xsl:text>Got a foo node;</xsl:text> + </xsl:template> + + <xsl:template match="wiz"> + <xsl:text>Got a wiz node;</xsl:text> + </xsl:template> + + <xsl:template match="node()"> + <xsl:text>Got some other node; + </xsl:text> + </xsl:template> + + </xsl:stylesheet> + + select08.xml + ------------ + <?xml version="1.0"?> + <doc> + <foo test="true"/> + <sub test="false"/> + <foo test="false"/> + <bar test="true"/> + <wiz test="false"/> + <sub test="true"/> + <wiz test="true"/> + <foo test="true"/> + </doc>