http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2280 *** shadow/2280 Fri Jun 22 03:29:18 2001 --- shadow/2280.tmp.2607 Sat Jun 23 12:37:04 2001 *************** *** 2,9 **** | Position function gives wrong number back | +----------------------------------------------------------------------------+ | Bug #: 2280 Product: XalanJ2 | ! | Status: NEW Version: 2.0.4 | ! | Resolution: Platform: PC | | Severity: Normal OS/Version: Linux | | Priority: Other Component: org.apache.xalan.transf | +----------------------------------------------------------------------------+ --- 2,9 ---- | Position function gives wrong number back | +----------------------------------------------------------------------------+ | Bug #: 2280 Product: XalanJ2 | ! | Status: RESOLVED Version: 2.0.4 | ! | Resolution: INVALID Platform: PC | | Severity: Normal OS/Version: Linux | | Priority: Other Component: org.apache.xalan.transf | +----------------------------------------------------------------------------+ *************** *** 57,59 **** --- 57,89 ---- doing something wrong). gr. Martin + + ------- Additional Comments From [EMAIL PROTECTED] 2001-06-23 12:37 ------- + > Note that if I try this transformation with pre-compiled stylesheets which are + > loaded in memory then the resulting output is correct (1,2 and 3). + + Then the bug may be with the pre-compiled stylesheets. The command-line output + seems to be correct, since it is also counting whitespace nodes. + + You may want to change your stylesheet to: + <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'> + <xsl:template match="/"> + <html> + <xsl:apply-templates select="*"/> + </html> + </xsl:template> + + <xsl:template match="naam"> + <xsl:value-of select="string(position())"/>, <xsl:value-of + select="."/><xsl:text> </xsl:text> + </xsl:template> + + <xsl:template match="*"> + <xsl:apply-templates select="*"/> + </xsl:template> + + </xsl:stylesheet> + + You might consider filing another bug about the compiled version of the + stylesheet giving different output, but we'll need a reproduceable testcase. +
