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=3238 *** shadow/3238 Wed Aug 22 16:36:18 2001 --- shadow/3238.tmp.10516 Wed Aug 22 16:36:18 2001 *************** *** 0 **** --- 1,102 ---- + +============================================================================+ + | incorrect results for predicates applied to parameters in the select of a | + +----------------------------------------------------------------------------+ + | Bug #: 3238 Product: XalanJ2 | + | Status: NEW Version: CurrentCVS | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: org.apache.xalan.xsltc | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + (run against current cvs source) + + XSLT + ---- + + <?xml version='1.0' encoding='utf-8' ?> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xsl:version="1.0"> + <xsl:output method="text" indent="no"/> + + <xsl:template match="/"> + <xsl:variable name="foo" select="/data/point"/> + + AllOrNothing ByReference + <xsl:call-template name="AllOrNothing"> + <xsl:with-param name="path" select="$foo"/> + </xsl:call-template> + AllOrNothing ByValue + <xsl:call-template name="AllOrNothing"> + <xsl:with-param name="path" select="/data/point"/> + </xsl:call-template> + AlmostAndNothing ByReference + <xsl:call-template name="AlmostAndNothing"> + <xsl:with-param name="path" select="$foo"/> + </xsl:call-template> + AlmostAndNothing ByValue + <xsl:call-template name="AlmostAndNothing"> + <xsl:with-param name="path" select="/data/point"/> + </xsl:call-template> + + </xsl:template> + + <xsl:template name="AllOrNothing"> + <xsl:param name="path"/> + + <xsl:for-each select="/data/point"> + <xsl:variable name="pos" select="position()"/> + + <xsl:for-each select="$path[$pos]"> + <xsl:value-of select="."/> + </xsl:for-each> + </xsl:for-each> + </xsl:template> + + <xsl:template name="AlmostAndNothing"> + <xsl:param name="path"/> + + <xsl:for-each select="$path"> + <xsl:variable name="pos" select="position()"/> + + <xsl:for-each select="$path[$pos]"> + <xsl:value-of select="."/> + </xsl:for-each> + </xsl:for-each> + </xsl:template> + + </xsl:stylesheet> + + XML + --- + + <data><point>10</point><point>20</point><point>30</point></data> + + OUTPUT + ------ + + AllOrNothing ByReference + 102030 + AllOrNothing ByValue + + AlmostAndNothing ByReference + 10 + AlmostAndNothing ByValue + + + EXPECTED + -------- + + AllOrNothing ByReference + 102030 + AllOrNothing ByValue + 102030 + AlmostAndNothing ByReference + 102030 + AlmostAndNothing ByValue + 102030
