diff _test/Resources/resources.xsd @ 222:84a6382b49c8

resources schema in progress
author sergey
date Mon, 27 Aug 2012 17:28:32 +0400
parents e997e6fbac0b
children edf011437be8
line wrap: on
line diff
--- a/_test/Resources/resources.xsd	Fri Aug 24 16:24:14 2012 +0400
+++ b/_test/Resources/resources.xsd	Mon Aug 27 17:28:32 2012 +0400
@@ -5,16 +5,16 @@
 	<element name="resources">
 		<complexType>
 			<sequence>
-				<element name="root" type="tns:restResource" />
+				<element name="root" type="tns:resourceContract" />
 				<element name="typeMap" minOccurs="0">
 					<complexType>
 						<sequence>
-							<element name="item" maxOccurs="unbounded">
+							<element name="contract" maxOccurs="unbounded">
 								<complexType>
 									<complexContent>
-										<extension base="tns:restResource">
+										<extension base="tns:resourceContract">
 											<sequence></sequence>
-											<attribute name="type" type="string">
+											<attribute name="type" type="string" use="required">
 											</attribute>
 										</extension>
 									</complexContent>
@@ -30,7 +30,7 @@
 								<complexType>
 									<complexContent>
 										<extension base="tns:resourceLocator">
-											<attribute name="name" />
+											<attribute name="name" type="string" />
 										</extension>
 									</complexContent>
 								</complexType>
@@ -45,9 +45,9 @@
 			<field xpath="@ref" />
 		</keyref>
 		<key name="locator-key">
-            <selector xpath="tns:locators/tns:locator" />
-            <field xpath="@name" />
-        </key>
+			<selector xpath="tns:locators/tns:locator" />
+			<field xpath="@name" />
+		</key>
 	</element>
 
 	<!-- abstract types -->
@@ -55,25 +55,31 @@
 	<complexType name="abstractTransformation" abstract="true" />
 	<complexType name="abstractResult" abstract="true" />
 
-	<complexType name="restResource">
+	<complexType name="resourceContract">
 		<sequence>
-			<element name="get" type="tns:restOperation" minOccurs="0" />
-			<element name="post" type="tns:restOperation" minOccurs="0" />
-			<element name="put" type="tns:restOperation" minOccurs="0" />
-			<element name="delete" type="tns:restOperation" minOccurs="0" />
-			<element name="resource" maxOccurs="unbounded"
-				minOccurs="0" >
+			<group ref="tns:restOperations"></group>
+			<element name="resource" maxOccurs="unbounded" minOccurs="0">
 				<complexType>
-				    <complexContent>
-				        <extension base="tns:restResource">
-				        </extension>
-				    </complexContent>
+					<sequence>
+						<element name="contract" type="tns:resourceContract" />
+					</sequence>
+					<attribute name="name" type="string" />
 				</complexType>
-				</element>
+			</element>
 		</sequence>
 	</complexType>
 
-	<complexType name="restOperation">
+	<group name="restOperations">
+		<sequence>
+			<element name="get" type="tns:operationContract" minOccurs="0" />
+			<element name="post" type="tns:operationContract" minOccurs="0" />
+			<element name="put" type="tns:operationContract" minOccurs="0" />
+			<element name="delete" type="tns:operationContract"
+				minOccurs="0" />
+		</sequence>
+	</group>
+
+	<complexType name="operationContract">
 		<sequence>
 			<element name="bind" type="tns:methodBinding" />
 			<element name="parameters" type="tns:transformation"
@@ -87,7 +93,7 @@
 			<element name="var" type="tns:bindingVariable" minOccurs="0"
 				maxOccurs="unbounded" />
 		</sequence>
-		<attribute name="text" type="string" use="required" />
+		<attribute name="bind" type="string" use="required" />
 	</complexType>
 
 	<complexType name="bindingVariable">
@@ -119,7 +125,7 @@
 		</restriction>
 	</simpleType>
 
-	<complexType name="redirectResult">
+	<complexType name="redirectResponse">
 		<complexContent>
 			<extension base="tns:abstractResult">
 				<choice>