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 September 24th, 2014, 09:06 AM
Registered User
 
Join Date: Sep 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remove Duplicate Nodes

Dear All,

I have an XML file which contains duplicates node for a single ID. I would like to compare 2 particular field values from both these nodes and based on the result, I would like to print only one node in output. Please find the below XML File.

*********************************************
<?xml version="1.0" encoding="utf-8"?>
<File>
-<Data>
-<Summary>
<ID>123456</ID>
<Name>James Bond_Old</Name>
</Summary>
-<Information>
<End_Date>2014-08-31</End_Date>
</Information>
</Data>
-<Data>
-<Summary>
<ID>654321</ID>
<Name>Wolverine</Name>
</Summary>
-<Status>
<Current_Status >Active</Current_Status>
<Begin_Date >2014-09-01</Begin_Date>
</Status>
</Data>
-<Data>
-<Summary>
<ID>123456</ID>
<Name>James Bond_New</Name>
</Summary>
-<Status>
<Current_Status >Active</Current_Status>
<Begin_Date >2014-09-01</Begin_Date>
</Status>
</Data>
</File>

************************************************** ******

In the above sample, there are 2 nodes for the ID "123456". In this case, I need to compare the values of "Information/End_Date" of first Node and "Status/Begin_Date" of 2nd Node. If "Begin_Date" is greater than "End_Date", pass the first Node, else vice versa.

Could you please help me!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting rid of Duplicate nodes sureshvadali XSLT 11 August 3rd, 2012 11:58 AM
removing duplicate nodes nguna XSLT 6 February 16th, 2009 10:40 AM
How to remove duplicate row from sheet ketannsharma Excel VBA 1 February 18th, 2007 03:32 AM
Duplicate nodes get the value from first node dev.user06 XSLT 6 August 8th, 2006 11:33 AM





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