This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Removing duplicates from a branch
- To: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] Removing duplicates from a branch
- From: John Geering <John dot Geering at pharmac dot govt dot nz>
- Date: Mon, 30 Jul 2001 11:25:37 +1200
- Reply-To: xsl-list at lists dot mulberrytech dot com
I want to suppress elements that are copies of any earlier in the document
-- but only where they are in the same branch:
Using the following fragment:
<Request>
<Case Category="1">
<ci>A</ci>
<ci>B</ci>
</Case>
<Case Category="2">
<ci>A</ci>
<ci>C</ci>
<ci>C</ci>
</Case>
</Request>
I want:
A and B from Case 1 and A and C (only one C) from case 2
Using something like <xsl:apply-templates
select=".//ci[not(.=preceding::ci)]"> I get:
A and B from Case 1 and only one C from case 2 (but I still want the A
from Case 2).
I can't seem to find any way of restricting the scope of "preceding" to a
particular branch.
Does anyone have any ideas?
Thanks
John Geering
John Geering
? 04 460 4972 ? PO Box 10254 Wellington
mailto:John.Geering@Pharmac.govt.nz
This message contains information that is confidential and which may be
subject to legal privilege. If you are not the intended recipient, you must
not peruse, use, disseminate, distribute or copy this message. If you have
received this message in error, please notify us immediately by facsimile or
telephone (call us collect) and return the original message to us by mail.
Thank you.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list