Skip to main content
summaryrefslogtreecommitdiffstats
blob: 3ab94afd3decc1414cc75a023c5630f8f8e2510d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.compare.examples.xml">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.compare.examples.xml" id="idMapping" name="XML Id Mapping"/>
      </appInfo>
      <documentation>
         This extension point allows to define internal XML ID Mapping schemes using the &lt;i&gt;mapping&lt;/i&gt; 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, &lt;i&gt;ordered&lt;/i&gt; elements can be used to specify that the direct children of an element
should be compared in an ordered fashion instead of the default unordered way.
      </documentation>
   </annotation>

   <element name="extension">
      <complexType>
         <sequence>
            <element ref="idMap" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified identifier of the target extension point
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  an optional identifier of the extension instance
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  an optional name of the extension instance.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="idMap">
      <complexType>
         <sequence>
            <element ref="mapping"/>
            <element ref="ordered"/>
         </sequence>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the ID Mapping scheme. Should be unique.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="extension" type="string">
            <annotation>
               <documentation>
                  a file extension associated with this ID Mapping Scheme.
When comparing files with this extension, the current ID Mapping
Scheme will automatically be used. 
If an extension is specified, then the extension should also be added
in the plugin.xml file of the XML Compare Plugin. For example, if we
create an ID Mapping Scheme with extension cd, the plugin.xml of the
XML Compare Plugin is updated as follows (update shown in bold): 
&lt;p&gt;
&lt;pre&gt;
&lt;extension 
ÊÊÊÊÊÊpoint=&quot;org.eclipse.compare.structureMergeViewers&quot;&gt; 
 &lt;structureMergeViewer 
ÊÊÊÊÊÊÊÊÊextensions=&quot;xml,classpath,cd&quot;
ÊÊÊÊÊÊÊÊÊclass=&quot;org.eclipse.compare.xml.XMLStructureViewerCreator&quot;
 /&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Warning: If an extension is associated more than once, only the first
association will be considered. Also, internal ID Mapping schemes have
priority over user ID Mapping schemes when duplicate extensions are defined. 
&lt;/p&gt;
&lt;p&gt;
Warning: When an internal ID Mapping scheme with extension association is
removed (from a plugin.xml ), the XML Compare plugin has to be reloaded
to disassociate itself from the extension. If not, on the first compare
of files with this extension, the XML Compare plugin will be used with
the default Unordered algorithm. (However, at this point the extension
will have been disassociated from the XML Plugin, as the plugin has been loaded.)
&lt;/p&gt;
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="mapping">
      <complexType>
         <attribute name="signature" type="string" use="required">
            <annotation>
               <documentation>
                  the XML path from the root to the current element (see examples below).
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  the attribute that identifies this element or the name of the child element whose text identifies this element.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id-source" type="string">
            <annotation>
               <documentation>
                  if id is the name of a child element, then this attribute must have the value body.
If id-source is left out, it is assumed that id is an attribute.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="ordered">
      <complexType>
         <attribute name="signature" type="string" use="required">
            <annotation>
               <documentation>
                  the XML path from the root to the element whose direct children will be
compared in ordered fashion instead of the default unordered way.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appInfo>
         <meta.section type="since"/>
      </appInfo>
      <documentation>
         3.0.0
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
         The following is an example ID Mappings Scheme for ANT files. 
&lt;i&gt;project&lt;/i&gt; elements are identified by an &lt;i&gt;attribute name&lt;/i&gt;. &lt;i&gt;target&lt;/i&gt; elements (which are children of &lt;i&gt;project&lt;/i&gt;) are also identified by an attribute &lt;i&gt;name&lt;/i&gt;. Also, the children of &lt;i&gt;target&lt;/i&gt; will be compared in the order in which they appear in the document.
&lt;p&gt;
&lt;pre&gt;
&lt;extension point = &quot;org.eclipse.compare.examples.xml.idMapping&quot;&gt; 
 &lt;idmap name=&quot;ANT&quot;&gt;
  &lt;mapping signature=&quot;project&quot; id=&quot;name&quot;/&gt;
  &lt;mapping signature=&quot;project&gt;target&quot; id=&quot;name&quot;/&gt;
  &lt;ordered signature=&quot;project&gt;target&quot;/&gt;
 &lt;idmap&gt;
&lt;/extension&gt; 
&lt;/pre&gt;
&lt;/p&gt;
The following example illustrates a case where the text of a child element is used as the id:
&lt;p&gt;
&lt;pre&gt;
&lt;extension point = &quot;org.eclipse.compare.examples.xml.idMapping&quot;&gt; 
 &lt;idmap name=&quot;Book Catalog&quot; extension=&quot;book&quot;&gt;
  &lt;mapping signature=&quot;catalog&gt;book&quot; id=&quot;isbn&quot; id-source=&quot;body&quot;/&gt;
 &lt;idmap&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         [Enter API information here.]
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         The XML Compare plugin defines an ID Mapping scheme for Eclipse &lt;samp&gt;plugin.xml&lt;/samp&gt; files, one for &lt;samp&gt;.classpath&lt;/samp&gt; files and one for Ant files.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2000, 2003 IBM Corporation and others.&lt;br&gt;
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
      </documentation>
   </annotation>

</schema>

Back to the top