#48 Respect comments in prelude when checking for identity

Urs Reupke

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.


  • Urs Reupke

    Urs Reupke - 2009-04-17

    Document with Comment in Prelude

  • Urs Reupke

    Urs Reupke - 2009-04-17


  • Stefan Bodewig

    Stefan Bodewig - 2009-06-09

    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.

  • Stefan Bodewig

    Stefan Bodewig - 2015-02-06

    it turns out XMLUnit 2.x already detects differences in a document's prelude.

  • Stefan Bodewig

    Stefan Bodewig - 2015-02-06
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks