Question

Compare two XML files

  • 15 April 2024
  • 2 replies
  • 42 views

Userlevel 5
Badge +1

Hi

I would like to compare two XML files for differences.

Here’s my use case.

I create an order via an API and can get the entire order back in the response.

I will store that order in a database table.

Later, I will poll the API again and fetch the latest details of that order.

I can do a quick check for overall changes using a hash, but I will need to know what changes if they latest and stored order differ.

 

thanks in advance


2 replies

Userlevel 6
Badge

Unfortunately, CData Arc does not offer a feature for file comparison. The application is designed to process single and batch messages, but there is nothing that in the model that would make it possible to compare a file against an earlier copy of itself. 

It may be possible to create a script that would perform this, or call out to a batch process that would run the comparison - or if you eventually sync this data into a database, a better option might be to enable database triggers that track changes to the records - but unfortunately there is nothing that would compare to file comparison features in data reader utilities like Visual Studio Code, Notepad++ or Ultraedit.

Userlevel 5
Badge +1

thanks, I might consider building this functionality into an external REST API that I can call from cData Arc.

The previous version of the file would indeed be stored in a DB.

Reply