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 May 7th, 2014, 06:06 PM
Authorized User
 
Join Date: May 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Identify if the repeating list is duplicate only if certain elements are same

Hi ,

The input xml contains a list "lineitems". I want to identify if there any duplicate elements in the lineitems list. The key for the unique element is a combination of 3 elements ,

<EmpNumber>
<dataSource>
<lineOfBusiness>

Input XML

<Root>
<totalAmount>10.00</totalAmount>
<sourcePhoneNumber/>
<lineItems>
<lineItem>
<sequenceNumber>1</sequenceNumber>
<amount>10.00</amount>
<amountFor>10.00</amountFor>
<isCashSweep>false</isCashSweep>
<EmpInfo>
<EmpNumber>138394</EmpNumber>
<dataSource>DEF</dataSource>
<lineOfBusiness>PC</lineOfBusiness>
<type>PA</type>
<zipCode>95136</zipCode>
</EmpInfo>
<lineItemExtension/>
</lineItem>
<lineItemsExtension/>
</lineItems>
<lineItems>
<lineItem>
<sequenceNumber>1</sequenceNumber>
<amount>10.00</amount>
<amountFor>10.00</amountFor>
<isCashSweep>false</isCashSweep>k
<EmpInfo>
<EmpNumber>227314</EmpNumber>
<dataSource>ABC</dataSource>
<lineOfBusiness>PC</lineOfBusiness>
<type>PA</type>
<zipCode>95136</zipCode>
</EmpInfo>
<lineItemExtension/>
</lineItem>
<lineItemsExtension/>
</lineItems>
<lineItems>
<lineItem>
<sequenceNumber>1</sequenceNumber>
<amount>10.00</amount>
<amountFor>10.00</amountFor>
<isCashSweep>false</isCashSweep>k
<EmpInfo>
<EmpNumber>227314</EmpNumber>
<dataSource>ABC</dataSource>
<lineOfBusiness>PC</lineOfBusiness>
<type>PA</type>
<zipCode>95136</zipCode>
</EmpInfo>
<lineItemExtension/>
</lineItem>
<lineItemsExtension/>
</lineItems>
</
Root>


Expected Output

Returns True or the duplicate nodeset if the lineitems list contains same values for elements
<EmpNumber>,<dataSource>,<lineOfBusiness> .


Regards,
Arun





Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate output of Strong tag in nested list Help Laza XSLT 1 July 15th, 2013 03:12 AM
removing duplicate elements and collecting all sub nodes together john007 XSLT 1 March 9th, 2012 05:09 PM
XSLT logic for repeating child elements within parent node Srinibondugula BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 5 November 8th, 2011 12:05 PM
duplicate global elements and refs dexter62 XML 2 December 8th, 2009 11:36 AM
Removing duplicate edge elements geoGregory3 XSLT 2 February 27th, 2008 06:08 AM





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