[xsl] xsl filtering duplicate nodes

Subject: [xsl] xsl filtering duplicate nodes
From: Tom Melkonian <melkonian@xxxxxxxxxxx>
Date: Wed, 28 Mar 2001 08:56:35 -0800
Hi .. I'll try again since my lst message was sent prematurely

I am trying to figure out how to filter out duplicate nodes in an XML source
document with an XSL stylesheet.
They look like this:

<Reference id="123" name="food" found="name" />
<Reference id="124" name="muscle" found="note" />
<Reference id="125" name="fat" found="name" />
<Reference id="123" name="food" found="name" />
<Reference id="123" name="food" found="note" />
<Reference id="123" name="food" found="desc" />
<Reference id="123" name="food" found="name" />

I need to filter out only those nodes which have identical @id and @found
attributes, or nodes which are exact duplicates of preceding nodes, so in
this example, it should come out like:

<Reference id="123" name="food" found="name" />
<Reference id="124" name="muscle" found="note" />
<Reference id="125" name="fat" found="name" />

<Reference id="123" name="food" found="note" />
<Reference id="123" name="food" found="desc" />

(filtering out the 4th and 6th node in the list)
the two duplicates of the first node should not be processed. Any
suggestions on how to do this? These nodes have no actual content, just
attributes. 

Thanks

Tom

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


Current Thread