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

*** shadow/3349 Wed Aug 29 14:27:55 2001
--- shadow/3349.tmp.6403        Wed Aug 29 14:27:55 2001
***************
*** 0 ****
--- 1,90 ----
+ +============================================================================+
+ | Wildcard in xpath sometimes skips nodes.                                   |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 3349                        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                                   |
+ When a variable is assigned by an xpath with a wildcard in it, sometimes the
+ node set is missing branches that should have been matched by the wild card.
+ 
+ Following is xslt that uses recursion to traverse a node set, printing the
+ values of the nodes:
+ 
+ XSLT:
+ 
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+       <xsl:template match="/">
+ Values
+       <xsl:call-template name="traversevals">
+                               <xsl:with-param name="pos" select="1"/>
+               </xsl:call-template>
+       </xsl:template>
+ 
+       <xsl:template name="traversevals">
+               <xsl:param name="pos"/>
+ 
+               <xsl:variable name="series" select="/data/*/datum/@value"/>
+ 
+               <xsl:if test="number($pos) &lt; count($series)">
+                       <xsl:value-of select="concat($series[number($pos)], ' ')"/>
+                       <xsl:for-each select="$series">
+                               <xsl:if test="position() = number($pos)">
+                                       <xsl:variable name="current" 
+select="position()"/>
+                                       <xsl:call-template name="traversevals">
+                                               <xsl:with-param name="pos" 
+select="number($pos) + 1"/>
+                                       </xsl:call-template>
+                               </xsl:if>
+ 
+                       </xsl:for-each>
+               </xsl:if>
+       </xsl:template>
+ 
+ </xsl:stylesheet>
+ 
+ INPUT:
+ 
+ <data>
+       <foodata>
+               <datum value="1"/>
+               <datum value="2"/>
+               <datum value="3"/>
+               <datum value="4"/>
+       </foodata>
+       <bardata>
+               <datum value="5"/>
+               <datum value="6"/>
+               <datum value="7"/>
+               <datum value="8"/>
+       </bardata>
+       <bazdata>
+               <datum value="9"/>
+               <datum value="10"/>
+               <datum value="11"/>
+               <datum value="12"/>
+       </bazdata>
+ </data>
+ 
+ EXPECTED RESULTS (produced by xt):
+ 
+ <?xml version="1.0" encoding="utf-8"?>
+ 
+ Values          1 2 3 4 5 6 7 8 9 10 11
+ 
+ ACTUAL RESULTS (produced by translet):
+ 
+ <?xml version="1.0" encoding="utf-8" ?>
+ 
+ Values          5 6 7 8 9 10 11
+ 
+ 
+ ...Note that the contents of the "foodata"  branch of the input is missing.

Reply via email to