This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl filtering duplicate nodes
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] xsl filtering duplicate nodes
- From: Tom Melkonian <melkonian at entelos dot com>
- Date: Wed, 28 Mar 2001 08:56:35 -0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
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