Menu

Printing out the XML diff

Help
Rogi Rose
2009-01-31
2013-03-03
  • Rogi Rose

    Rogi Rose - 2009-01-31

    Is it possible to find out exactly what is the diff between 2 XMLs, and print it out to the display so a user will be able to see the differences ?

    I need to find a way to make the results more user friendly , so it will be easy to trace the differences quickly.

     
    • Stefan Bodewig

      Stefan Bodewig - 2009-02-02

      XMLUnit itself doesn't contain any tools to visualize these differences, no.  It really only is a library you could use to create such a tool.

      You probably want to use DetailedDiff to get all differences and use the NodeInfo associated with each difference for something that is more user friendly that the toString method of the Difference class.

       
      • Lou

        Lou - 2009-02-03

        We are doing this exact thing - we are taking the detailed diff and converting it into text for an email and/or PDF.  We have custom code to iterate through the diffs and convert it to "nice" verbiage for the user.  I can send you some examples if you need it.

         
  • Michael Müller-Hillebrand

    Are you aware of any projects based on XMLUnit (or other libraries, Java or .NET) which perform the Diff task and create the DetailedDIff output in XML form? I would have no problem enhancing this using XSLT, but I am not a Java or .NET developer, just XML handler and XSL programmer.

    Thanks a lot, - Michael

     

Log in to post a comment.