Re: [xsl] avoiding repeated items

Subject: Re: [xsl] avoiding repeated items
From: cutlass <cutlass@xxxxxxxxxxx>
Date: Thu, 01 Mar 2001 18:42:15 +0000
not to be a url pusher .....

in general this will say,

a) find all <autor> elements and put the resulant tree in a variable, with a filter getting rid of duplicates ( something like the following )

<xsl:variable name="uniquelist" select="//autor[not(.=following::autor)]"/>

you may have a problem with some parsers, most recent version of sablotron has a problem with these types of xpaths.

cheers, jim

Aniceto López wrote:

simple question: how to avoid repeated elements?
in a xml file like this
  <autor>arcipreste de hita</autor>

<xsl:variable name="uniquelist" select="//autor[not(.=following.autor]"> <xsl:for-each select="$uniquelist"> <xsl:value-of select="."/> </xsl:for-each>

XSL-List info and archive:

Current Thread