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 comparing 2 xml strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "comparing 2 xml strings" Watch "comparing 2 xml strings" New topic
Author

comparing 2 xml strings

Tina Ang
Ranch Hand

Joined: Mar 12, 2002
Posts: 58
Hello! I just would like to ask if there is any tool I could use to compare 2 xml strings. The tool must identify the differences between the 2 xml string: nodes that have been added, deleted, updated, etc. Please help. Thanks a lot.
Tina Ang
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Tina Ang:
Hello! I just would like to ask if there is any tool I could use to compare 2 xml strings. The tool must identify the differences between the 2 xml string: nodes that have been added, deleted, updated, etc. Please help. Thanks a lot.
Tina Ang

Seems like you have to write your own... this link would give you some tips from xslt point of view.
IMHO


Spritle Software Blogs
Tina Ang
Ranch Hand

Joined: Mar 12, 2002
Posts: 58
Thanks! However, I need to compare the 2 xml strings from the backend and not using xslt. Do you have other suggestions?! thanks a lot!
TINA
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
You might want to check if one of these would help:
http://www.alphaworks.ibm.com/tech/xmldiffmerge
http://www.xmlhack.com/read.php?item=1486
http://www.cs.wisc.edu/~yuanwang/xdiff.html
http://diffxml.sourceforge.net
http://www.deltaxml.com (commercial)
Also, a viable alternative would be to use the Diff class from XMLUnit.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: comparing 2 xml strings