Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2005, 08:58 AM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I check for duplicate entries in XML

Hi All,
       I am have the following XML :

       <books>
         <title>complete refrence</title>
         <title>XSLT</title>
         <title>JAVA</title>
         .
         <books>
           <title></title>
           <title></title>
           .
         </books>
       </books>

Now I need to make a new XML using the above XML (using XSL)

   <books>
     <title>title1</title>
     ...
   </books>

   such that if a title in /books is also present in a title in books/books then I will not include it in the final XML.
In short I want to remove the duplicate entries , and I have to include all the titles from books/books.

please help me , i am stuck at this
Thanks in advance


 
Old December 22nd, 2005, 09:12 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Usually when people talk about removal of duplicates, you're looking at grouping techniques, and the answer is http://www.jenitennison.com/xslt/grouping

Here I think you're doing something different. Your description of the problem is a bit confusing, but I think you're just looking for

/books/books/title[not(. = /books/title)]



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old December 22nd, 2005, 01:00 PM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Michael !!!
It works:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing duplicate entries avantikad XSLT 2 January 2nd, 2008 12:29 PM
Validate duplicate Entries using javascript sams ASP.NET 1.0 and 1.1 Professional 3 July 2nd, 2007 03:31 AM
How not to retrieve duplicate entries? EricTheViking Access ASP 2 January 12th, 2007 08:22 AM
Random Duplicate Entries SaraJaneQ Classic ASP Databases 6 July 16th, 2006 10:47 PM
Delete duplicate entries from table expertcalling SQL Server 2000 2 January 2nd, 2005 11:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.