Altova DiffDog Server 2023 

Viewing Comparison Results

Home Prev Top Next

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\DiffDogServer2023\bin\DiffDogServer.exe"
%DIFFDOGSERVER% diff book1.xml book2.xml --mode=xml

Windows batch script

On a Linux machine, the equivalent script could look like:




\${DIFFDOGSERVER} diff book1.xml book2.xml --mode=xml

echo \$?

Linux shell script

The exit code can have one of the following values:


Exit code



No differences exist


Differences exist


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


Text (non-binary) files



XML files



Word documents



Binary files



To view the comparison outcome for binary files, check the exit code after running a comparison, as described in Binary Files.





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.


© 2017-2023 Altova GmbH