File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XML Diff Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "XML Diff" Watch "XML Diff" New topic
Author

XML Diff

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 383
Is it possible to compare 2 XMLs and get difference out with the help of XSLT?

For instnace
XML1
<Employees>
<Employee>
<Id>101</Id>
<Name>John</Name>
<Employee>
<Employee>
<Id>102</Id>
<Name>Rambo</Name>
<Employee>
<Employees>


XML2
<Employees>
<Employee>
<Id>101</Id>
<Name>John</Name>
<Employee>
<Employee>
<Id>103</Id>
<Name>Brett</Name>
<Employee>
<Employees>

XMLDiff
<Employees>
<Employee>
<Id>101</Id>
<Name>John</Name>
<Employee>
<Employee>
<Id>102</Id>
<Name>Rambo</Name>
<Employee>
<Employee>
<Id>103</Id>
<Name>Brett</Name>
<Employee>
<Employees>

Any suggestions?

Thanks,



SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

I wouldn't call the third document the "difference" of the first two. I'm not exactly sure how you would display the difference, but that isn't it. It's more like the union of the two documents. So you might want to clarify your requirements before looking for implementations of those requirements.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: XML Diff
 
Similar Threads
Datatable with scrollbar in JSF
Querying Based On Member of Contained Collection
how to show an Attribute value in XSL ?
Use a SAX Parser to split huge XML file into multiple parts, also need to keep the hierarchy intact
XSLT Remove Node by Attribute