Diffing Multiple Documents

This section describes how to use Stylus Studio to diff multiple XML documents.

Before continuing with this section, you should read Overview, which describes basic information about the Stylus Studio Diff tool, and The XML Diff Viewer, which describes features of the XML Diff Viewer and how to use them.

This section covers the following topics:

Document Focus

Diffing multiple XML documents is much the same as diffing a pair of documents - you specify the source documents (one at a time), a target document, and Stylus Studio calculates the diff.

When you diff multiple documents, however, only one source document can have focus at a time. Consider the following illustration, which shows three source documents (source1.xml, source2.xml, and source3.xml) and a target document (target.xml).

In this example, the source1.xml document currently has focus. You set the focus on a given source document by selecting that document from the drop-down list at the top of the source document window.

When a source document has focus:

l Diffs are displayed for that document only, even if you have selected the Merged View tab for display.
l Clicking the remove document button ( ) removes that document from the XML diff calculation.

Symbols Used in the Target Document Window

When diffing multiple documents, Stylus Studio uses an additional set of symbols in the target document window. These symbols, which are displayed in the side bar of the XML Diff Viewer window alongside the standard set of symbols described in Symbols and Background Colors, indicate the ways in which the change identified in the current source document differs from changes to the same node in other source documents.

As shown in Figure 138, symbols in the column closest to the document tree identify the changes relative to the currently selected source. Here, the edit symbol ( ) indicates that the value in the target document, White, differs from that in the currently selected source (which happens to be Black in this example).

The first column of symbols characterize changes in the currently selected source relative to other source documents. Here, for example, the red exclamation point ( ) indicates that there are conflicting modifications in other source documents - that is, other source documents contain a value other than Black. As shown in Figure 139, when you click on a symbol in the first column, Stylus Studio displays

l A message describing the precise nature of the change
l A menu that identifies the documents in which the change occurs.

Clicking on a document in this menu changes the current focus to that source document, allowing you to easily navigate to the same node in a different document.

The additional symbols used by Stylus Studio when diffing multiple documents are described in Table 16.

Consider the example in Figure 140, which illustrates diffing three documents. In this example, the node in question is circled in red.

Notice that:

l source1.xml currently has focus.
l source1.xml and the target document node have the same value (<abc>)
l The node in question varies in both of the remaining source documents (it is <abc> in one and <abc> in the other).

Table 17 shows the symbols that might appear based on changing values to the node in question. The example illustrated in Figure 140 is shown in the first row. As values in the source documents change, Stylus Studio changes the diff symbol accordingly.

How to Diff Multiple Documents

To diff multiple documents:
1. Select Tools > Options > Show Differences > Files from the Stylus Studio menu.
Stylus Studio displays the XML Diff Viewer.
2. In the source document window, click the add button ( ) to add the first source document.
Stylus Studio displays the Open dialog box.
 
Free Stylus Studio XML Training: