Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2003-07-07 12:32:26 +0000
committerAndre Weinand2003-07-07 12:32:26 +0000
commitc63ddb9178a8247c61a2df1a0de4d0c7b0e4bf2e (patch)
tree68d2eb9e7b76099ab3d4f98de67a2c7109ef42c8 /examples
parent5903f07b5b000839484caea19b92b6ea43165f0c (diff)
downloadeclipse.platform.team-c63ddb9178a8247c61a2df1a0de4d0c7b0e4bf2e.tar.gz
eclipse.platform.team-c63ddb9178a8247c61a2df1a0de4d0c7b0e4bf2e.tar.xz
eclipse.platform.team-c63ddb9178a8247c61a2df1a0de4d0c7b0e4bf2e.zip
added schema file
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.compare.examples.xml/plugin.xml6
-rw-r--r--examples/org.eclipse.compare.examples.xml/schema/idMapping.exsd209
-rw-r--r--examples/org.eclipse.compare.examples.xml/schema/preferencePages.xsd77
3 files changed, 214 insertions, 78 deletions
diff --git a/examples/org.eclipse.compare.examples.xml/plugin.xml b/examples/org.eclipse.compare.examples.xml/plugin.xml
index ae5130985..4dbb97726 100644
--- a/examples/org.eclipse.compare.examples.xml/plugin.xml
+++ b/examples/org.eclipse.compare.examples.xml/plugin.xml
@@ -23,7 +23,11 @@
</runtime>
<!-- Extensions -->
- <extension-point id="idMapping" name="%idMapping"/>
+ <extension-point
+ id="idMapping"
+ name="%idMapping"
+ schema="schema/idMapping.exsd"
+ />
<!-- Extension points -->
<extension
diff --git a/examples/org.eclipse.compare.examples.xml/schema/idMapping.exsd b/examples/org.eclipse.compare.examples.xml/schema/idMapping.exsd
new file mode 100644
index 000000000..ace351953
--- /dev/null
+++ b/examples/org.eclipse.compare.examples.xml/schema/idMapping.exsd
@@ -0,0 +1,209 @@
+<?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 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>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ the name of the ID Mapping scheme. Should be unique.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="idMap">
+ <complexType>
+ <sequence>
+ <element ref="mapping" minOccurs="1" maxOccurs="unbounded"/>
+ </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>
+ &lt;p&gt;
+&lt;a href=&quot;hglegal.htm&quot;&gt;
+ &lt;img SRC=&quot;ngibmcpy.gif&quot; ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot; BORDER=0 height=14 width=324&gt;
+&lt;/a&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/examples/org.eclipse.compare.examples.xml/schema/preferencePages.xsd b/examples/org.eclipse.compare.examples.xml/schema/preferencePages.xsd
deleted file mode 100644
index 1d63422a8..000000000
--- a/examples/org.eclipse.compare.examples.xml/schema/preferencePages.xsd
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.compare.xml">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.compare.xml" id="preferencePages" name="%ExtPoint.preferencePages"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point]
- </documentation>
-</annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>

Back to the top