This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: comparing 2 xml strings
 
jQuery in Action, 3rd edition