xmlcomparisonbeyondcomparebeyondcompare4

Beyond Compare - XML Comparison Issue


I created the below script that is triggered by a separate Python script. This will be a text comparison of 2 XML files.

log normal "C:\Temp\XML_Comparisons\XML_Files_Storage\BCLog.txt"
compare rules-based
load "C:\Temp\XML_Comparisons\XML_Files_Storage" "C:\Temp\XML_Comparisons\XML_Files_Storage"
load "%1" "%2"
text-report layout:side-by-side options:display-mismatches output-to:"BC_Report.txt" "%1" "%2"

However, I keep getting the error below. I'm not sure how to correct this. Can you help me figure this out? Thank you in advance!

7/19/2024 9:40:31 AM >> log normal "C:\Temp\XML_Comparisons\XML_Files_Storage\BCL og.t xt"
7/19/2024 9:40:31 AM >> compare rules-based
7/19/2024 9:40:31 AM >> load "C:\Temp\XML_Comparisons\XML_Files_Storage" "C:\Temp\XML_Comparisons\XML_Files_Storage"
7/19/2024 9:40:31 AM Load comparison: C:\Temp\XML_Comparisons\XML_Files_Storage <-> C:\Temp\XML_Comparisons\XML_Files_Storage
7/19/2024 9:40:31 AM >> load "2024_V769_2024-05-31_17-50-07_SVC_CG_sorted.xml" "2024_V769_2024-06-28_12-29-07_SVC_NG_sorted.xml"
7/19/2024 9:40:31 AM Load comparison: <->
7/19/2024 9:40:31 AM Fatal Scripting Error: Unable to load base folder
7/19/2024 9:40:31 AM Script completed in 0.7 seconds
ā€‹

Prad

The expected output is a Text Compare Report (accessed manually via Session -> Text Compare Report...). However, the script keeps failing and shows the error I referenced above. It looks like the text comparison itself isn't loading, but I'm not sure why. Any help would be appreciated. Thank you!


Solution

  • Your script is a bit of a mix of commands that normally apply to either folders or files. I'm going to assume you are calling this with two file parameters, something like: bcompare.exe "@c:\bcscript.txt" "c:\file1.xml" "c:\file2.xml"

    At which point you don't need the compare or load lines. You can reduce the script to: log normal "C:\Temp\XML_Comparisons\XML_Files_Storage\BCLog.t xt" text-report layout:side-by-side options:display-mismatches output-to:"c:\bcreports\BC_Report.txt" "%1" "%2"

    compare is a command that normally acts on a selection, like from the interface when you select items, then right-click -> Compare Contents, to content scan a selection. Script also has selection commands. load commands are used to load folders, like launching a blank Folder Compare session and then loading two folders into it.