开发者

Comparing (sorted) XMLs using Beyond Compare (script) and Generate Report

开发者 https://www.devze.com 2023-03-14 13:17 出处:网络
We have to compare re开发者_运维知识库sponses (XML) of two different but they are doing the same business processes. The thing is we are in a process of migrating from Mainframe Technology to Microsof

We have to compare re开发者_运维知识库sponses (XML) of two different but they are doing the same business processes. The thing is we are in a process of migrating from Mainframe Technology to Microsoft BizTalk Technology. Mainframe is serving more than 54 clients (desktop, web, web services). Both, Mainframe and Microsoft BizTalk Server take similar requests and should response similar. The request and response formats are in XML.

As I said 54 systems are connected through Mainframe, we decided to run Microsoft Server parallel to it which means whatever request comes to Mainframe a copy of it will also pass to Microsoft BizTalk Server. And, we are saving copy of each responses coming from both servers in a physical location.

Now, we have to compare both responses (XML) and generate difference report (HTML and XML). For that, we are using Beyond Compare 3 (Pro). As this comparing process has to go on in a schedule, we are doing this by Beyond Compare Scripting. Suppose, we have to ask Beyond Compare to run comparison after every hour. A small application is designed to schedule this and run Beyond Compare Script which is as follows:

#compare the text contents of the files
criteria rules-based
#only compare delphi source files, ignore the archive folder
filter "*.xml;*.xsd;*.xsl"


load "F:\SE Response Folder\04\013-07" "F:\MF Response Folder\ProcessedFolder\04\013-07"


#expand to affect subfolders and files
expand all

#select updated files

select lt.diff.files rt.diff.files

#generate a report of the differences

file-report layout:xml options:display-mismatches output-to:C:\report123.xml

The problem in this script is XML has to be sorted and then compare. How do we sort XML before comparison? I've downloaded the XML Sort format from ScooterSoftware download section. But I don't know how to use XML Sort to sort XMLs and then generate report.

Please, help.


After you install the XML Sort rule it should appear at the top of your file format list and should be used automatically. If it's not, are you running the scheduled task as the same user that installed the format? If not, either:

  • install it again as that user
  • copy the BCFileFormats.xml from your %AppData% directory to the relevant user
  • create a portable BC install (the installer has that option), set it up, and run the scheduled task using it instead of the standard install
0

精彩评论

暂无评论...
验证码 换一张
取 消