Re: [xsl] Find distinct nodes from a sequence

Subject: Re: [xsl] Find distinct nodes from a sequence
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 7 Jul 2011 09:15:18 +0100
On 7 July 2011 09:05, Pushkar Khadilkar
<Pushkar_Khadilkar@xxxxxxxxxxxxxxxx> wrote:
> Hi List,
>
> I have a function getNodes() that returns a sequence of nodes( >= 1) from
source tree by xsl:sequence statement.
>
> I want to remove duplicate nodes from this sequence.
>
> The duplicate nodes in the sequence are not different nodes from source tree
with same values for some attributes but actually refer to same node in source
tree.
>
> For example , Consider following tree
>
> <person name=a/>
> <person name=b/>
>
> The function getNodes() might return a sequence containing 2 nodes both of
which refer to same node (<person name=a/>) of the source tree.

Group them by their generated id:

<xsl:for-each-group select="$seq" group-by="generate-id(.)">




--
Andrew Welch
http://andrewjwelch.com

Current Thread