From: SourceForge.net <no...@so...> - 2013-02-03 10:43:34
|
Feature Requests item #3602981, was opened at 2013-02-01 07:05 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&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: Pending >Resolution: Fixed 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 ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2013-02-03 02:43 Message: The only remaining xsi-attribute is xsi:nil which - I think - is handled reasonably. I'm preparing a new release, would be good if you could test the fix before I finalize it. If you have any trouble building XMLUnit from source, I'll be happy to provide a binary. ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2013-02-02 06:53 Message: This should be fixed with svn revision 502 in the 1.x Branch https://xmlunit.svn.sourceforge.net/svnroot/xmlunit/branches/xmlunit-1.x Can you try to build it yourself to see whether it works for you? Before I cut a new release I want to look around the Schema Instance namespace to see whether there is anything else XMLUnit could support in a better way. ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2013-02-01 08:22 Message: Actually, XMLUnit doesn't really support much of the XML-Schema Instance stuff at all. I've started to fix it in the 1.x branch and simply ignoring the namespace prefix is trivial for this case, making sure the prefixes map to the same NS uris seems more difficult, at least as long as I'm in Java 1.4 land. Once this is fixed I'll roll a new release. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=3602981&group_id=23187 |