From: Stefan B. <bo...@ap...> - 2011-02-24 09:22:12
|
On 2011-02-24, Johannes.Lichtenberger wrote: > I'm currently searching an XML diff implementation which creates minimal > edit scripts, but I'm not familiar with the sources of XMLUnit. I think > XMLUnit must have implemented such an algorithm!? Not really (it doesn't really strive for minimal). > If so can someone point me to the main algorithm used -- and the > concrete class(es)? The diff algorith used in the released versions is in <http://xmlunit.svn.sourceforge.net/viewvc/xmlunit/branches/xmlunit-1.x/src/java/org/custommonkey/xmlunit/DifferenceEngine.java?view=log> A complete re-implementation is in trunk that will end up being XMLUnit 2.0 it I ever get my act together: Java <http://xmlunit.svn.sourceforge.net/viewvc/xmlunit/trunk/xmlunit/src/main/java-core/net/sf/xmlunit/diff/DOMDifferenceEngine.java?view=log> and C# <http://xmlunit.svn.sourceforge.net/viewvc/xmlunit/trunk/xmlunit/src/main/net-core/diff/DOMDifferenceEngine.cs?view=log> All of them are purely DOM based and some aspect of it (the ElementQualifier/NodeMatcher parts) would be pretty complex to do with SAX or a pull parser setup. The alogithms themselves don't really use DOM but could work for any tree structure. Stefan |