On 2010-10-05, David Pesce wrote:

> I'm not sure exactly why, but DetailedDiff appears to be comparing
> different nodes between files.

For many use cases node order is not so significant and so XMLUnit
compares elements out of order if necessary.  For Diff you can solve
that by overriding the DifferenceListener with one that upgrades
CHILD_NODELIST_SEQUENCE differences to non-recoverable.  This will make
Diff stop once it detects elements out of order - it won't help with
DetailedDiff.

Make sure you set the compareUnmatched parameter to false.

> I've even tried setting the ElementQualifier to null in both the Diff
> and DetailedDiff:

The problem here is that XMLUnit 1.x will always attempt to match nodes
regardless of order.  If you set ElementQualifier to null it should
visit elements in correct order, unless there are other node types (like
emoty text nodes) between them that throws its comparison algorithm out
of step.

Can you provide two example documents and say what you'd expect XMLUnit
to return so we have something more concrete to talk about?

Stefan

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to