changeset 277:c7a95912c1e8

Re #290: Migrate to using key/keyref definitions instead of ID/IDREF type * Migrate army containership to key/keyref
author IBBoard <dev@ibboard.co.uk>
date Sun, 04 Jul 2010 20:03:32 +0000
parents d576034ad1dd
children c1d55ea8a2a1
files schemas/army.xsd
diffstat 1 files changed, 12 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/schemas/army.xsd	Sun Jul 04 19:10:33 2010 +0000
+++ b/schemas/army.xsd	Sun Jul 04 20:03:32 2010 +0000
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
-<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:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/army"
+xmlns="http://ibboard.co.uk/warfoundry/army" xmlns:army="http://ibboard.co.uk/warfoundry/army" xmlns:core="http://ibboard.co.uk/warfoundry/core" elementFormDefault="qualified">
 <xs:element name="army">
 	<xs:complexType>
 		<xs:sequence>
@@ -10,31 +11,14 @@
 					</xs:sequence>
 					<xs:anyAttribute processContents="lax"/>
 				</xs:complexType>
-			</xs:element>
-			<xs:element name="customEquipment" minOccurs="0">
-				<xs:complexType>
-					<xs:sequence>
-						<xs:element name="customEquip" minOccurs="0" maxOccurs="unbounded">
-							<xs:complexType>
-								<xs:sequence>
-									<xs:element name="customEquipPart"  maxOccurs="unbounded">
-										<xs:complexType>
-											<xs:sequence>
-												<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
-											</xs:sequence>
-											<xs:attribute name="partIDRef" type="xs:string" />
-											<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 processContents="lax"/>
-							</xs:complexType>
-						</xs:element>
-					</xs:sequence>
-					<xs:anyAttribute processContents="lax"/>
-				</xs:complexType>
+				<xs:keyref name="containedUnitRef" refer="unitKey">
+					<xs:selector xpath="army:unit/army:contains/army:containedUnit"/>
+					<xs:field xpath="@containedID"/>
+				</xs:keyref>
+				<xs:key name="unitKey">
+					<xs:selector xpath="army:unit"/>
+					<xs:field xpath="@id"/>
+				</xs:key>
 			</xs:element>
 			<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 		</xs:sequence>
@@ -62,7 +46,6 @@
 							<xs:attribute name="id" type="xs:string" use="required" />
 							<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 processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
@@ -78,7 +61,7 @@
 							<xs:sequence>
 								<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 							</xs:sequence>
-							<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
+							<xs:attribute name="containedID" type="xs:string" use="required"/>
 							<xs:anyAttribute processContents="lax"/>
 						</xs:complexType>
 					</xs:element>
@@ -87,7 +70,7 @@
 		</xs:element>
 		<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
 	</xs:sequence>
-	<xs:attribute name="id" type="xs:ID" />
+	<xs:attribute name="id" type="xs:string" use="required" />
 	<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"/>