Trying to verify that a document is identical after being run through an XSL-sheet, I get a green test despite my removing the leading comment prior to the transformation.
This is a problem, because I want to write a java wrapper for my xsl sheet that removes comments in front of the root and adds them afterwards without modifying.
I'd appreciate if you could look into this.
Document with Comment in Prelude
Copy-Of-XSL
The current implementation of DifferenceEngine ignores everything between the DOCTYPE declaration (if any) and the document element, so the prelude is completely ignored.
Just as is the case with bug 2758280 there may be code that relies on this behavior so we'd have to introduce yet another option if we wanted to change it. It is something I want to keep in mind for our ongoing (rather nascent) discussion of a new API for XMLUnit2 - it is unlikely to get fixed in the 1.x codebase.
Now tracked as https://github.com/xmlunit/xmlunit/issues/1
it turns out XMLUnit 2.x already detects differences in a document's prelude.