The XML Diff Viewer

This section describes the XML Diff Viewer and its features, including the XML Diff Viewer toolbar and tools for loading documents.

In this section

This section covers the following topics:

Overview

Split view

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 tab, which shows the documents side-by-side. The split view is shown in Figure 128.

Figure 128. XML Diff Viewer - Split View

In the split view, source documents are displayed on the left, the target document on the right. A splitter allows you to change the width of the source and target document panels. You can adjust the width of the source and target document panels by dragging the bar to the left and right.

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 129

Figure 129. XML Diff Viewer - Merged View

.

Both 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.

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 130.

Figure 130. Close-up of Merged View

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.

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 Toolbar

The XML Diff Viewer toolbar, shown in Figure 131, provides tools to help you

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

    Figure 131. The XML Diff Toolbar

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

Tool Button
Description
Calculates the differences in the documents you have selected. This button is active only when Stylus Studio detects the need to calculate differences. This button is disabled if you have selected On changes and If files modified settings. See Engine Settings.
Skips to the next (previous) diff in the currently selected document. You must select a line in the document to enable these buttons.
By default, Stylus Studio displays collapsed documents when the diff is run. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
By default, Stylus Studio collapses any unchanged blocks to simplify the display. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
By default, Stylus Studio uses URIs to compare namespaces when diffing documents. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
Note that changing this setting requires documents to be diffed again.
By default, Stylus Studio expands entity references when diffing documents. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
Note that changing this setting requires documents to be diffed again.
By default, Stylus Studio considers text formatting characters (new lines, carriage returns, tabs) when diffing documents. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
By default Stylus Studio shows differences in comments. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
Note that this feature affects only the display, and not the calculation, of comment differences.
By default Stylus Studio shows differences in text blocks. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
Note that this feature affects only the display, and not the calculation, of text block differences.
By default Stylus Studio shows differences in attributes. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
Note that this feature affects only the display, and not the calculation, of attribute differences.
By default Stylus Studio shows differences in processing instructions. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
Note that this feature affects only the display, and not the calculation, of processing instruction differences.
By default Stylus Studio shows differences in entities. You can override this setting using the toolbar button, or you can change it permanently on the Options. page. See Engine Settings.
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.
Table 13. XML Diff Toolbar Buttons

Tools for Working with Documents

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

  • Add/Remove document buttons

Figure 132. Buttons for Adding and Removing Documents

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.

Tip

 

If Stylus Studio determines that the load or diff operation for a given XML document will take more than a moment, it displays a message and an Abort button at the bottom of the XML Diff Viewer window. You can click the Abort button to terminate the operation at any time. The message and the button are removed from the XML Diff Viewer window once the operation is complete or cancelled.

  • Drop-down list. You use the drop-down list to change the current document in the XML Diff Viewer. When you change the current doc in a multi-document diff, the target document display - specifically, the symbols and colors used to identify documents - typically changes, as well. See Symbols Used in the Target Document Window for more information.

Removing a Target Document

You cannot remove a target document. You can specify a different target document by clicking the set target button ( ) again. This replaces the current target document with the document you select.

 
Free Stylus Studio XML Training: