This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Removing duplicates from a branch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]