Stefan - The method int differenceFound(org.custommonkey.xmlunit.Difference difference) in the DifferenceListener interface needs a Difference object, while the Difference class has only protected constructors. The tests I am writing are in a different package and do not have access to any protected constructors in the package "org.custommonkey.xmlunit", am I missing the point entirely?? Thank you. Anamika.
-----Original Message----- From: Stefan Bodewig [mailto:[EMAIL PROTECTED] Sent: Friday, May 04, 2007 10:20 AM To: [email protected]; Majumder, Anamika Subject: Re: [Xmlunit-general] Comparing two XML documents while skipping certain nodes On Fri, 4 May 2007, Anamika Majumder <[EMAIL PROTECTED]> wrote: > Stephan - I have another question. I am trying to compare two xml > documents but would like to Skip the comparison in a few of those > nodes (e.g the documents should be treated as identical even if two > elements 'foo' and 'bar' are different in the two). > > I see in the examples, that we could implement the > DifferenceListener, Yes, I was about to recommend that. > but it seems like then the documents would be treated as > similar/identical even if nodes other than 'foo' and 'bar' are > different. Why? You will have to be more specific in your DifferenceListener implementation and only return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL if the Difference is one between foo and bar elements. In any other case return RETURN_ACCEPT_DIFFERENCE. > Is there a way so that I can specify using xpaths, that I would like > to skip comparison of just foo and bar. No, unfortunately there is not. Stefan ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Xmlunit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xmlunit-general
