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=3357

*** shadow/3357 Thu Aug 30 05:22:32 2001
--- shadow/3357.tmp.18638       Thu Aug 30 05:22:32 2001
***************
*** 0 ****
--- 1,64 ----
+ +============================================================================+
+ | bug in position()                                                          |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 3357                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.2.x                   |
+ |   Resolution:                            Platform: Other                   |
+ |     Severity: Normal                   OS/Version: Other                   |
+ |     Priority: Other                     Component: Xalan                   |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: [EMAIL PROTECTED]                                     |
+ |  Reported By: [EMAIL PROTECTED]                                        |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ (Xalan 2.2.D9)
+ 
+ Hi,
+ 
+ I now, that there are enough bugs posted about position(), but I want to point
+ out a/the problem with easy code and don't now to which bug to attach this code:
+ 
+ XML:
+ 
+ <jix>
+   <package>
+     <class>
+       <innerclass>
+          ....
+       </innerclass>
+     </class>
+   </package>
+ </jix>
+ XSL:
+ Matched on the innerclass.
+ 
+ <xsl:for-each select="ancestor-or-self::*[position() > 2]">
+   <xsl:message>
+     <xsl:value-of select="concat(name(),':',position())"/>
+   </xsl:message>
+ </xsl:for-each>
+ Without the [position() > 2], I get the following correct output:
+ 
+ jix:1
+ package:2
+ class:3
+ innerclass:4
+ But with it, I get:
+ 
+ jix:1
+ package:2
+ 
+ With [position <= 2] I get:
+ 
+ class:1
+ innerclass:2
+ 
+ So there is the error in counting the nodes FROM WHERE. Within the [] there is
+ another (a wrong one) counting of the nodes than in the <xsl:for-each>.
+ 
+ Hope, this helps.
+ 
+ Joerg

Reply via email to