About node types

Your XML data is displayed as a tree of nodes. Table 1 describes the types of nodes that are defined in Rational® ClearCase® XML Diff Merge.

Table 1. Node types
Node Description
XML declaration The XML declaration is required if the encoding is not UTF-8 or UTF-16. Otherwise, it is optional. The node is non-editable, but any attributes and attribute values are editable.
Doctype and entity declarations The parser used by XML Diff Merge is nonvalidating, and a DTD declaration is optional unless the document contains any user-defined external entity references. In this case, the declaration is required, although the DTD need not be present and is not parsed, and external entities are not translated on edit.

The doctype node is editable.

Element An XML element.

The contents of elements, including data and other elements, are represented as subnodes.

Matching: XML Diff Merge represents element attributes and their values as separate subnodes. Because elements with different names are different node types, element names are not changeable; elements and attribute/value pairs can only be added, deleted, or moved.

Text (PCDATA)

PCDATA between start and end element tags. Nodes that contain only whitespace are considered to be text nodes. Text nodes are editable.

CDATA Editable sections containing embedded markup that are escaped as is. For example, CDATA sections enable you to display special characters like < and >. Special characters and entity references are not translated on edit.
Comment An XML comment, similar to a text node. Also editable.
Processing instruction target The identifier that immediately follows the <? lexeme.
Processing instructions (PI) data The processing instruction data, including whitespace, between the target and the closing ?> lexeme.
Attribute name The attribute name is always a child of its element node. It is not editable.

Matching: Attributes can be added or deleted, but not changed, because any difference in name indicates a different attribute.

Thus, attributes must have the same parent in order to match.

XML Diff Merge preserves the order of attribute/value pairs. Thus, any difference in ordering between contributors is shown as a move.

Attribute value The attribute value is always the child of an attribute name node. It is an editable node.

Matching: Attribute names always have a child value node, even if empty. Therefore, inserts and deletes cannot occur. Attribute name/value pairs are tightly bound: there is only one attribute value per attribute name, and moves are not considered meaningful. Different attributes with the same value are considered to be separate attributes, not a move from one attribute to another.


Feedback