<oXygen/> XML Editor User Guide

File Comparison

The comparison of a pair of files is done by opening them in two editors arranged in a side-by-side layout. You can edit either the source or the target file. The differences are refreshed when you save the modified document.

Figure 9.7. The Compare Files Window

The Compare Files Window

The window is comprised of the following components:

The Main Menu

The Main Menu provides access to all the functions and features available in this window:

The Source Menu

Here you can select the source file to be compared.

Source-> Open : Browses for a file (the source file).

Source->Open URL : Opens URL to be used as a source file. See Open URL for details.

Source-> Save : Saves the changes made in the source file.

The Target Menu

Here you can select the target file to be compared.

Target-> Open : Browses for a file (the target file).

Target->Open URL : Opens URL to be used as a target file. See Open URL for details.

Target-> Save : Saves the changes made in the target file.

Operations Menu

Operations->Perform files differencing : Performs the comparison of the source and the target files.

Operations->Go to first modification : Selects the first difference in the files. (The button becomes available if the selection is not on the first modification)

Operations->Go to previous modification : Selects the previous difference in the files. (The button becomes available if the selection is not on the first modification)

Operations->Go to next modification : Selects the next difference in the files. (The button becomes available if the selection is not on the last modification)

Operations->Go to last modification : Selects the last difference in the files. (The button becomes available if the selection is not on the last modification)

Operations->Copy all non-conflicting changes from left to right : Copies the non-conflicting changes from the source to the target.

Operations->Copy all non-conflicting changes from right to left : Copies the non-conflicting changes from the target to the source.

Operations->Copy change from left to right : Copies the selected difference from the source to the target.

Operations->Copy changes from right to left : Copies the selected difference from the target to the source.

Operations->Show modification details at word level : Provides Word Level Comparison

Operations->Show modification details at char level : Provides Character Level Comparison

Compare Toolbar

This is where you’ll find the operations that can be performed on the source and target files.

Figure 9.8. The Compare Toolbar

The Compare Toolbar

The available functions are presented at the Operations menu.

Perform files differencing
Run the diff algorithm selected in the Algorithm combo box on the two selected files.
Go to first modification
Scroll the two-way comparison panel to the first difference marked in the two-way comparison panel.
Go to previous modification
Scroll the two-way comparison panel to the previous difference marked in the two-way comparison panel.
Go to next modification
Scroll the two-way comparison panel and select the next difference marked in the two-way comparison panel.
Go to last modification
Scroll the two-way comparison panel and select the last difference marked in the two-way comparison panel.
Copy all non-conflicting changes from left to right
All the nodes present in the left side file and not present in the right side file are copied to the right side file.
Copy change from left to right
Copy the current difference marked in the two-way comparison panel from the left side file to the right side file.
Copy change from right to left
Copy the current difference marked in the two-way comparison panel from the right side file to the left side file.
Copy all non-conflicting changes from right to left
All the nodes present in the right side file and not present in the left side file are copied to the left side file.
Show modification details at word level
The Word algorithm is applied to the current difference marked in the two-way comparison panel and the result is displayed in a separate dialog.
Show modification details at char level
The Characters algorithm is applied to the current difference marked in the two-way comparison panel and the result is displayed in a separate dialog.
Enable scrolling synchronization
When one of the two panels is scrolled up or down the other panel is scrolled in the same direction so that corresponding match of the current difference from the other panel is displayed at the same time as in the scrolled panel.
Disable scrolling synchronization
When one of the two panels is scrolled up or down the other panel is not scrolled. The effect is that the corresponding match of the current difference from the other panel is not displayed at the same time as in the scrolled panel.

Also, <oXygen/> offers you the complete diff solution:

  • two XML diff algorithms

    • XML Accurate works on small files and it is very precise.

    • XML Fast works on larger files but it is less precise than XML Accurate.

  • Syntax Aware for the file types known by <oXygen/>, it computes the differences taking into consideration the syntax of the documents.

  • three all-purpose algorithms:

    • Lines algorithm computes the differences at line level

    • Words algorithm computes the differences at word level

    • Characters algorithm computes the differences at character level

  • an automatic selection of the algorithm:

    • Auto selects the most appropriate algorithm, based on the files' content and size.

Diff Options button

It provides quick access to the Diff preferences pane where you set Diff parameters that will be saved for the next time when you open the Compare Files dialog.

Files Selector

To open the source and target files where you want to see the differences, select a file from the "Open" or "Open URL" button. <oXygen/> keeps track of the files you are currently working with and those you opened in this window. You can see and select them from the two combo-boxes.

You can also save the changes in the source file or the target file by clicking the corresponding "Save" button.

File contents panel

Figure 9.9. Files contents panel

Files contents panel

The files are opened in two side-by-side editors. The text view is used, offering a better view of the changes.

The two editors are kept in sync, if you scroll the text in one of them, the other will also scroll to show the difference. The differences are indicated using highlights connected through colored areas. You can use the "Go to modification" buttons to navigate between differences or simply select a change by clicking on it in the overview ruler located in the right-most part of the window. You can also do this by clicking on a colored area between the text editors.

You can edit either the source or the target file. The differences are refreshed when you save the modified document.

You can right-click the text editors for the "Cut", "Copy", "Paste" and "Select all" actions.

If the compared blocks of text are too large and you want to see the differences at a finer level, you can use the comparison at "Word" or "Character" level.

Word Level Comparison

This option is only available if modifications(yellow-colored differences) exist between the source and the target file. You can go to Word Level Comparison by clicking the "Show modification details at word level" button from the Compare Panel or from the Operations menu.

Figure 9.10. Word Level Comparison

Word Level Comparison

Character Level Comparison

This option is only available if modifications(yellow-colored differences) exist between the source and the target file. You can go to Character Level Comparison by clicking the "Show modification details at char level" button from the Compare Panel or from the Operations menu.

Figure 9.11. Character Level Comparison

Character Level Comparison