Viewing Comparison Results
When you run a comparison, the outcome of the comparison is reported by the exit status (return code) of the command that called the DiffDog Server (or DiffDogCmdlClient) executable. For example, the following Windows batch script runs a comparison between two files and gets the exit code from the %ERRORLEVEL% environment variable:
SET DIFFDOGSERVER="C:\Program Files\Altova\DiffDogServer2025\bin\DiffDogServer.exe" |
Windows batch script
On a Linux machine, the equivalent script could look like:
#!/bin/bash DIFFDOGSERVER=/opt/Altova/DiffDogServer2025/bin/diffdogserver ${DIFFDOGSERVER} diff book1.xml book2.xml --mode=xml echo $? |
Linux shell script
The exit code can have one of the following values:
Exit code | Meaning |
0 | No differences exist |
1 | Differences exist |
2 | An error has occurred |
When differences exist (exit code = 1), you can also view a detailed comparison report directly at the command line, or output it to a report in XML or text format. To specify the output format as text or xml, set the --output-mode option. For example, the following command compares two text files using text comparison mode (that is, --mode=text) and displays the output as text at the command line:
<executable> diff a.txt b.txt --mode=text --output-mode=text |
To redirect the output to a file, set the --output-file option. For example, the following command compares two text files using text comparison mode (that is, --mode=text). The output report will be in XML format and it will be redirected to out.xml file:
<executable> diff a.txt b.txt --mode=text --output-mode=xml --output-file=out.xml |
Note: | The option --output-mode=text is not supported when comparing XML files or Word documents. |
By default, the report containing comparison results is displayed at the command line. To suppress the output, set the option --quiet=true, for example:
<executable> diff a.txt b.txt --mode=text --output-mode=text --quiet=true |
The following table lists the supported report formats for various comparison kinds.
Type of comparison | XML report | Text report | Notes |
---|---|---|---|
Text (non-binary) files | Yes | Yes | |
XML files | Yes | No | |
Word documents | Yes | No | |
Binary files | No | No | To view the comparison outcome for binary files, check the exit code after running a comparison, as described in Binary Files. |
Directories | Yes | Yes |
The following sections describe the structure of the comparison report files produced for each of the scenarios above. This information is meant to help you understand the reported differences and might also be useful if you intend to process the report in an automated way.