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

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Xmlunit-general mailing list
Xmlunit-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to