On 2011-09-16, Rajesh Ajjarapu wrote:

> I am using these two classes to ignore the nodes for comparision in xml
> unit. I am unsuccessful still to eliminate the element with City.

I'm sorry, but your code snippets are more or less unreadable.  Any
chance you can strip them down to the essentials and get rid of all
formatting?

You seem to have pasted the xmlUnitutility class twice but didn't paste
the Ignoreelement class.

> Ignoreelement ie = new Ignoreelement(ignore);

> Diff diff = new Diff(fr1, fr2);
> DetailedDiff detDiff = new DetailedDiff(diff);
> List differences = detDiff.getAllDifferences();

> for (Object object : differences) {

>    Difference difference = (Difference)object;

>    DifferenceEngine engine = new DifferenceEngine(diff);

You don't do anything with this instance

>    ie.differenceFound(difference);

what do you expect this to do?  You ignore the return code.

> // diff.overrideDifferenceListener(ie);

>     System.out.println("***********************");
>     System.*out*.println(difference);
>     System.out.println("***********************");
> }


Your DifferenceListener has not been used during comparisions so you
can't ignore anything here.  You must set the DifferenceListener before
the comparision is performed.  In you case this is before you invoke
diff.similar() or detDiff.getAllDifferences().

Stefan

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Xmlunit-general mailing list
Xmlunit-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to