The moose likes XML and Related Technologies and the fly likes XML canonicalization and Diff algorithm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML canonicalization and Diff algorithm" Watch "XML canonicalization and Diff algorithm" New topic

XML canonicalization and Diff algorithm

Sharika Raj

Joined: Aug 31, 2004
Posts: 26
Hi all,

As part of a testing i need to canonicalize xml doc and need to verify it using some diff algorithm.can someone refer some third party tool (jars) which i can use for this purpose?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12759
searching on google for "xml canonical form" produced a long list of projects, W3C documentation, etc.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
XMLUnit might be helpful.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Juan Rolando Prieur-Reza
Ranch Hand

Joined: Jun 20, 2003
Posts: 235
Originally posted by Lasse Koskela:
XMLUnit might be helpful.

That should solve the problem for any Pass/Fail testing.

I would add that if you need to measure degree of similarity, the problem is difficult. See XDiff http://www.cs.wisc.edu/niagara/papers/xdiff.pdf .

The general problem is really difficult. See http://citeseer.ist.psu.edu/cache/papers/cs/17263/http:zSzzSzcs.nyu.eduzSzcszSzfacultyzSzcolezSzpaperszSzCHI99.pdf/cole00tree.pdf

Juan Rolando Prieur-Reza, M.S., LSSBB, SCEA, SCBCD, SCWCD, SCJP/1.6, IBM OOAD, SCSA
It is sorta covered in the JavaRanch Style Guide.
subject: XML canonicalization and Diff algorithm
Similar Threads
how to compare two xml files?
Namespaces in XML
PLZ URGENT: word by word comparison for XML data
methods in throwable class
Compare Two DOM Objects