idMapping

Identifier: org.eclipse.compare.examples.xml.idMapping

Description: This extension point allows to define internal XML ID Mapping schemes using the mapping element. These schemes can then be used when performing an XML compare to uniquely identify XML elements by the value of an attribute or the text in a child element.
Additionally, ordered elements can be used to specify that the direct children of an element should be compared in ordered fashion instead of the default unordered way.

Configuration Markup:

   <!ELEMENT idmap (mapping*)>
   <!ATTLIST idmap
      name       CDATA #REQUIRED
      extension  CDATA
   >


   <!ELEMENT mapping EMPTY>
   <!ATTLIST mapping
      signature  CDATA #REQUIRED
      id         CDATA #REQUIRED
      id-source  CDATA
   >


   <!ELEMENT ordered EMPTY>
   <!ATTLIST ordered
      signature  CDATA #REQUIRED
   >

Examples:
The following is an example ID Mappings Scheme for ANT files.
project elements are identified by an attribute name. target elements (which are children of project) are also identified by an attribute name. Also, the children of target will be compared in the order in which they appear in the document.

<idmap name="ANT">
     <mapping signature="project" id="name"/>
     <mapping signature="project>target" id="name"/>
     <ordered signature="project>target"/>
<idmap>

The following example illustrates a case where the text of a child element is used as id:

<idmap name="Book Catalog" extension="book">
     <mapping signature="catalog>book" id="isbn" id-source="body"/>
<idmap>

Supplied Implementation:
The XML Compare plugin defines an ID Mapping scheme for Eclipse plugin.xml files, one for .classpath files and one for ANT files.