From: Edward K. <edw...@gm...> - 2008-11-10 14:44:58
|
Hi, Before I begin, I would like to thank the authors of this software for creating a much needed piece of code! My question is that I am using the RecursiveElementNameAndTextQualifier and I noticed that if I try to compare 2 documents with one change in the child nodes, then this qualifier works. However, I if I swap > 1 nodes, this qualifier seems to fail. I have attached 2 xml docs (the test doc has 2 nodes swapped from the control doc). My code is: // don't care about ordering or comments, etc XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); // get the differences StringBuilder sb = new StringBuilder(); // getControlXML & getTestXML get the attached docs DetailedDiff myDiff = new DetailedDiff(new Diff(getControlXML(), getTestXML())); // override the qualifier because I don't care about child order myDiff.overrideElementQualifier(new RecursiveElementNameAndTextQualifier()); List<Difference> differences = myDiff.getAllDifferences(); for (Difference d : differences) sb.append(d.toString() + "\n"); System.out.println(sb.toString()); Am I doing something wrong? Also, I have a second question. If I use the RecursiveElementNameAndTextQualifier, should I file and place it in my project, or is that file guaranteed to persist? Thanks a lot! Eddie |