Menu

how to use skippedcomparison method

ravi
2007-07-18
2013-03-03
  • ravi

    ravi - 2007-07-18

    hi
    basically i need to compare two xml files line to line ,in this case the i have some reserved node need skip

    example:
    xml1:
    <a>
      <b>2</b>
      <c>3</c>
    </a>

    xml2:
    <a>
      <b>3</b>
      <c>3</c>
    </a>

    as shown above i need to compare xml1,xml2 ..ny seeing these it will show difference in tag <b> in both xmls my requirment is i need to skip these node which r i already know

    how can i use this by using xmlunit.

    I am using "DetailDiff" which is showing all differences.at the same time i need t skip some reserved nodes which r different actuvally.

    Thanks
    ravi

     
    • Stefan Bodewig

      Stefan Bodewig - 2007-07-31

      I'm not really sure I understand what you need.

      You could use a DifferenceListener that downgrades all differences that you know about and want to ignore to RETURN_DIFFERENCE_NODES_IDENTICAL.

      See http://xmlunit.sourceforge.net/userguide/html/ar01s03.html#DifferenceListener

       
    • ravi

      ravi - 2007-08-01

      hi Bodewig ,
         thanks for providing solution i already made this and change(last week of this month) and its working .
      XML unit really doing well without writng any parser code.

      Thanks
      Ravi

       

Log in to post a comment.