Re: Removing duplicates - grouping problem

Subject: Re: Removing duplicates - grouping problem
From: "Raffaele Sena" <raff@xxxxxxxxxxxx>
Date: Wed, 18 Oct 2000 11:33:32 -0700
>  I have tried variations of the Stylesheet with no luck.  The present
>  stylesheet gives me grouped and sorted.  Help get rid of the duplicates.
>  Hopefully this is a easy one for the pros on this mailing-list.
>  Why does the 'not condition' in my select not take care of the duplicates.
>
    Hmmm, I changed the <for-each> statement a little, with an <if> to check
    for duplicates. Still doesn't work, but maybe it will help to figure out
    what is going on (I would have thought the for-each would return a
node-list
    of <sab> elements, but according to the messages that get printed out, the
    elements do not seem to be at consecutive positions ):

xsl:template match="term">
    <xsl:text> Synonym: </xsl:text>
    <xsl:value-of select="tn"/><br/>
    Source: <br/>
    <xsl:for-each select="termVariant/strSource/sab">
      <xsl:sort select="."/>
        <xsl:variable name="prev" select="position()-1"/>
prev:<xsl:value-of select="$prev"/> <xsl:value-of
select="../sab[position()=$pre
v]"/>
curr:<xsl:value-of select="position()"/> <xsl:value-of select="."/>
        <xsl:if test=".=../sab[position()=$prev]">
                ' SAME '
        </xsl:if>
        <xsl:value-of select="."/><br/>
    </xsl:for-each>
</xsl:template>

    Anyway, hope this help!

-- Raffaele

-----------------------------------------------------
raff@xxxxxxxxxxxx (::) http://www.aromatic.org/~raff/


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


Current Thread