No announcement yet.

Data compare for xml/json?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Data compare for xml/json?


    I have the scenarios that I want to compare xml/json files in "data compare" sort of way, e.g.
    file1.xml: <xml><person fname="John" lname="Doe"/><person fname="Foo" lname="Baz"/></xml>
    file2.xml: <xml><person lname="Baz" fname="Foo"/><person lname="Doe" fname="John"/></xml>
    These 2 files are "identical" data wise.

    Same with e.g. json format.

    Is this possible somehow with addins or similar? If not is this something planned for future?


  • #2

    The Table (Data) Compare for Beyond Compare is for files in a Rows/Columns structure, like CSV or Excel. To compare nodes of XML files, I would recommend the Text Compare using our Tidy or Sorted rule variants, which reorder the nodes so they align properly. Please note that any edits or saves will save the files in the new order and structure, so do not save unless the file is structured in an acceptable way.

    BC3 has several different formats for restructuring XML, each a slightly different way. You probably need the "XML tidied with attributes sorted" format:
    Beyond Compare is a multi-platform utility that combines directory compare and file compare functions in one package. Use it to manage source code, keep directories in sync, compare program output, etc.

    After installing the format, the Tools menu -> File Formats list is a priority list: the topmost *.xml match is the format used automatically for XML files, while lower formats can be picked manually after opening and viewing your files. You can reorder the File Formats list using the yellow arrow buttons to move formats up or down the list to change the order and controlling which is the default format.
    Aaron P Scooter Software