changeset 160:41b927998a41

Re #152: Test and fix extensibility of current schemas * Fix use of <xs:any> by defining <core:extension> tag * Remove unnecessary min/maxOccurs=1 attributes
author IBBoard <dev@ibboard.co.uk>
date Sun, 04 Oct 2009 10:49:17 +0000
parents 7b98e71b8511
children 81abc04b3dbe
files dtds/army.xsd dtds/race.xsd dtds/system.xsd dtds/warfoundry-core.xsd
diffstat 4 files changed, 31 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/dtds/army.xsd	Wed Sep 30 19:08:08 2009 +0000
+++ b/dtds/army.xsd	Sun Oct 04 10:49:17 2009 +0000
@@ -3,22 +3,22 @@
 <xs:element name="army">
 	<xs:complexType>
 		<xs:all>
-			<xs:element name="units" minOccurs="1">
+			<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" maxOccurs="1">
+									<xs:element name="equipment" minOccurs="0">
 										<xs:complexType>
 											<xs:sequence>
-												<xs:element name="equipItem" minOccurs="1" maxOccurs="unbounded">
+												<xs:element name="equipItem" maxOccurs="unbounded">
 													<xs:complexType>
 														<xs:sequence>
-															<xs:any minOccurs="0" />
+															<xs:element ref="core:extension" minOccurs="0" />
 														</xs:sequence>
-														<xs:attribute name="id" type="xs:string" /> <!-- ID reference to either a custom equipment item or a Race equipment item -->
-														<xs:attribute name="amount" type="core:nonNegativeOrInfiniteIntegerOrPercentage" use="required"/><!-- Double used to allow for percentages to be stored -->
+														<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/>
@@ -33,7 +33,7 @@
 												<xs:element name="containedUnit">
 													<xs:complexType>
 														<xs:sequence>
-															<xs:any minOccurs="0" />
+															<xs:element ref="core:extension" minOccurs="0" />
 														</xs:sequence>
 														<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
 														<xs:anyAttribute/>
@@ -42,7 +42,7 @@
 											</xs:sequence>
 										</xs:complexType>
 									</xs:element>
-									<xs:any minOccurs="0" />
+									<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"/>
@@ -61,10 +61,10 @@
 						<xs:element name="customEquip" minOccurs="0" maxOccurs="unbounded">
 							<xs:complexType>
 								<xs:sequence>
-									<xs:element name="customEquipPart" minOccurs="1" maxOccurs="unbounded">
+									<xs:element name="customEquipPart"  maxOccurs="unbounded">
 										<xs:complexType>
 											<xs:sequence>
-												<xs:any minOccurs="0" />
+												<xs:element ref="core:extension" minOccurs="0" />
 											</xs:sequence>
 											<xs:attribute name="partIDRef" type="xs:string" />
 											<xs:anyAttribute/>
@@ -78,7 +78,7 @@
 					</xs:sequence>
 				</xs:complexType>
 			</xs:element>
-			<xs:any minOccurs="0" />
+			<xs:element ref="core:extension" minOccurs="0" />
 		</xs:all>
 		<xs:attribute name="id" type="xs:ID" />
 		<xs:attribute name="name" type="xs:string" use="required"/>
--- a/dtds/race.xsd	Wed Sep 30 19:08:08 2009 +0000
+++ b/dtds/race.xsd	Sun Oct 04 10:49:17 2009 +0000
@@ -4,16 +4,16 @@
 <xs:element name="race">
 	<xs:complexType>
 		<xs:all>
-			<xs:element name="units" minOccurs="1">
+			<xs:element name="units">
 				<xs:complexType>
 					<xs:sequence>
-						<xs:element name="unit" minOccurs="1" maxOccurs="unbounded">
+						<xs:element name="unit" maxOccurs="unbounded">
 							<xs:complexType>
 								<xs:all>
-									<xs:element name="stats" minOccurs="1">
+									<xs:element name="stats">
 										<xs:complexType>
 											<xs:sequence>
-												<xs:element name="stat" minOccurs="1" maxOccurs="unbounded">
+												<xs:element name="stat" maxOccurs="unbounded">
 													<xs:complexType>
 														<xs:simpleContent>
 															<xs:extension base="xs:string">
@@ -114,7 +114,7 @@
 										</xs:complexType>
 									</xs:element>
 									<xs:element name="notes" type="xs:string" minOccurs="0" />
-									<xs:any minOccurs="0" />
+									<xs:element ref="core:extension" minOccurs="0" />
 								</xs:all>
 								<xs:attribute name="id" type="xs:ID" />
 								<xs:attribute name="typeName" type="xs:string" use="required"/>
@@ -140,7 +140,7 @@
 							<xs:complexType>
 								<xs:all>
 									<xs:element name="description" type="xs:string" minOccurs="0" />
-									<xs:any minOccurs="0" />
+									<xs:element ref="core:extension" minOccurs="0" />
 								</xs:all>
 								<xs:attribute name="id" type="xs:ID" use="required"/>
 								<xs:attribute name="name" type="xs:string" use="required"/>
@@ -160,7 +160,7 @@
 							<xs:complexType>
 								<xs:all>
 									<xs:element name="description" type="xs:string" />
-									<xs:any minOccurs="0" />
+									<xs:element ref="core:extension" minOccurs="0" />
 								</xs:all>
 								<xs:attribute name="id" type="xs:ID" use="required"/>
 								<xs:attribute name="name" type="xs:string" use="required"/>
@@ -171,7 +171,7 @@
 					<xs:anyAttribute/>
 				</xs:complexType>
 			</xs:element>
-			<xs:any minOccurs="0" />
+			<xs:element ref="core:extension" minOccurs="0" />
 		</xs:all>
 		<xs:attribute name="id" type="xs:ID" />
 		<xs:attribute name="subid" type="xs:string" default=""/>
--- a/dtds/system.xsd	Wed Sep 30 19:08:08 2009 +0000
+++ b/dtds/system.xsd	Sun Oct 04 10:49:17 2009 +0000
@@ -4,14 +4,14 @@
 <xs:element name="system">
 	<xs:complexType>
 		<xs:all>
-			<xs:element name="categories" type="cats:categoriestype" minOccurs="1"/>
-			<xs:element name="sysStatsList" minOccurs="1">
+			<xs:element name="categories" type="cats:categoriestype"/>
+			<xs:element name="sysStatsList">
 				<xs:complexType>
 					<xs:sequence>
-						<xs:element name="sysStats" minOccurs="1" maxOccurs="unbounded">
+						<xs:element name="sysStats" maxOccurs="unbounded">
 							<xs:complexType>
 								<xs:sequence>
-									<xs:element name="sysStat" minOccurs="1" maxOccurs="unbounded">
+									<xs:element name="sysStat" maxOccurs="unbounded">
 										<xs:complexType>
 											<xs:attribute name="name" type="xs:string" use="required"/>
 											<xs:anyAttribute/>
@@ -27,7 +27,7 @@
 					<xs:anyAttribute/>
 				</xs:complexType>
 			</xs:element>
-			<xs:any minOccurs="0" />
+			<xs:element ref="core:extension" minOccurs="0" />
 		</xs:all>
 		<xs:attribute name="id" type="xs:ID" />
 		<xs:attribute name="name" type="xs:string" use="required"/>
--- a/dtds/warfoundry-core.xsd	Wed Sep 30 19:08:08 2009 +0000
+++ b/dtds/warfoundry-core.xsd	Sun Oct 04 10:49:17 2009 +0000
@@ -1,6 +1,13 @@
 <?xml version="1.0"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/core"
 xmlns="http://ibboard.co.uk/warfoundry/core" elementFormDefault="qualified">
+<xs:element name="extension">
+	<xs:complexType>
+		<xs:sequence>
+			<xs:any minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+	</xs:complexType>
+	</xs:element>
 <xs:simpleType name="positiveOrInfiniteInteger">
 	<xs:union memberTypes="xs:positiveInteger infinity"/>
 </xs:simpleType>