FeRox XML-Compare: Description/Example

XML-Compare

Simple and fast comparison of two XML files

Description/Example

Summary

FeRox Management Consulting GmbH & Co. KG offers you with XML-Compare a free of charge possibility to compare two XML files simply and quickly.

Compared to most other programs, you can not only compare line by line, but optionally define which elements should be compared and/or displayed, and which element should be used as a unique identifier.

The result of the comparison is created as intuitive HTML in the look of a spreadsheet, which can of course also be downloaded and opened in any browser.


XML Base File and XML Compare File

Any conventional XML file can be used as the XML base file and XML compare file. Such files are mostly used to exchange data between different systems, or to prepare data in an orderly manner for analysis purposes.


Example: XML Base FileExample: XML Compare File
(To download please click with the right mouse button on the links and select "Save link as...")

Important notice:
Our example XML files above contain data created with a randomizer program for so-called "Fake Persons". Any similarity to real persons and/or addresses would be purely coincidental.


An XML file is a normal text file which is written in an XML (= Extensible Markup Language) file format and has a logical layout in a directory structure, e.g.


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<personlist>
	<person ID="P20000101">
		<Salutation SalutationType="A1">Mr.</Salutation>
		<Name>Doe</Name>
		<FirstName>John</FirstName>
		<Title />
		…
	</person>

	<person ID="P20000201">
		<Salutation SalutationType="A2">Mrs.</Salutation>
		<Name>Doe</Name>
		<FirstName>Jane</FirstName>
		<Title>Dr.</Title>
		…
	</person>

	…
</personlist>

An XML file consists of three important element types:

  1. Path (Symbolized in the comparison program by: ">")

    A path is an element that has at least one subelement, i.e. a markup or tag element such as <person> or <Salutation>.

    In the above example this is:

    • personlist (= Root element, since it represents the outermost frame element)
    • personlist>person

  2. Text (Symbolized in the comparison program by: ".")

    A text is an element that has no subelement, i.e. no markup or tag element. Only text elements can contain values.

    In the above example this is:

    • personlist>person.SalutationMr.
    • personlist>person.NameDoe
    • personlist>person.FirstNameJohn
    • personlist>person.Title(empty)

    • personlist>person.SalutationMrs.
    • personlist>person.NameDoe
    • personlist>person.FirstNameJane
    • personlist>person.TitleDr.

  3. Attribute (Symbolized in the comparison program by: "#")

    An attribute is an element that is located within a markup or tag element, i.e. it can be used for both paths and texts.

    In the above example this is:

    • personlist>person#IDP20000101
    • personlist>person.Salutation#SalutationTypeA1

    • personlist>person#IDP20000201
    • personlist>person.Salutation#SalutationTypeA2

Structure Element

After uploading the two XML files, a first quick validity and structure analysis is performed. The paths found under the root element are listed, so that you can determine from which top path (= initial element) the two XML files are to be compared with each other.

NOTICE: For an optimal comparison, select an entry-level XML element that is included in both the base and comparison files. All child elements of this selected XML structure element are also compared.


In the above example this is:

  • personlist>person

Additional Settings and/or Element Selection

Compared to most other programs, you can not only compare line by line, but optionally define which elements should be compared and/or displayed, and which element should be used as a unique identifier.

For example, if your XML file has a date field that indicates when the record was created, you can specify that this field should be listed and displayed, but not affect the comparison result.

By specifying an ID element, it is also possible to determine rows or records that have been changed, added or deleted in the XML comparison file in relation to the XML base file.


In the above example, the unique ID element is:

  • personlist>person#ID

Result of the Comparison as a Spreadsheet

The result of the comparison is created as intuitive HTML in the look of a spreadsheet, which can of course also be downloaded and opened in any browser.


The result HTML consists of two tabs:

  1. Comparison

    Line by line comparison of the data records in color coding, so that at first glance you can see which records were changed, added, deleted or remained the same.

    Furthermore each of these display types can be switched on or off with one click.

  2. Statistics

    In addition to the execution times and parameters, a statistic per display type of the compared files is shown here.

    The evaluation shows whether there are relevant differences in the files (KO), or whether they are identical (OK).


Our example results are:


Comparison   Statistics
 


Example: Comparison Result as HTML Spreadsheet
(To download please click with the right mouse button on the links and select "Save link as...")