From: SourceForge.net <no...@so...> - 2013-02-01 15:05:24
|
Bugs item #3602981, was opened at 2013-02-01 07:05 Message generated for change (Tracker Item Submitted) made by dportabella You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=3602981&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: David Portabella Clotet (dportabella) Assigned to: Nobody/Anonymous (nobody) Summary: Diff failswith xsi:type and different prefix Initial Comment: This code: import org.custommonkey.xmlunit.Diff; String result = "<ns1:Square xsi:type=\"ns1:Shape\" xmlns:ns1=\"http://example.com/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; String correct = "<ns2:Square xsi:type=\"ns2:Shape\" xmlns:ns2=\"http://example.com/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; Diff diff = new Diff(result, correct); System.out.println("diff:" + diff); System.out.println("diff.similar(): " + diff.similar()); results in: diff: org.custommonkey.xmlunit.Diff [not identical] Expected namespace prefix 'ns1' but was 'ns2' - comparing <ns1:Square...> at /Square[1] to <ns2:Square...> at /Square[1] [different] Expected attribute value 'ns1:Shape' but was 'ns2:Shape' - comparing <ns1:Square xsi:type="ns1:Shape"...> at /Square[1]/@type to <ns2:Square xsi:type="ns2:Shape"...> at /Square[1]/@type diff.similar(): false --- someone posted a fix here: http://stackoverflow.com/questions/14647861/xmlunit-diff-returns-similar-false-if-there-is-a-xsitype-and-a-different-namesp/14648786#14648786 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=3602981&group_id=23187 |