Toolbar and Contextual Menu Actions of the Compare Files Tool
The toolbar of the Compare Files tool contains operations that can be performed on the source and target files or XML fragments. Many of the actions are also available in the contextual menu.
The following actions are available:
- Algorithm
- This drop-down menu allows you to select one of the following diff algorithms
(depending on whether it is a two-way or three-way comparison):
- Auto - Selects the most appropriate algorithm, based on the compared content and its size (selected by default).
- Characters - Computes the differences at character level, meaning that it compares two files or fragments looking for identical characters. This algorithm is not available when the file comparison is in Author comparison mode.
- Words - Computes the differences at word level, meaning that it compares two files or fragments looking for identical words. This algorithm is not available when the file comparison is in Author comparison mode.
- Lines - Computes the differences at line level, meaning that it compares two files or fragments looking for identical lines of text. This algorithm is not available when the file comparison is in Author comparison mode.
- Syntax Aware - Computes differences for the file types or fragments known by Oxygen XML Editor, taking the syntax (the specific types of tokens) into consideration. This algorithm is not available when the file comparison is in Author comparison mode.
- XML Fast - Comparison that works well on large files or fragments, but it is less precise than XML Accurate.
- XML Accurate - Comparison that is more precise than XML Fast, at the expense of speed. It compares two XML files or fragments looking for identical XML nodes.
- Diff Options
- Opens the Files Comparison preferences page where you can configure various options.
- Three-Way Comparison
- Toggle action that allows you to perform a three-way comparison between the two files displayed in the two editing panes and a base (ancestor) file.
- Perform Files Differencing
- Looks for differences between the two files displayed in the left and right side panels.
- Synchronized scrolling
- Toggles synchronized scrolling on or off so that a selected difference can be seen on both sides of the application window. This option is on by default.
- Ignore Whitespaces
- Enables or disables the whitespace ignoring feature. Ignoring whitespace means that before performing the comparison, the application normalizes the content and trims its leading and trailing whitespaces. This option is not available when in the Author comparison mode.
- Format and Indent Both Files (Ctrl + Shift + P (Command + Shift + P on macOS))
- Formats and indents both files before comparing them.
Use this option for comparisons that contain long lines that make it difficult to spot
differences.
This option is not available when in the Author comparison
mode.Note: When comparing two JSON files, the Format and Indent Both Files action will automatically sort the keys in both files the same to make it easier to compare.
- Tags Display Mode
- Allows you to select the amount of markup to be displayed in the Author visual comparison mode. You can choose between: Full Tags with Attributes, Full Tags, Block Tags, Block Tags without Element Names, Inline Tags, Partial Tags, or No Tags.
- Copy Change from Right to Left
- Copies the selected difference from the file in the right panel to the file in the left panel.
- Copy All Changes from Right to Left
- Copies all changes from the file in the right panel to the file in the left panel.
- Next Block of Changes (Ctrl + Period (Command + Period on macOS))
- Jumps to the next block of changes. This action is not available when the cursor is
positioned on the last change block or when there are no changes.Note: A change block groups one or more consecutive lines that contain at least one change.
- Previous Block of Changes (Ctrl + Comma (Command + Comma on macOS))
- Jumps to the previous block of changes. This action is not available when the cursor is positioned on the first change block or when there are no changes.
- Next Change (Ctrl + Shift + Period (Command + Shift + Period on macOS))
- Jumps to the next change from the current block of changes. When the last change from the current block of changes is reached, it highlights the next block of changes. This action is not available when the cursor is positioned on the last change or when there are no changes.
- Previous Change (Ctrl + Shift + Comma (Command + Shift + M on macOS))
- Jumps to the previous change from the current block of changes. When the first change from the current block of changes is reached, it highlights the previous block of changes. This action is not available when the cursor is positioned on the first change or when there are no changes.
- Copy All Changes from Left to Right
- Copies all changes from the file in the left panel to the file in the right panel.
- Copy Change from Left to Right
- Copies the selected difference from the file in the left panel to the file in the right panel.
- Ignore Nodes by XPath
- You can use this text field to enter an XPath expression to ignore certain nodes from the comparison. It will be
processed as XPath version 2.0. You can also enter the name of the node to ignore all
nodes with the specified name (for example, if you want to ignore all ID attributes from
the document, you could simply enter @id). This field is only
available when comparing XML documents using the XML Fast or
XML Accurate algorithms.Note: If an XPath expression is specified in the Ignore nodes by XPath option in the Diff / File Comparison preferences page, that one is used as a default when the application is started. If you then enter an expression in this field on the toolbar, this one will be used instead of the default. If you delete the expression from this field, neither will be used.
- First Change (Ctrl + B (Command + B on macOS))
- Jumps to the first change.
- Base
- Available for three-way comparisons. It is the base file that will be compared with the files opened in the left and right editors. You can specify the path to the file by using the text field, its history drop-down, or the browsing actions in the Browse drop-down menu.
- Left-Side (Source) File
- You can specify the path to the file to be compared on the left side (source) by using the text field, its history drop-down, or the browsing actions in the Browse drop-down menu.
- Right-Side (Target) File
- You can specify the path to the file to be compared on the right side (target) by using the text field, its history drop-down, or the browsing actions in the Browse drop-down menu.