473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to remove duplicate records.

Hi

I am new to xslt. Could you please tell me, how can we remove duplicate records from a xml file.

Here is the xml file:

<Row>
<Cell><Data>Active</Data></Cell>
<Cell><Data>D</Data></Cell>
<Cell><Data>1</Data></Cell>
<Cell><Data>2</Data></Cell>
</Row>
<Row>
<Cell><Data>Rtd</Data></Cell>
<Cell><Data>B</Data></Cell>
<Cell><Data>3</Data></Cell>
<Cell><Data>3</Data></Cell>
</Row>
<Row>
<Cell><Data>Active</Data></Cell>
<Cell><Data>D</Data></Cell>
<Cell><Data>1</Data></Cell>
<Cell><Data>2</Data></Cell>
</Row>
<Row>
<Cell><Data>Active</Data></Cell>
<Cell><Data>D</Data></Cell>
<Cell><Data>5</Data></Cell>
<Cell><Data>5</Data></Cell>
</Row>

Output xml file should only include unique records.

As first and third <Row>....</Row> are exactly same so it should come one time in report.

Here is the desired output.

output.xml

<Row>
<Cell><Data>Active</Data></Cell>
<Cell><Data>D</Data></Cell>
<Cell><Data>1</Data></Cell>
<Cell><Data>2</Data></Cell>
</Row>
<Row>
<Cell><Data>Rtd</Data></Cell>
<Cell><Data>B</Data></Cell>
<Cell><Data>3</Data></Cell>
<Cell><Data>3</Data></Cell>
</Row>
<Row>
<Cell><Data>Active</Data></Cell>
<Cell><Data>D</Data></Cell>
<Cell><Data>5</Data></Cell>
<Cell><Data>5</Data></Cell>
</Row>

Please advice me a xslt solution for this.

Thanks,
Sachin
Aug 14 '07 #1
1 3458
jkmyoung
2,057 Expert 2GB
Please see the TopXml answer.
Aug 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Patrick G. | last post by:
Greetings all: ASP VB, SQL Svr 2000 I am pulling data from 3 tables. table1 holds item details table2 holds publication types and the item id from table1 table3 holds category types and...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
1
by: Nicolae Fieraru | last post by:
Hi All, I have a table with the following information: ID, Name, Address, Field4 In this table it happens to have duplicate records with identical Name and Address but different content in...
1
by: guoqi zheng | last post by:
I have a dataset with about 20-50 records on it. Some of has the same value for a key column, those duplicates need to be removed. How can I remove duplicate itmes from a dataset???? I know...
2
by: nethravathy | last post by:
Hi, The following table namely elcbtripselect contains 5147 records.I want to know wether this table contains duplicate records or not. I tried with following query 1)SELECT...
8
natalie99
by: natalie99 | last post by:
hi everyone i have reseached this topic and cannot seem to find a solution that suits my problem, please help!! I have two tables, "Inventory" which contains 30,000 or so records, with about...
2
by: nomvula | last post by:
hi guys i need some help to duplicate records on my form datasheet: here's the example of my form results: ClientLookup DateCaptured ForecastDate Description ForecastQuantity Forecast Actual UJ...
1
by: ZAVILA | last post by:
This is the SQL code for starters. SELECT DISTINCTROW .CYCLE_DATE, .SERIES_NBR, .SERVICER_NBR, .SERVICER_NAME, .SERVICER_LOAN_NBR, .LOAN_NBR, .INTERNAL_LOAN_ID, .ARCC_LOAN_NBR, .LIEN_STATUS_CODE,...
1
by: xraive | last post by:
I have a problem with this. Currently I am trying Allen's code and i am not successful. Current Design Table1 (Main Form) TravelID (PK) ApprovedBY EntreredBy BudgetCode ExpenseCode
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.