This toolbar contains the operations that can be performed on the source and target files
or XML fragments.
Figure: The Compare Toolbar
The following actions are available:
- Algorithm
- This drop-down menu allows you to select one of the following diff algorithms:
-
Auto - Selects the most appropriate algorithm, based on the
compared content and its size (selected by default).
-
Characters - Computes the differences at character level.
-
Words - Computes the differences at word level.
-
Lines - Computes the differences at line level, meaning that
it compares two files or fragments looking for identical lines of text. Once
identical lines are found, it is considered a match. The content that precedes the
match is considered to be a difference and marked accordingly. The algorithm then
continues to look for matching lines.
-
Syntax Aware - Computes differences for known file types or
XML fragments. Known file types include those listed in the
New dialog box, such as XML file types (XSLT files, XSL-FO
files, XSD files, RNG files, NVDL files, etc.), XQuery file types
(.xquery, .xq,
.xqy, .xqm extensions), DTD file types
(.dtd, .ent, .mod
extensions), TEXT file type (.txt extension), or PHP file type
(.php extension).
This algorithm splits the files or fragments into sequences of
tokens and
computes the differences between them. A
token can have a different meaning,
depending on the type of the compared files or fragments . For example:
- When comparing XML files or fragments, a token can be one of the following:
- The name of an XML tag
- The < character
- The /> sequence of characters
- The name of an attribute inside an XML tag
- The = sign
- The " character
- An attribute value
- The text string between the start tag and the end tag (a text node that is
a child of the XML element corresponding to the XML tag that encloses the
text string)
- When comparing plain text, a token can be any continuous sequence of
characters or any continuous sequence of whitespaces, including a new line
character.
-
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.
Diff Options
- Opens the Files Comparison page.
Perform directories differencing
- Looks for differences between the two directories displayed in the left and right side
of the application window.
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.
Synchronized scrolling
- Synchronizes scrolling so that a selected difference can be seen on both sides of the
application window. This action enables/disables the previously described behavior.
Format and
Indent Both Files (Ctrl Shift P
(Meta Shift P on OS X))
- Formats and indents both files before comparing them. Use this option for comparisons
that contain long lines that make it difficult to spot differences.
Copy Change from Right to Left
- Copies the selected difference from the target file in the right side to the source file
in the left side.
Copy All Changes from Right to Left
- Copies all changes from the target file in the right side to the source file in the left
side.
Next Block
of Changes (Ctrl Period
(Meta Period on OS X))
- Jumps to the next block of changes. This action is disabled 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 (Meta
Comma on OS X))
- Jumps to the previous block of changes. This action is disabled when the cursor is
positioned on the first change block or when there are no changes.
Next
Change (Ctrl Shift Period (Meta Shift Period on OS X))
- 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 disabled when the cursor is positioned on the last change or when there are no
changes.
Previous
Change (Ctrl
Shift Comma (Meta Shift M on OS X))
- 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 disabled 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 source file in the left side to the target file in the right
side.
Copy Change from Left to Right
- Copies the selected difference from the source file in the left side to the target file
in the right side.
First Change (Ctrl B (Meta B on OS
X))
- Jumps to the first change.