You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/04/24 22:28:50 UTC

[Bug 1485] New - count(//node())" or count(//someaxis::node())" are returning false counts

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1485

*** shadow/1485	Tue Apr 24 13:28:50 2001
--- shadow/1485.tmp.19764	Tue Apr 24 13:28:50 2001
***************
*** 0 ****
--- 1,91 ----
+ +============================================================================+
+ | count(//node())" or count(//someaxis::node())" are returning false counts  |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1485                        Product: XalanJ2                 |
+ |       Status: NEW                         Version: 2.0.1                   |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version: Other                   |
+ |     Priority:                           Component: org.apache.xpath        |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xalan-dev@xml.apache.org                                     |
+ |  Reported By: pauldick@apache.org                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ The following stylesheet counts various types of nodes based on an XPATH 
+ expression starting with "//".  Xalan has several inconsistencies with both XT 
+ and Saxon on the returned counts. Note this might not be an exhaustive test, so 
+ if there are more axes to test please let me know.
+ 
+ Stylesheet:
+ <?xml version="1.0"?> 
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ 
+ <xsl:template match="/">
+   <summary>
+       <xsl:text>&#10;      </xsl:text>
+       <xsl:value-of select="count(//node())"/> "//node()" :
+       <xsl:value-of select="count(//self::node())"/> "//self::node()" :
+       <xsl:value-of select="count(//child::node())"/> "//child::node()" :
+       <xsl:value-of select="count(//child::node()/self::node
+ ())"/> "//child::node()/self::node()" :
+       <xsl:value-of select="count(//ancestor::node())"/> "//ancestor::node()" :
+       <xsl:value-of select="count(//ancestor-or-self::node())"/> "//aos::node
+ ()" :
+       <xsl:value-of select="count(//descendant::node())"/> "//descendant::node
+ ()" :
+       <xsl:value-of select="count(//descendant-or-self::node())"/> "//dos::node
+ ()" :
+       <xsl:value-of select="count(//following::node())"/> "//follow::node()" :
+       <xsl:value-of select="count(//following-sibling::node())"/> "//follow-
+ sib::node()" :
+       <xsl:value-of select="count(//preceding::node())"/> "//preceding::node
+ ()" :
+       <xsl:value-of select="count(//preceding-sibling::node())"/> "//preceding-
+ sib::node()" :
+       <xsl:value-of select="count(//attribute::node())"/> "//attribute::node
+ ()" :
+       <xsl:value-of select="count(//parent::node())"/> "//parent::node()" :
+       <xsl:value-of select="count(//.)"/> "//." :
+       <xsl:value-of select="count(//text())"/> text nodes,
+       <xsl:value-of select="count(//comment())"/> comment nodes,
+       <xsl:value-of select="count(//processing-instruction())"/> pi nodes,
+       <xsl:value-of select="count(//*/@*)"/> attributes.
+   </summary>
+       <!-- xsl:value-of select="count(//namespace::node())"/> "//namespace::node
+ ()" : -->
+ 
+ 	  <!-- xsl:for-each select="//node()">
+ 	  	<xsl:value-of select="name(.)"/>,
+ 	  </xsl:for-each 
+ 	  <xsl:text>&#10;</xsl:text> -->
+ </xsl:template>
+ 
+ </xsl:stylesheet>
+ 
+ XML Source:
+ <?xml version="1.0"?>
+ <?spi some_pi ?> <!-- Non-functional pi -->
+ <doc-element xmlns:xxx="http://www.bogus.com"
+ 			 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xxx:output encoding="utf-8" indent="yes"/>
+ <outer>
+ <foo name="bar" select="what">
+     <xxx:param/>
+     <xxx:with-param name="Column" select="0"/>
+ 	<?api another_pi ?> <!-- Another non-functional pi -->
+ </foo>
+ </outer>
+ </doc-element>
+ 
+ Inconsistencies are found with the following axes:
+       "count(//node())"/> 
+       "count(//self::node())"/> 
+       "count(//child::node())"/> 
+       "count(//child::node()/self::node())"/>
+       "count(//ancestor-or-self::node())"/> 
+       "count(//preceding::node())"/> 
+       "count(//preceding-sibling::node())"/> 
+       "count(//.)"/>