The XML Diff Viewer

This section describes the XML Diff Viewer and its features, including the different views available for comparing documents, the XML Diff Viewer tool bar, and tools for loading documents.

This section covers the following topics:

Split View - Tree

You use the XML Diff Viewer to compare two or more XML documents. By default, the XML Diff Viewer displays the diffed documents on the Split View - Tree tab. This view, shown in Figure 132, shows the documents side-by-side using a tree/node representation.

In split views (there is also a split view that shows documents in XML), source documents are displayed on the left, the target document on the right. A splitter between the two panes allows you to change the width of the source and target document panes by dragging the splitter to the left and right.

Split View - Text

The Split View - Text tab also shows source and target documents side-by-side in plain XML.

Merged View

If you prefer, you can select the Merged View tab, which folds the nodes from the source and target documents into a single window, as shown in Figure 134

.

The merged view displays changed items in pairs - the item from the target document appears first, the item from the source document is shown second, as shown in Figure 135.

In this example, the line through the <au_lname> element in the source document, Hennings, indicates that it has changed to White in the target document.

View Symbols and Colors

All views use the same symbols and color schemes to identify the types of changes detected by the Stylus Studio diff calculation - by default, green for added items, yellow for changed items, and red for removed items. In addition, the text font and size are controlled by the settings for the XML Editor on the Editor Format page of the Options dialog box.

See Symbols and Background Colors for more information on this topic, and to learn how you can assign custom colors to the results of standard differencing operations.

The XML Diff Viewer Tool Bar

The XML Diff Viewer tool bar, shown in Figure 136, provides tools to help you

l Manually start the diff calculation
l Navigate source and target documents
l Change default display and diff settings
l Show or ignore differences in document items such as text nodes and attributes

The following table identifies the individual tools and tells you where to find more information.

Table 15. XML Diff Tool Bar Buttons
Tool Button
Description
Skips to the next (previous) diff in the currently selected document. You must select a line in the document to enable these buttons.
Note that changing this setting requires documents to be diffed again.
Note that changing this setting requires documents to be diffed again.
Note that this feature affects only the display, and not the calculation, of comment differences.
Note that this feature affects only the display, and not the calculation, of text block differences.
Note that this feature affects only the display, and not the calculation, of attribute differences.
Note that this feature affects only the display, and not the calculation, of processing instruction differences.
Note that this feature affects only the display, and not the calculation, of entity differences.
Note that this feature affects only the display, and not the calculation, of entity differences.
Allows you to change the font of documents displayed in the XML Diff Viewer.

Tools for Working with Documents

The XML Diff Viewer provides several tools for working with source and target documents:

l Add/Remove document buttons. When you click the add or set document button, Stylus Studio displays the Open dialog box. The add button for source documents displays a green plus sign on it ( ) to alert you to the fact that you can add multiple source documents when diffing XML documents. You can specify only a single target document, however.
You use the remove button, the folder with the red minus sign on it ( ), to remove the current source document from the XML diff calculation.
 
Free Stylus Studio XML Training: