normalize as part of a 'select-distinct' in a for-each?

Subject: normalize as part of a 'select-distinct' in a for-each?
From: "Clark C. Evans" <clark.evans@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 3 Oct 1999 13:50:27 -0400 (EDT)
I modified David Carlisle's example (FAQ 2.4) to use 
normalize() since whitespace distinctions are not desired.
However, when I add normalize(), the stylesheet stops 
returning the expected "XYZ" and instead gives "XXXXYZZ" 
What am I doing wrong here?

Thanks in advance!

Clark 

... the stylesheet ...

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";
                xmlns:xt="http://www.jclark.com/xt";
                extension-element-prefixes="xt">
  <xsl:template match="root">
    <xsl:for-each select="//c[not(normalize(text())
                          =normalize(following::c/text()))]" >
      <xsl:sort order="ascending" select="." />
      <xsl:value-of select="." />
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

.... the input file ...

<?xml version="1.0"?>
<root>
  <a>   
    <b id="101" >
      <c>X</c>
    </b>
    <b id="102" >
      <c>Y</c>
    </b>
    <b id="103" >
      <c>X</c>   
    </b>
    
    <b id="104" >
      <c>Z</c>
    </b>
      
    <b id="105" > 
      <c>Z</c> 
    </b>
    
    <b id="106" >
      <c>Z</c>
    </b>
  </a>
    
  <a>
    <b id="201" >
      <c>X</c>
    </b>
      
    <b id="202" >
      <c>Z</c>
    </b>
      
   </a> 
      
   <a>
     <b id="301" >
       <c>X</c>
     </b>
    
     <b id="302">
       <c>X</c>
     </b>
   </a>
</root>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread