[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|