The DifferenceEngine's JavaDoc ( http://xmlunit.sourceforge.net/api/org/custommonkey/xmlunit/DifferenceEngine.html ) indicates: "Nodes of other types (eg ENTITY_NODE) will be skipped."
This means that for example this test case fails:
assertXMLEqual("<root>bla\r\nbla</root>", "<root>bla
\nbla</root>");
I suppose this is because XmlUnit sees \r\n on one side and only \n on the other side since 
 is skipped.
In my case the control and the test are generated by different processing chain (and XML parsers/serializers), which may produce either entities or standard characters.
XMLUnit.setNormalizeWhitespace(true); seems to be a solution for the special case of this entity, but
true support for XML entities comparison would be much better.
Logged In: YES
user_id=113148
Originator: NO
If I change your example to
assertXMLEqual("<root>bla1\nbla</root>", "<root>bla1\nbla</root>");
it passes for me, so there is something strange with the expansion of a carriage return.
My reading of EntityReference's Javadocs
"Note that character references and references to predefined entities are considered to be expanded by the HTML or XML processor so that characters are represented by their Unicode equivalent rather than by an entity reference."
is that we can rely on the parser to expand simple character references and my test with "1" -> "1 seems to confirm this.
If I use " and \" it fails, again.
I'll throw in a property for XMLUnit that invokes DocumentBuilderFactory.setExpandEntityReferences for more control, we'll see how that works out.
Logged In: YES
user_id=113148
Originator: NO
my fault, the " case passes even without the setExpandEntityReferences flag and the 
 case fails even with the flag. My best guess is that 
 simply doesn't expand to the same thing as \r.
assertXMLEqual("<root>bla \nbla</root>", "<root>bla
\nbla</root>")
passes as well, with and without explicit entity reference expansion.
Anyway, I've added the flag now. I'd be grateful if you could test XMLUnit's svn trunk, set the flag and see whether it resolves the issues you see (apart from the \r case).
http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=261
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).