I need to eliminate duplicate elements from my XML using a specific node (ItemID)
My XML Looks as follows;
I. XSLT 1.0 solution:
Here is a solution using Muenchian grouping:
Do Note:
Muenchian grouping is the most efficient known general grouping method for XSLT 1.0.
Pure "push" style used.
II. XSLT 2.0 solution:
Both solutions, when applied on the provided XML document:
Waltons
CAP600795SI
20100506
723073
02
Pentel LR7 Energel Metal Tip Refill 0.7mm
WRITING INSTRUMENTS
Refill
1.0000000
6.0000000
10.0200000
8.4200000
60.1200000
Black
EA
0.0000000
CAP5637542_060
Waltons
CAP600795SI
20100506
903420
STEPHENS JUNIOR Stapler Half Strip KW586
OFFICE SUNDRIES
Staplers
2.0000000
3.0000000
32.2500000
13.5400000
96.7500000
Ea
0.0000000
CAP5637547_060
Waltons
CAP600795SI
20100506
867241
TRODAT PRINTY S/Inking Stamp Copy 4911
STAMPS DATERS NUMBERERS
Self Inking Stamps
3.0000000
1.0000000
42.1500000
5.9000000
42.1500000
Ea
1.0000000
CAP5637548_060
Waltons
CAP600795SI
20100506
941151
PENTEL Correction Tape 5mx5mm ZT35
OFFICE SUNDRIES
Correction Fluid/Pens/Tape
4.0000000
2.0000000
25.1500000
7.0400000
50.3000000
Ea
0.0000000
CAP5637549_060
Waltons
CAP600795SI
20100506
801215
MONDI ROTATRIM Copy Paper A4 80Gsm White
A4 Paper
White Bond Paper
5.0000000
100.0000000
29.0100000
406.1400000
2901.0000000
Pkt 500
0.0000000
CAP5637552_060
CAP716197SO
CAP600795SI
2010/05/06
2.0000000
805236
CAP0000594_061
Ruled Paper A4 Fnt/Marg JD76
2010/05/06
CAP5637543_060
4.0000000
4.0000000
4.0000000
4.0000000
EA
CAP716197SO
wal
622392608
1
CAP716197SO
CAP600795SI
2010/05/06
3.0000000
941150
CAP0000594_061
PENGUIN Correction Fluid 20ml White
2010/05/06
CAP5637546_060
6.0000000
6.0000000
6.0000000
6.0000000
EA
CAP716197SO
wal
622392609
1
CAP716197SO
CAP600795SI
2010/05/06
5.0000000
867241
CAP0000594_061
TRODAT PRINTY S/Inking Stamp Copy 4911
2010/05/06
CAP5637548_060
2.0000000
2.0000000
1.0000000
1.0000000
EA
CAP716197SO
wal
622392610
1
produce the wanted, correct result:
Waltons
CAP600795SI
20100506
723073
02
Pentel LR7 Energel Metal Tip Refill 0.7mm
WRITING INSTRUMENTS
Refill
1.0000000
6.0000000
10.0200000
8.4200000
60.1200000
Black
EA
0.0000000
CAP5637542_060
Waltons
CAP600795SI
20100506
903420
STEPHENS JUNIOR Stapler Half Strip KW586
OFFICE SUNDRIES
Staplers
2.0000000
3.0000000
32.2500000
13.5400000
96.7500000
Ea
0.0000000
CAP5637547_060
Waltons
CAP600795SI
20100506
867241
TRODAT PRINTY S/Inking Stamp Copy 4911
STAMPS DATERS NUMBERERS
Self Inking Stamps
3.0000000
1.0000000
42.1500000
5.9000000
42.1500000
Ea
1.0000000
CAP5637548_060
Waltons
CAP600795SI
20100506
941151
PENTEL Correction Tape 5mx5mm ZT35
OFFICE SUNDRIES
Correction Fluid/Pens/Tape
4.0000000
2.0000000
25.1500000
7.0400000
50.3000000
Ea
0.0000000
CAP5637549_060
Waltons
CAP600795SI
20100506
801215
MONDI ROTATRIM Copy Paper A4 80Gsm White
A4 Paper
White Bond Paper
5.0000000
100.0000000
29.0100000
406.1400000
2901.0000000
Pkt 500
0.0000000
CAP5637552_060
CAP716197SO
CAP600795SI
2010/05/06
2.0000000
805236
CAP0000594_061
Ruled Paper A4 Fnt/Marg JD76
2010/05/06
CAP5637543_060
4.0000000
4.0000000
4.0000000
4.0000000
EA
CAP716197SO
wal
622392608
1
CAP716197SO
CAP600795SI
2010/05/06
3.0000000
941150
CAP0000594_061
PENGUIN Correction Fluid 20ml White
2010/05/06
CAP5637546_060
6.0000000
6.0000000
6.0000000
6.0000000
EA
CAP716197SO
wal
622392609
1