SCR 1.1 schema of OSGi 4.2 cmpdm draft  20090310
diff --git a/modeling/plugins/org.eclipse.pde.ds/build.properties b/modeling/plugins/org.eclipse.pde.ds/build.properties
index cb057e7..453ef7a 100644
--- a/modeling/plugins/org.eclipse.pde.ds/build.properties
+++ b/modeling/plugins/org.eclipse.pde.ds/build.properties
@@ -7,14 +7,15 @@
 # Contributors:
 #     Anyware Technologies - initial API and implementation
 #
-# $Id$
+# $Id: build.properties,v 1.1 2009/02/12 17:06:39 bcabe Exp $
 
 bin.includes = .,\
                META-INF/,\
                plugin.xml,\
                model/scr-1.1.ecore,\
                model/scr-1.1.genmodel,\
-               plugin.properties
+               plugin.properties,\
+               model/scr-1.1.xsd
 jars.compile.order = .
 source.. = src/
 output.. = bin/
diff --git a/modeling/plugins/org.eclipse.pde.ds/model/scr-1.1.xsd b/modeling/plugins/org.eclipse.pde.ds/model/scr-1.1.xsd
index 948c121..d93fa16 100644
--- a/modeling/plugins/org.eclipse.pde.ds/model/scr-1.1.xsd
+++ b/modeling/plugins/org.eclipse.pde.ds/model/scr-1.1.xsd
@@ -1,96 +1,193 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<xsd:schema xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ecore:nsPrefix="scr" ecore:package="org.eclipse.pde.ds.scr" targetNamespace="http://www.osgi.org/xmlns/scr/v1.1.0">
-  <xsd:import namespace="http://www.eclipse.org/emf/2002/Ecore" schemaLocation="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.xsd"/>
-  <xsd:element ecore:ignore="true" name="component" type="scr:component"/>
-  <xsd:element ecore:ignore="true" name="Implementation" type="scr:Implementation"/>
-  <xsd:element ecore:ignore="true" name="Properties" type="scr:Properties"/>
-  <xsd:element ecore:ignore="true" name="Service" type="scr:Service"/>
-  <xsd:element ecore:ignore="true" name="Provide" type="scr:Provide"/>
-  <xsd:element ecore:ignore="true" name="Reference" type="scr:Reference"/>
-  <xsd:complexType ecore:name="component" mixed="true" name="component">
-    <xsd:sequence>
-      <xsd:element name="implementation" type="scr:Implementation"/>
-      <xsd:choice ecore:featureMap="allProperties" maxOccurs="unbounded">
-        <xsd:element ecore:lowerBound="0" ecore:upperBound="-1" name="property" type="scr:Property"/>
-        <xsd:element ecore:lowerBound="0" ecore:upperBound="-1" name="properties" type="scr:Properties"/>
-      </xsd:choice>
-      <xsd:element minOccurs="0" name="service" type="scr:Service"/>
-      <xsd:element maxOccurs="unbounded" minOccurs="0" name="reference" type="scr:Reference"/>
-    </xsd:sequence>
-    <xsd:attribute default="true" name="enabled" type="ecore:EBoolean"/>
-    <xsd:attribute name="factory" type="ecore:EString"/>
-    <xsd:attribute name="immediate" type="ecore:EBoolean"/>
-    <xsd:attribute name="name" type="ecore:EString"/>
-    <xsd:attribute name="activate" type="ecore:EString"/>
-    <xsd:attribute name="deactivate" type="ecore:EString"/>
-    <xsd:attribute name="modified" type="ecore:EString"/>
-    <xsd:attribute default="optional" ecore:name="configurationPolicy" ecore:unsettable="false" name="configuration-policy" type="scr:ConfigurationPolicy"/>
-  </xsd:complexType>
-  <xsd:complexType name="Implementation">
-    <xsd:attribute name="class" type="ecore:EString" use="required"/>
-  </xsd:complexType>
-  <xsd:complexType ecore:constraints="isValueConsistent" name="Property">
-    <xsd:simpleContent>
-      <xsd:extension base="xsd:string">
-        <xsd:attribute name="name" type="xsd:string" use="required"/>
-        <xsd:attribute default="String" name="type" type="scr:JavaType"/>
-        <xsd:attribute ecore:name="value1" name="value" type="xsd:string"/>
-      </xsd:extension>
-    </xsd:simpleContent>
-  </xsd:complexType>
-  <xsd:complexType name="Properties">
-    <xsd:attribute name="entry" type="ecore:EString" use="required"/>
-  </xsd:complexType>
-  <xsd:complexType name="Service">
-    <xsd:sequence>
-      <xsd:element maxOccurs="unbounded" name="provide" type="scr:Provide"/>
-    </xsd:sequence>
-    <xsd:attribute default="false" name="servicefactory" type="xsd:boolean"/>
-  </xsd:complexType>
-  <xsd:complexType name="Provide">
-    <xsd:attribute ecore:type="ecore:EJavaClass{?}" name="interface" type="ecore:EJavaClass" use="required"/>
-  </xsd:complexType>
-  <xsd:complexType name="Reference">
-    <xsd:attribute name="bind" type="ecore:EString"/>
-    <xsd:attribute default="1..1" name="cardinality" type="scr:Cardinality"/>
-    <xsd:attribute name="interface" type="ecore:EString" use="required"/>
-    <xsd:attribute name="name" type="ecore:EString"/>
-    <xsd:attribute default="static" name="policy" type="scr:Policy"/>
-    <xsd:attribute name="target" type="xsd:string"/>
-    <xsd:attribute name="unbind" type="ecore:EString"/>
-  </xsd:complexType>
-  <xsd:simpleType name="Policy">
-    <xsd:restriction base="xsd:string">
-      <xsd:enumeration value="static"/>
-      <xsd:enumeration value="dynamic"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-  <xsd:simpleType name="Cardinality">
-    <xsd:restriction base="xsd:string">
-      <xsd:enumeration ecore:name="_0_1" value="0..1"/>
-      <xsd:enumeration ecore:name="_0_N" value="0..n"/>
-      <xsd:enumeration ecore:name="_1_1" value="1..1"/>
-      <xsd:enumeration ecore:name="_1_N" value="1..n"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-  <xsd:simpleType name="ConfigurationPolicy">
-    <xsd:restriction base="xsd:string">
-      <xsd:enumeration value="optional"/>
-      <xsd:enumeration value="require"/>
-      <xsd:enumeration value="ignore"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-  <xsd:simpleType name="JavaType">
-    <xsd:restriction base="xsd:string">
-      <xsd:enumeration value="String"/>
-      <xsd:enumeration value="Long"/>
-      <xsd:enumeration value="Double"/>
-      <xsd:enumeration value="Float"/>
-      <xsd:enumeration value="Integer"/>
-      <xsd:enumeration value="Byte"/>
-      <xsd:enumeration value="Character"/>
-      <xsd:enumeration value="Boolean"/>
-      <xsd:enumeration value="Short"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
+	targetNamespace="http://www.osgi.org/xmlns/scr/v1.1.0"
+	elementFormDefault="unqualified" attributeFormDefault="unqualified"
+	version="1.1.0">
+	<annotation>
+		<documentation xml:lang="en">
+			This is the XML Schema for component descriptions used by
+			the Service Component Runtime (SCR). Component description
+			documents may be embedded in other XML documents. SCR will
+			process all XML documents listed in the Service-Component
+			manifest header of a bundle. XML documents containing
+			component descriptions may contain a single, root component
+			element or one or more component elements embedded in a
+			larger document. Use of the name space for component
+			descriptions is mandatory. The attributes and subelements
+			of a component element are always unqualified.
+		</documentation>
+	</annotation>
+	<element name="component" type="scr:Tcomponent" />
+	<complexType name="Tcomponent">
+		<sequence>
+			<annotation>
+				<documentation xml:lang="en">
+					Implementations of SCR must not require component
+					descriptions to specify the subelements of the component
+					element in the order as required by the schema. SCR
+					implementations must allow other orderings since
+					arbitrary orderings do not affect the meaning of the
+					component description. Only the relative ordering of
+					property and properties element have meaning.
+				</documentation>
+			</annotation>
+			<choice minOccurs="0" maxOccurs="unbounded">
+				<element name="property" type="scr:Tproperty" />
+				<element name="properties" type="scr:Tproperties" />
+			</choice>
+			<element name="service" type="scr:Tservice" minOccurs="0"
+				maxOccurs="1" />
+			<element name="reference" type="scr:Treference" minOccurs="0"
+				maxOccurs="unbounded" />
+			<element name="implementation" type="scr:Timplementation"
+				minOccurs="1" maxOccurs="1" />
+			<any namespace="##any" processContents="lax" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="enabled" type="boolean" default="true" use="optional" />
+		<attribute name="name" type="token" use="optional">
+			<annotation>
+				<documentation xml:lang="en">
+					The default value of this attribute is the value of
+					the class attribute of the nested implementation
+					element. If multiple component elements use the same
+					value for the class attribute of their nested
+					implementation element, then using the default value
+					for this attribute will result in duplicate names.
+					In this case, this attribute must be specified with
+					a unique value.
+				</documentation>
+			</annotation>
+		</attribute>
+		<attribute name="factory" type="string" use="optional" />
+		<attribute name="immediate" type="boolean" use="optional" />
+		<attribute name="configuration-policy" type="scr:Tconfiguration-policy"
+			default="optional" use="optional" />
+		<attribute name="activate" type="token" use="optional"
+			default="activate" />
+		<attribute name="deactivate" type="token" use="optional"
+			default="deactivate" />
+		<anyAttribute />
+	</complexType>
+	<complexType name="Timplementation">
+		<sequence>
+			<any namespace="##any" processContents="lax" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="class" type="token" use="required" />
+		<anyAttribute />
+	</complexType>
+	<complexType name="Tproperty">
+		<simpleContent>
+			<extension base="string">
+				<attribute name="name" type="string" use="required" />
+				<attribute name="value" type="string" use="optional" />
+				<attribute name="type" type="scr:Tjava-types" default="String"
+					use="optional" />
+				<anyAttribute />
+			</extension>
+		</simpleContent>
+	</complexType>
+	<complexType name="Tproperties">
+		<sequence>
+			<any namespace="##any" processContents="lax" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="entry" type="string" use="required" />
+	</complexType>
+	<complexType name="Tservice">
+		<sequence>
+			<element name="provide" type="scr:Tprovide" minOccurs="1"
+				maxOccurs="unbounded" />
+			<!--
+				It is non-deterministic, per W3C XML Schema 1.0:
+				http://www.w3.org/TR/xmlschema-1/#cos-nonambig to use name
+				space="##any" below.
+			-->
+			<any namespace="##other" processContents="lax" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="servicefactory" type="boolean" default="false"
+			use="optional" />
+		<anyAttribute />
+	</complexType>
+	<complexType name="Tprovide">
+		<sequence>
+			<any namespace="##any" processContents="lax" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="interface" type="token" use="required" />
+		<anyAttribute />
+	</complexType>
+	<complexType name="Treference">
+		<sequence>
+			<any namespace="##any" processContents="lax" minOccurs="0"
+				maxOccurs="unbounded" />
+		</sequence>
+		<attribute name="name" type="token" use="optional">
+			<annotation>
+				<documentation xml:lang="en">
+					The default value of this attribute is the value of
+					the interface attribute of this element. If multiple
+					instances of this element within a component element
+					use the same value for the interface attribute, then
+					using the default value for this attribute will result
+					in duplicate names. In this case, this attribute
+					must be specified with a unique value.
+				</documentation>
+			</annotation>
+		</attribute>
+		<attribute name="interface" type="token" use="required" />
+		<attribute name="cardinality" type="scr:Tcardinality"
+			default="1..1" use="optional" />
+		<attribute name="policy" type="scr:Tpolicy" default="static"
+			use="optional" />
+		<attribute name="target" type="string" use="optional" />
+		<attribute name="bind" type="token" use="optional" />
+		<attribute name="unbind" type="token" use="optional" />
+		<anyAttribute />
+	</complexType>
+	<simpleType name="Tjava-types">
+		<restriction base="string">
+			<enumeration value="String" />
+			<enumeration value="Long" />
+			<enumeration value="Double" />
+			<enumeration value="Float" />
+			<enumeration value="Integer" />
+			<enumeration value="Byte" />
+			<enumeration value="Character" />
+			<enumeration value="Boolean" />
+			<enumeration value="Short" />
+		</restriction>
+	</simpleType>
+	<simpleType name="Tcardinality">
+		<restriction base="string">
+			<enumeration value="0..1" />
+			<enumeration value="0..n" />
+			<enumeration value="1..1" />
+			<enumeration value="1..n" />
+		</restriction>
+	</simpleType>
+	<simpleType name="Tpolicy">
+		<restriction base="string">
+			<enumeration value="static" />
+			<enumeration value="dynamic" />
+		</restriction>
+	</simpleType>
+	<simpleType name="Tconfiguration-policy">
+		<restriction base="string">
+			<enumeration value="optional" />
+			<enumeration value="require" />
+			<enumeration value="ignore" />
+		</restriction>
+	</simpleType>
+	<attribute name="must-understand" type="boolean">
+		<annotation>
+			<documentation xml:lang="en">
+				This attribute should be used by extensions to documents
+				to require that the document consumer understand the
+				extension. This attribute must be qualified when used.
+			</documentation>
+		</annotation>
+	</attribute>
+</schema>
\ No newline at end of file