diff schemas/warfoundry-core.xsd @ 265:6fe0cb1bf74f

Re #279: Create composite limit * Change uses of "AbstractLimit" to "ILimit" as composites don't have a number themselves and can't extend AbstractLimit * Refactor limit parsing code out into a separate class * Use grouping to allow for re-use of limit types in schema * Add min and max composite limits in schema
author IBBoard <dev@ibboard.co.uk>
date Sat, 05 Jun 2010 15:36:04 +0000
parents 68af2cd41e2f
children a3c1bf57fd3f
line wrap: on
line diff
--- a/schemas/warfoundry-core.xsd	Sat Jun 05 14:00:28 2010 +0000
+++ b/schemas/warfoundry-core.xsd	Sat Jun 05 15:36:04 2010 +0000
@@ -9,6 +9,13 @@
 	</xs:complexType>
 </xs:element>
 <xs:complexType name="limit">
+	<xs:sequence>
+		<xs:group ref="limitElements" minOccurs="1" maxOccurs="1"/>
+		<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+	</xs:sequence>
+	<xs:anyAttribute processContents="lax"/>
+</xs:complexType>
+<xs:group name="limitElements">
 	<xs:choice>
 		<xs:element name="percentageLimit">
 			<xs:complexType>
@@ -46,10 +53,27 @@
 				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
+		<xs:element name="compositeMaxLimit">
+			<xs:complexType>
+				<xs:sequence>
+					<xs:group ref="limitElements" minOccurs="1" maxOccurs="unbounded"/>
+					<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+				</xs:sequence>
+				<xs:anyAttribute processContents="lax"/>
+			</xs:complexType>
+		</xs:element>
+		<xs:element name="compositeMinLimit">
+			<xs:complexType>
+				<xs:sequence>
+					<xs:group ref="limitElements" minOccurs="1" maxOccurs="unbounded"/>
+					<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+				</xs:sequence>
+				<xs:anyAttribute processContents="lax"/>
+			</xs:complexType>
+		</xs:element>
 		<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 	</xs:choice>
-	<xs:anyAttribute processContents="lax"/>
-</xs:complexType>
+</xs:group>
 <xs:simpleType name="positiveOrInfiniteInteger">
 	<xs:union memberTypes="xs:positiveInteger infinity"/>
 </xs:simpleType>