[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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@xxxxxxxxxxxx (::) http://www.aromatic.org/~raff/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|