changeset 244:9e4a78464b1a

Re #152: Test and fix extensibility of current schemas * Make xs:anyAttribute and xs:any do lax parsing so that we don't get schema errors * Move Army schema away from core:extension to straight xs:any Needs more testing
author IBBoard <dev@ibboard.co.uk>
date Sun, 28 Feb 2010 21:09:45 +0000
parents b8883707c489
children bbd86698240a
files schemas/army.xsd schemas/race.xsd schemas/system.xsd
diffstat 3 files changed, 42 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/schemas/army.xsd	Sat Feb 27 15:03:18 2010 +0000
+++ b/schemas/army.xsd	Sun Feb 28 21:09:45 2010 +0000
@@ -19,28 +19,29 @@
 									<xs:element name="customEquipPart"  maxOccurs="unbounded">
 										<xs:complexType>
 											<xs:sequence>
-												<xs:element ref="core:extension" minOccurs="0" />
+												<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 											</xs:sequence>
 											<xs:attribute name="partIDRef" type="xs:string" />
-											<xs:anyAttribute/>
+											<xs:anyAttribute processContents="lax"/>
 										</xs:complexType>
 									</xs:element>
+									<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 								</xs:sequence>
 								<xs:attribute name="id" type="xs:ID" />
-								<xs:anyAttribute/>
+								<xs:anyAttribute processContents="lax"/>
 							</xs:complexType>
 						</xs:element>
 					</xs:sequence>
 				</xs:complexType>
 			</xs:element>
-			<xs:element ref="core:extension" minOccurs="0" />
+			<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 		</xs:all>
 		<xs:attribute name="id" type="xs:ID" />
 		<xs:attribute name="name" type="xs:string" use="required"/>
 		<xs:attribute name="system" type="xs:string" use="required"/>
 		<xs:attribute name="race" type="xs:string" use="required"/>
 		<xs:attribute name="maxPoints" type="xs:positiveInteger" use="required"/>
-		<xs:anyAttribute/>
+		<xs:anyAttribute processContents="lax"/>
 	</xs:complexType>
 </xs:element>
 
@@ -54,13 +55,13 @@
 					<xs:element name="equipItem" maxOccurs="unbounded">
 						<xs:complexType>
 							<xs:sequence>
-								<xs:element ref="core:extension" minOccurs="0" />
+								<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 							</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:anyAttribute processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
@@ -72,23 +73,23 @@
 					<xs:element name="containedUnit">
 						<xs:complexType>
 							<xs:sequence>
-								<xs:element ref="core:extension" minOccurs="0" />
+								<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 							</xs:sequence>
 							<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
-							<xs:anyAttribute/>
+							<xs:anyAttribute processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
 			</xs:complexType>
 		</xs:element>
-		<xs:element ref="core:extension" minOccurs="0" />
+		<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 	</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:anyAttribute processContents="lax"/>
 </xs:complexType>
 
 <xs:simpleType name="equipmentAmountType">
--- a/schemas/race.xsd	Sat Feb 27 15:03:18 2010 +0000
+++ b/schemas/race.xsd	Sun Feb 28 21:09:45 2010 +0000
@@ -21,24 +21,24 @@
 							<xs:complexType>
 								<xs:sequence>
 									<xs:element name="description" type="xs:string" />
-									<xs:any minOccurs="0" maxOccurs="unbounded"/>
+									<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 								</xs:sequence>
 								<xs:attribute name="id" type="xs:ID" use="required"/>
 								<xs:attribute name="name" type="xs:string" use="required"/>
-								<xs:anyAttribute/>
+								<xs:anyAttribute processContents="lax"/>
 							</xs:complexType>
 						</xs:element>
 					</xs:sequence>
-					<xs:anyAttribute/>
+					<xs:anyAttribute processContents="lax"/>
 				</xs:complexType>
 			</xs:element>
-			<xs:any minOccurs="0" maxOccurs="unbounded"/>
+			<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 		</xs:sequence>
 		<xs:attribute name="id" type="xs:ID" />
 		<xs:attribute name="subid" type="xs:string" default=""/>
 		<xs:attribute name="name" type="xs:string" use="required"/>
 		<xs:attribute name="system" type="xs:string" use="required"/>
-		<xs:anyAttribute/>
+		<xs:anyAttribute processContents="lax"/>
 	</xs:complexType>
 </xs:element>
 
@@ -53,10 +53,10 @@
 						<xs:complexType>
 							<xs:sequence>
 								<xs:element name="maxLimit" minOccurs="0" type="core:limit" />
-								<xs:any minOccurs="0" maxOccurs="unbounded"/>													
+								<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>													
 							</xs:sequence>
 							<xs:attribute name="name" type="xs:string" use="required"/>
-							<xs:anyAttribute/>
+							<xs:anyAttribute processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
@@ -74,7 +74,7 @@
 							<xs:sequence>
 								<xs:element name="minLimit" minOccurs="0" type="core:limit" />
 								<xs:element name="maxLimit" minOccurs="0" type="core:limit" />
-								<xs:any minOccurs="0" maxOccurs="unbounded"/>
+								<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 							</xs:sequence>
 							<xs:attribute name="id" type="xs:IDREF" />
 							<xs:attribute name="required" type="xs:boolean" default="false"/>
@@ -85,7 +85,7 @@
 							<xs:attribute name="roundDirection" type="core:updowntype" default="up"/>
 							<xs:attribute name="costMultiplier" type="core:nonNegativeDouble" default="1"/>
 							<xs:attribute name="costRounding" type="costroundingtype" default="UpToHalf"/>
-							<xs:anyAttribute/>
+							<xs:anyAttribute processContents="lax"/>
 						</xs:complexType>
 						<xs:keyref name="equipmentSlot" refer="equipSlotName">
 							<xs:selector xpath="."/>
@@ -93,7 +93,7 @@
 						</xs:keyref>
 					</xs:element>
 				</xs:sequence>
-				<xs:anyAttribute/>
+				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
 		<xs:element name="unitAbilities" minOccurs="0">
@@ -103,11 +103,11 @@
 						<xs:complexType>
 							<xs:attribute name="abilityID" type="xs:IDREF" />
 							<xs:attribute name="required" type="xs:boolean" default="true"/>
-							<xs:anyAttribute/>
+							<xs:anyAttribute processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
-				<xs:anyAttribute/>
+				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
 		<xs:element name="requirements" minOccurs="0">
@@ -118,13 +118,13 @@
 							<xs:simpleContent>
 								<xs:extension base="xs:string">
 									<xs:attribute name="requirementName" type="xs:string" use="required"/>
-									<xs:anyAttribute/>
+									<xs:anyAttribute processContents="lax"/>
 								</xs:extension>
 							</xs:simpleContent>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
-				<xs:anyAttribute/>
+				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
 		<xs:element name="contains" minOccurs="0">
@@ -133,11 +133,11 @@
 					<xs:element name="containedUnit" maxOccurs="unbounded">
 						<xs:complexType>
 							<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
-							<xs:anyAttribute/>
+							<xs:anyAttribute processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
-				<xs:anyAttribute/>
+				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
 		<xs:element name="extraData" minOccurs="0">
@@ -148,17 +148,17 @@
 							<xs:simpleContent>
 								<xs:extension base="xs:string">
 									<xs:attribute name="id" type="xs:ID" use="required"/>
-									<xs:anyAttribute/>
+									<xs:anyAttribute processContents="lax"/>
 								</xs:extension>
 							</xs:simpleContent>
 						</xs:complexType>
 					</xs:element>
 				</xs:sequence>
-				<xs:anyAttribute/>
+				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
 		<xs:element name="notes" type="xs:string" minOccurs="0" />
-		<xs:any minOccurs="0" maxOccurs="unbounded"/>
+		<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 	</xs:sequence>
 	<xs:attribute name="id" type="xs:ID" />
 	<xs:attribute name="typeName" type="xs:string" use="required"/>
@@ -170,7 +170,7 @@
 	<xs:attribute name="maxSize" type="core:positiveOrInfiniteInteger" default="-1"/>
 	<xs:attribute name="minNum" type="xs:nonNegativeInteger" default="0"/>
 	<xs:attribute name="maxNum" type="core:positiveOrInfiniteInteger" default="-1"/>
-	<xs:anyAttribute/>
+	<xs:anyAttribute processContents="lax"/>
 </xs:complexType>
 
 <xs:complexType name="stats">
@@ -180,14 +180,14 @@
 				<xs:simpleContent>
 					<xs:extension base="xs:string">
 						<xs:attribute name="name" type="xs:string" use="required"/>
-						<xs:anyAttribute/>
+						<xs:anyAttribute processContents="lax"/>
 					</xs:extension>
 				</xs:simpleContent>
 			</xs:complexType>
 		</xs:element>
 	</xs:sequence>
 	<xs:attribute name="statSet" type="xs:string" default="" />
-	<xs:anyAttribute/>
+	<xs:anyAttribute processContents="lax"/>
 </xs:complexType>
 
 <xs:complexType name="equipment">
@@ -196,17 +196,17 @@
 			<xs:complexType>
 				<xs:sequence>
 					<xs:element name="description" type="xs:string" minOccurs="0" />
-					<xs:any minOccurs="0" maxOccurs="unbounded"/>
+					<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 				</xs:sequence>
 				<xs:attribute name="id" type="xs:ID" use="required"/>
 				<xs:attribute name="name" type="xs:string" use="required"/>
 				<xs:attribute name="cost" type="core:nonNegativeNonInfiniteDouble" use="required"/>
 				<xs:attribute name="armourType" type="armourtype" default="None"/>
-				<xs:anyAttribute/>
+				<xs:anyAttribute processContents="lax"/>
 			</xs:complexType>
 		</xs:element>
 	</xs:sequence>
-	<xs:anyAttribute/>
+	<xs:anyAttribute processContents="lax"/>
 </xs:complexType>
 
 <!--Reusable simple types -->
--- a/schemas/system.xsd	Sat Feb 27 15:03:18 2010 +0000
+++ b/schemas/system.xsd	Sun Feb 28 21:09:45 2010 +0000
@@ -14,26 +14,26 @@
 									<xs:element name="sysStat" maxOccurs="unbounded">
 										<xs:complexType>
 											<xs:attribute name="name" type="xs:string" use="required"/>
-											<xs:anyAttribute/>
+											<xs:anyAttribute processContents="lax"/>
 										</xs:complexType>
 									</xs:element>
 								</xs:sequence>
 								<xs:attribute name="id" type="xs:ID" />
-								<xs:anyAttribute/>
+								<xs:anyAttribute processContents="lax"/>
 							</xs:complexType>
 						</xs:element>
 					</xs:sequence>
 					<xs:attribute name="defaultStats" type="xs:IDREF" use="required" />
-					<xs:anyAttribute/>
+					<xs:anyAttribute processContents="lax"/>
 				</xs:complexType>
 			</xs:element>
-			<xs:any minOccurs="0" maxOccurs="unbounded"/>
+			<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 		</xs:sequence>
 		<xs:attribute name="id" type="xs:ID" />
 		<xs:attribute name="name" type="xs:string" use="required"/>
 		<xs:attribute name="warn" type="xs:boolean" default="false"/>
 		<xs:attribute name="allowAllies" type="xs:boolean" default="true"/>
-		<xs:anyAttribute/>
+		<xs:anyAttribute processContents="lax"/>
 	</xs:complexType>
 </xs:element>
 </xs:schema>
\ No newline at end of file