Remove Duplicate Nodes
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Wed Sep 24, 2014 5:44 pm
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!
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!
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service