XML Files
For XML files, you can view the comparison results as XML report only. To understand how differences are reported in XML format, let's assume that the following two XML files must be compared side-by-side:
<book id="1"> | <book id="2"> |
If you compare these two files with the command
<executable> diff file1.xml file2.xml --mode=xml --output-mode=xml --output-file=report.xml |
then the resulting XML report would look similar to the one below:
<?xml version="1.0" encoding="UTF-8"?> |
DiffDog Server comparison report (for XML files)
At the very top, the XML report contains a diff_info element. The diff_info element supplies information about files that were compared (including the comparison mode used, and the path of the compared files). This element occurs only once.
Next, all the encountered differences (two, in this example) are listed by means of multiple xml_diff elements. In the context of each difference, the left_location (and right_location, correspondingly) inform you where the difference was encountered, as an XPath expression. The left_content (and right_content, correspondingly) inform you about the exact element or attribute that is changed.