This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Removing duplicates - grouping problem


>  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@aromatic.org (::) http://www.aromatic.org/~raff/


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]