About character and entity translation

Rational® ClearCase® XML Diff Merge appropriately translates and escapes special markup characters, for example, XML predefined entities like the less than symbol (<), greater than symbol (>), quotation mark ("), apostrophe ('), and ampersand (&). This allows you to see and deal with the actual characters in the display and editor.

For example, if you type <foo> in a text node, it displays as <foo>. However, when the merge output is written, the text is correctly escaped as &lt;foo&gt;. Or, when editing, you could type &lt;foo&gt; and see <foo> in the display.

But how do you type a predefined entity like &amp; in a text node so that it is displayed as &amp; in the display? This "escape" problem is common in SGML and XML applications.

The solution is to enter &amp;amp;. The first sequence is translated to &, followed by amp;. The displayed result is &amp;.

Of course, the next time you edit the file, the source will contain &amp;, which would be translated to &. To fix the display, you would have to reapply the escape sequence.


Feedback