Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Filtering dupes

From: JeD@-----------.---------.---
To: NULL
Date: 10/3/2004 10:27:00 PM
Can someone help me write the appropriate xsl transformation to output a xml 
document where duplicates have been filtered out. In my input document, two 
"rows" are duplicates if they use the same unique identifier field (as 
determined by an attribute called 'uniqueidfield') and the value in this 
field is the same. In the following example, there are two duplicate accounts 
with the accountid 'ABC' but there is also a contact with the same id. The 
output document should contain one of the two 'ABC' accounts (I don't really 
care which one) and it should also containt the 'ABC' contact.

Input:
<resultset>
  <result uniqueidfield="accountid"><accountid>abc</accountid><name>abc 
corp.</name></result>
  <result uniqueidfield="accountid"><accountid>def</accountid><name>def 
ltd.</name></result>
  <result uniqueidfield="accountid"><accountid>abc</accountid><name>abc 
corp. 2</name></result>
  <result uniqueidfield="contactid"><countactid>abc</contactid><name>John 
Smith</name></result>
<resultset>

Desired output:
<resultset>
  <result uniqueidfield="accountid"><accountid>abc</accountid><name>abc 
corp.</name></result>
  <result uniqueidfield="accountid"><accountid>def</accountid><name>def 
ltd.</name></result>
  <result uniqueidfield="contactid"><countactid>abc</contactid><name>John 
Smith</name></result>
<resultset>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent