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 2002/02/09 00:01:48 UTC

DO NOT REPLY [Bug 6337] New: - XPath skipping nodes in expression looking for unique values

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6337>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

XPath skipping nodes in expression looking for unique values

           Summary: XPath skipping nodes in expression looking for unique
                    values
           Product: XalanJ2
           Version: 2.2.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: org.apache.xpath
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: mark@ssglimited.com


The following XPath expression is skipping nodes: 

select="//colData[@colId='F' and not(.=preceding::colData)]"

The XSL file, below, should make $flights= {"1","2"}, but it contains {"1"} -- 
when using the XML example file shown below.

EXAMPLE XSL FILE:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

   <xsl:variable name="flights" select="/report/colData[@colId='F' and not
(.=preceding::colData)]"/>

<xsl:template match="/report">
<html>
<body>
	<xsl:for-each select="$flights">
             <xsl:value-of select="." /><br />
	</xsl:for-each>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

EXAMPLE XML DOCUMENT:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="broken.xsl"?>
<report>
  <colData colId="F">1</colData>
  <colData colId="L">5</colData>
  <colData colId="F">1</colData>
  <colData colId="L">5</colData>
  <colData colId="L">2</colData> <!-- If you delete this line it works -->
  <colData colId="F">2</colData> 
  <colData colId="L">5</colData>
  <colData colId="F">2</colData>
</report>