Menu

#5 diff able to ignore node type (ie Comments)

closed-fixed
nobody
None
5
2007-01-27
2003-03-21
Anonymous
No

XMLUnit doesn't appear to support ignoring comments
when doing a diff. This patch will allow test writer
to ignore a set of node types, including Comments, in a
similar fashion as ignoring whitespace.

XMLUnit.setIgnoreWhitespace(true);
XMLUnit.addIgnoreNodeType(org.w3c.dom.Node.COMMENT_NODE);
assertXMLEqual(doc1, doc2);

Attached is patch that adds addIgnoreNodeType,
removeIgnoreNodeType and clearIgnoreNodeType to
XMLUnit, and alters the documents created to remove the
nodes in this set.

-Jason

Discussion

  • Nobody/Anonymous

    patch file

     
  • Nobody/Anonymous

    Logged In: NO

    Sorry, forgot to login. You can contact me at jlk@windchill.com

     
  • Stefan Bodewig

    Stefan Bodewig - 2007-01-27
    • status: open --> closed
     
  • Stefan Bodewig

    Stefan Bodewig - 2007-01-27

    Logged In: YES
    user_id=113148
    Originator: NO

    I've used a different approach but XMLUnit in CVS can now ignore comments.

     
  • Stefan Bodewig

    Stefan Bodewig - 2007-01-27
    • status: closed --> closed-fixed
     

Log in to post a comment.