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

-------------------------------------------------------------------------
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

Reply via email to