From: Stefan B. <bo...@ap...> - 2010-10-08 04:35:31
|
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 |