diff schemas/army.xsd @ 224:f097888efcfe

Fixes #233: "unitPoints" attribute is badly named * Rename "unitPoints" to "basePoints" * Re-order schema to more sensible name * Use new name in code when parsing XML (object property already has sensible name) Also: * Rename "dtds" folder to more accurate "schemas" * Change references to folder in code
author IBBoard <dev@ibboard.co.uk>
date Mon, 14 Dec 2009 20:50:39 +0000
parents
children 38a4154c4537
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/schemas/army.xsd	Mon Dec 14 20:50:39 2009 +0000
@@ -0,0 +1,97 @@
+<?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:element name="army">
+	<xs:complexType>
+		<xs:all>
+			<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:sequence>
+				</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:element ref="core:extension" minOccurs="0" />
+											</xs:sequence>
+											<xs:attribute name="partIDRef" type="xs:string" />
+											<xs:anyAttribute/>
+										</xs:complexType>
+									</xs:element>
+								</xs:sequence>
+								<xs:attribute name="id" type="xs:ID" />
+								<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="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:complexType>
+</xs:element>
+<xs:simpleType name="equipmentAmountType">
+	<xs:restriction base="xs:string">
+		<xs:enumeration value="ratio"/>
+		<xs:enumeration value="fixed"/>
+	</xs:restriction>
+</xs:simpleType>
+</xs:schema>
\ No newline at end of file