I have the following XML:
And I want to remove the duplicate records from the XML that contain the same <TITLE> and <ARTIST> elements so that I end up with the following XML output:
The expected output works when I use the following stylesheet on the XML and transform it using XML Spy:
However when I pass this transformation to my
Java code, the duplicates are removed however the last record within my XML is also removed. I have tried this with different XML files and it always removes the duplicates along with the last record - I have no idea why the last record is also being removed.
My Java code is as follows:
Has anyone got any idea as to why when I transform the XML using XMLSpy it works but when I transform the XML using my Java code the last record is being removed?
Thanks in advance