changeset 240:38a4154c4537

Re #152: Test and fix extensibility of current schemas * Refactor army schema
author IBBoard <dev@ibboard.co.uk>
date Sat, 27 Feb 2010 14:31:14 +0000
parents 7c14537d4a23
children 50f845c117e9
files schemas/army.xsd
diffstat 1 files changed, 50 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/schemas/army.xsd	Tue Feb 23 21:00:23 2010 +0000
+++ b/schemas/army.xsd	Sat Feb 27 14:31:14 2010 +0000
@@ -1,4 +1,5 @@
 <?xml version="1.0"?>
+PENGUIN
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/army" xmlns="http://ibboard.co.uk/warfoundry/army" xmlns:core="http://ibboard.co.uk/warfoundry/core" elementFormDefault="qualified">
 <xs:element name="army">
 	<xs:complexType>
@@ -6,52 +7,7 @@
 			<xs:element name="units">
 				<xs:complexType>
 					<xs:sequence>
-						<xs:element name="unit" minOccurs="0" maxOccurs="unbounded">
-							<xs:complexType>
-								<xs:all>
-									<xs:element name="equipment" minOccurs="0">
-										<xs:complexType>
-											<xs:sequence>
-												<xs:element name="equipItem" maxOccurs="unbounded">
-													<xs:complexType>
-														<xs:sequence>
-															<xs:element ref="core:extension" minOccurs="0" />
-														</xs:sequence>
-														<xs:attribute name="id" type="xs:string" />
-														<xs:attribute name="amount" type="core:nonNegativeOrInfiniteIntegerOrPercentage" use="required"/>
-														<xs:attribute name="amountType" type="equipmentAmountType" default="ratio"/>
-														<xs:attribute name="isCustomEquipment" type="xs:boolean" default="false"/>
-														<xs:anyAttribute/>
-													</xs:complexType>
-												</xs:element>
-											</xs:sequence>
-										</xs:complexType>
-									</xs:element>
-									<xs:element name="contains" minOccurs="0">
-										<xs:complexType>
-											<xs:sequence>
-												<xs:element name="containedUnit">
-													<xs:complexType>
-														<xs:sequence>
-															<xs:element ref="core:extension" minOccurs="0" />
-														</xs:sequence>
-														<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
-														<xs:anyAttribute/>
-													</xs:complexType>
-												</xs:element>
-											</xs:sequence>
-										</xs:complexType>
-									</xs:element>
-									<xs:element ref="core:extension" minOccurs="0" />
-								</xs:all>
-								<xs:attribute name="id" type="xs:ID" />
-								<xs:attribute name="unitType" type="xs:string" use="required"/>
-								<xs:attribute name="unitName" type="xs:string" use="required"/>
-								<xs:attribute name="size" type="xs:positiveInteger" use="required"/>
-								<xs:attribute name="race" type="xs:string" default=""/>
-								<xs:anyAttribute/>
-							</xs:complexType>
-						</xs:element>
+						<xs:element name="unit" minOccurs="0" maxOccurs="unbounded" type="unit"/>
 					</xs:sequence>
 				</xs:complexType>
 			</xs:element>
@@ -88,6 +44,54 @@
 		<xs:anyAttribute/>
 	</xs:complexType>
 </xs:element>
+
+<!-- Re-usable complex types -->
+
+<xs:complexType id="unit">
+	<xs:all>
+		<xs:element name="equipment" minOccurs="0">
+			<xs:complexType>
+				<xs:sequence>
+					<xs:element name="equipItem" maxOccurs="unbounded">
+						<xs:complexType>
+							<xs:sequence>
+								<xs:element ref="core:extension" minOccurs="0" />
+							</xs:sequence>
+							<xs:attribute name="id" type="xs:string" />
+							<xs:attribute name="amount" type="core:nonNegativeOrInfiniteIntegerOrPercentage" use="required"/>
+							<xs:attribute name="amountType" type="equipmentAmountType" default="ratio"/>
+							<xs:attribute name="isCustomEquipment" type="xs:boolean" default="false"/>
+							<xs:anyAttribute/>
+						</xs:complexType>
+					</xs:element>
+				</xs:sequence>
+			</xs:complexType>
+		</xs:element>
+		<xs:element name="contains" minOccurs="0">
+			<xs:complexType>
+				<xs:sequence>
+					<xs:element name="containedUnit">
+						<xs:complexType>
+							<xs:sequence>
+								<xs:element ref="core:extension" minOccurs="0" />
+							</xs:sequence>
+							<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
+							<xs:anyAttribute/>
+						</xs:complexType>
+					</xs:element>
+				</xs:sequence>
+			</xs:complexType>
+		</xs:element>
+		<xs:element ref="core:extension" minOccurs="0" />
+	</xs:all>
+	<xs:attribute name="id" type="xs:ID" />
+	<xs:attribute name="unitType" type="xs:string" use="required"/>
+	<xs:attribute name="unitName" type="xs:string" use="required"/>
+	<xs:attribute name="size" type="xs:positiveInteger" use="required"/>
+	<xs:attribute name="race" type="xs:string" default=""/>
+	<xs:anyAttribute/>
+</xs:complexType>
+
 <xs:simpleType name="equipmentAmountType">
 	<xs:restriction base="xs:string">
 		<xs:enumeration value="ratio"/>