From: Majumder, A. <Ana...@Om...> - 2007-05-04 15:46:48
|
Stefan -=20 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.=20 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:bo...@ap...]=20 Sent: Friday, May 04, 2007 10:20 AM To: xml...@li...; Majumder, Anamika Subject: Re: [Xmlunit-general] Comparing two XML documents while skipping certain nodes On Fri, 4 May 2007, Anamika Majumder <Ana...@om...> 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). >=20 > 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 |