This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Removing duplicates - grouping problem
- To: <xsl-list at mulberrytech dot com>
- Subject: Re: Removing duplicates - grouping problem
- From: "Raffaele Sena" <raff at aromatic dot org>
- Date: Wed, 18 Oct 2000 11:33:32 -0700
- References: <200010181714.NAA11536@dlb1.nlm.nih.gov>
- Reply-To: xsl-list at mulberrytech dot com
> 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