[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Find distinct nodes from a sequence

Subject: Find distinct nodes from a sequence
From: Pushkar Khadilkar <Pushkar_Khadilkar@xxxxxxxxxxxxxxxx>
Date: Thu, 7 Jul 2011 13:35:59 +0530
 Find distinct nodes from a sequence
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.

I cannot use some logic like  select node whose generate-id(.) is not equal
to generate-id(preceding-node) as the duplicate nodes actually refer to same
node of source tree and hence preceding wont work.

Im using Saxon HE 8.8 Java.

Is there a function for selecting unique nodes from a sequence ?

There was a saxon:distinct function in older versions of saxon but is not
present in Saxon 8.

Any help in this regard is highly appreciated.

Thanks ,
Pushkar Khadilkar

DISCLAIMER
==========
This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Ltd. It is intended
only for the use of the individual or entity to which it is addressed. If you
are not the intended recipient, you are not authorized to read, retain, copy,
print, distribute or use this message. If you have received this communication
in error, please notify the sender and delete all copies of this message.
Persistent Systems Ltd. does not accept any liability for virus infected
mails.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.