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

Re: Remove duplicates using preceding- or following-s

Subject: Re: Remove duplicates using preceding- or following-siblings
From: Satish <p.satishchandra@xxxxxxxxx>
Date: Mon, 2 Apr 2012 23:28:25 +0530
Re:  Remove duplicates using preceding- or  following-s
Thanks a lot everyone. I apologize for the sample - the actual data I
have is quite complex and proprietary; I was denied permission to
share it in public domain. Hence the not-so-good sample.

We are on XSLT 1.0, running Apache's XalanJ 2.7.

I was able to remove the duplicates later on using my xsl variable
($authorList in the sample) in the following way

<xsl:for-each select="$authorList/LibraryBook[not(@authId =
preceding-sibling::LibraryBook/@authId)]">
    <!-- unique books only -->
</xsl:for-each>

But now I found that there was a costly operation (not in sample) on
each of the <LibraryBook> node written to my xsl variable; so was
trying to avoid writing multiple <LibraryBook> nodes, do the costly
operation and then later on remove duplicates. I wondered if there was
somehow a way to access the nodes already written/generated so that I
could write just the ones that are unique.

The reason I said that I could not remove duplicates by checking for
the 'book' nodes is because we use an extension (Java obviously) that
returns the 'book' node. Although it is from the same XML, we get it
via an extension after some geometry related processing.

I apologize again - all this doesn't help without a working sample.
I'll try to get a sample working.

I honestly thank everyone for their helpful answers. I can't appreciate more.

Thanks
Satish

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.