From: Stefan B. <bo...@ap...> - 2007-05-24 04:30:47
|
On Wed, 23 May 2007, Erik van Oosten wrote: > I am comparing 2 documents which use different ways to represent the > same namespace. I expected the method > XMLAssert.assertXMLEqual(Document,Document) to treat these as > similar. > > Here is my code: > > Document expectedEdiXml = > XMLUtil.parseIntoDocument(ResourceLoader.getResource(this, > "ex2_mvwi10.xml")); Document actualEdiXml = > mvwi10.getPayloadAsDocument(); try { > XMLAssert.assertXMLEqual(expectedEdiXml, actualEdiXml); > } catch (AssertionFailedError e) { > System.out.println("expected: " + XMLUtil.prettyPrint(expectedEdiXml)); > System.out.println("actual: " + mvwi10.getPayloadAsString()); > throw e; > } You are not printing what was compared, but a slightly different version > Obviously, the documents are quite not the same. However, the > exception does not correspond to what I expected. > > Any thought to what I might do wrong? Is this a whitespace issue? I'd think so, it is hard to tell after you've pretty printed the input. Do you get the expected result if you set XMLUnit.setInoreWhitespce to true? Stefan |