changeset 22:28e99aa0053f

Re #34 - Migrate WarFoundry files to using Schemas * Rename WarFoundry-cats.xml to .xsd * Use "all" tag in System instead of "sequence" * Complete Race schema
author IBBoard <dev@ibboard.co.uk>
date Mon, 09 Mar 2009 20:45:45 +0000
parents 1e18de815472
children f9846f896df3
files dtds/race.xsd dtds/system.xsd dtds/warfoundry-cats.xml dtds/warfoundry-cats.xsd
diffstat 4 files changed, 145 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/dtds/race.xsd	Sat Mar 07 20:47:32 2009 +0000
+++ b/dtds/race.xsd	Mon Mar 09 20:45:45 2009 +0000
@@ -3,12 +3,12 @@
 targetNamespace="http://ibboard.co.uk/warfoundry/race" xmlns="http://ibboard.co.uk/warfoundry/race" elementFormDefault="qualified">
 <xs:element name="race">
   <xs:complexType>
-    <xs:sequence>
-      <xs:element name="units" type="unitstype"/>
+    <xs:all>
+      <xs:element name="units" type="unitstype" minOccurs="1"/>
       <xs:element name="categories" type="cats:categoriestype" />
       <xs:element name="equipment" type="equipmenttype" />
       <xs:element name="abilities" type="abilitiestype" />
-    </xs:sequence>
+    </xs:all>
     <xs:attribute name="id" type="xs:ID" />
     <xs:attribute name="subid" type="xs:string" default=""/>
     <xs:attribute name="name" type="xs:string" use="required"/>
@@ -21,14 +21,15 @@
   </xs:sequence>
 </xs:complexType>
 <xs:complexType name="unittype">
-  <xs:sequence>
-    <xs:element name="unitCats" type="unitcatstype"/>
-    <xs:element name="stats" type="statstype" />
+  <xs:all>
+    <xs:element name="stats" type="statstype" minOccurs="1" />
     <xs:element name="unitEquipment" type="unitequipmenttype" />
+    <xs:element name="unitAbilities" type="unitabilitiestype" />
     <xs:element name="requirements" type="requirementstype" />
     <xs:element name="contains" type="containstype" />
-    <xs:element name="requirements" type="requirementstype" />
-  </xs:sequence>
+    <xs:element name="extraData" type="extradatatype" />
+    <xs:element name="notes" type="xsd:string" />
+  </xs:all>
   <xs:attribute name="id" type="xs:ID" />
   <xs:attribute name="typeName" type="xs:string" use="required"/>
   <xs:attribute name="cat" type="xs:string" use="required"/>
@@ -51,4 +52,119 @@
   </xs:simpleContent>
   <xs:attribute name="name" type="xs:string" use="required"/>
 </xs:complexType>
+<xs:complexType name="unitequipmenttype">
+  <xs:sequence>
+    <xs:element name="unitEquipmentItem" type="unitequipmentitemtype" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="unitequipmentitemtype">
+  <xs:attribute name="equipID" type="xs:IDREF" />
+  <xs:attribute name="required" type="xs:boolean" default="false"/>
+  <xs:attribute name="exclusivityGroup" type="xs:string" default=""/>
+  <xs:attribute name="minNumber" type="core:infiniteOrNonNegativeInteger" default="-1"/>
+  <xs:attribute name="maxNumber" type="core:infiniteOrNonNegativeInteger" default="-1"/>
+  <xs:attribute name="minPercentage" type="core:percentage" default="100"/>
+  <xs:attribute name="maxPercentage" type="core:percentage" default="100"/>
+  <xs:attribute name="roundDirection" type="updowntype" default="up"/>
+</xs:complexType>
+<xs:complexType name="unitabilitiestype">
+  <xs:sequence>
+    <xs:element name="unitAbility" type="unitabilitytype" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="unitabilitytype">
+  <xs:attribute name="abilityID" type="xs:IDREF" />
+  <xs:attribute name="required" type="xs:boolean" default="true"/>
+</xs:complexType>
+<xs:simpleType name="updowntype">
+  <xs:restriction base="xs:string">
+    <xs:enumeration value="up"/>
+    <xs:enumeration value="down"/>
+  </xs:restriction>
+</xs:simpleType>
+<xs:complexType name="requirementstype">
+  <xs:sequence>
+    <xs:element name="requirement" type="requirementtype"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="requirementtype">
+  <xs:simpleContent>
+    <xs:extension base="xs:string"/>
+  </xs:simpleContent>
+  <xs:attribute name="requirementName" type="xs:string" use="required"/>
+</xs:complexType>
+<xs:complexType name="containstype">
+  <xs:sequence>
+    <xs:element name="containedUnit" type="containedunittype"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="containedunittype">
+  <xs:attribute name="containedID" type="xs:IDREF" use="required"/>
+</xs:complexType>
+<xs:complexType name="extradatatype">
+  <xs:sequence>
+    <xs:element name="data" type="extradatadatatype"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="extradatadatatype">
+  <xs:simpleContent>
+    <xs:extension base="xs:string"/>
+  </xs:simpleContent>
+  <xs:attribute name="id" type="xs:ID" use="required"/>
+</xs:complexType>
+<xs:complexType name="equipmenttype">
+  <xs:sequence>
+    <xs:element name="equipmentItem" type="equipmentitemtype"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="equipmentitemtype">
+  <xs:all>
+    <xs:element name="description" type="xsd:string" />
+  </xs:all>
+  <xs:attribute name="id" type="xs:ID" use="required"/>
+  <xs:attribute name="name" type="xs:string" use="required"/>
+  <xs:attribute name="points" type="core:nonNegativeDecimal" use="required"/>
+</xs:complexType>
+<xs:complexType name="equipmenttype">
+  <xs:sequence>
+    <xs:element name="equipmentItem" type="equipmentitemtype"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="equipmentitemtype">
+  <xs:all>
+    <xs:element name="description" type="xsd:string" />
+  </xs:all>
+  <xs:attribute name="id" type="xs:ID" use="required"/>
+  <xs:attribute name="name" type="xs:string" use="required"/>
+  <xs:attribute name="points" type="core:nonNegativeDecimal" use="required"/>
+  <xs:attribute name="armoutType" type="armourtype" default="none"/>
+</xs:complexType>
+<xs:simpleType name="armourtype">
+  <xs:restriction base="xsd:string">
+    <xs:enumeration value="None"/>
+    <xs:enumeration value="Shield"/>
+    <xs:enumeration value="LightArmour"/>
+    <xs:enumeration value="LightArmourShield"/>
+    <xs:enumeration value="HeavyArmour"/>
+    <xs:enumeration value="HeavyArmourShield"/>
+    <xs:enumeration value="Barding"/>
+    <xs:enumeration value="BardingShield"/>
+    <xs:enumeration value="BardingLightArmour"/>
+    <xs:enumeration value="BardingLightArmourShield"/>
+    <xs:enumeration value="BardingHeavyArmour"/>
+    <xs:enumeration value="BardingHeavyArmourShield"/>
+  </xs:restriction>
+</xs:simpleType>
+<xs:complexType name="abilitiestype">
+  <xs:sequence>
+    <xs:element name="ability" type="abilitytype"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="abilitytype">
+  <xs:all>
+    <xs:element name="description" type="xsd:string" />
+  </xs:all>
+  <xs:attribute name="id" type="xs:ID" use="required"/>
+  <xs:attribute name="name" type="xs:string" use="required"/>
+</xs:complexType>
 </xs:schema>
\ No newline at end of file
--- a/dtds/system.xsd	Sat Mar 07 20:47:32 2009 +0000
+++ b/dtds/system.xsd	Mon Mar 09 20:45:45 2009 +0000
@@ -3,10 +3,10 @@
 targetNamespace="http://ibboard.co.uk/warfoundry/system" xmlns="http://ibboard.co.uk/warfoundry/system" elementFormDefault="qualified">
 <xs:element name="system">
   <xs:complexType>
-    <xs:sequence>
-      <xs:element name="categories" type="cats:categoriestype"/>
-      <xs:element name="sysStatsList" type="statslisttype"/>
-    </xs:sequence>
+    <xs:all>
+      <xs:element name="categories" type="cats:categoriestype" minOccurs="1"/>
+      <xs:element name="sysStatsList" type="statslisttype" minOccurs="1"/>
+    </xs:all>
     <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"/>
--- a/dtds/warfoundry-cats.xml	Sat Mar 07 20:47:32 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/cats"
-xmlns="http://ibboard.co.uk/warfoundry/cats"elementFormDefault="qualified">
-<xs:complexType name="categoriestype">
-  <xs:sequence>
-    <xs:element name="cat" type="cattype" minOccurs="1" maxOccurs="unbounded"/>
-  </xs:sequence>
-</xs:complexType>
-<xs:complexType name="cattype">
-  <xs:attribute name="id" type="xs:ID" />   
-  <xs:attribute name="name" type="xs:string" use="required"/>
-  <xs:attribute name="minPoints" type="core:nonNegativeDecimal" default="0"/>
-  <xs:attribute name="maxPoints" type="core:infiniteOrNonNegativeDecimal" default="-1"/>
-  <xs:attribute name="minPercentage" type="core:percentage" default="0"/>
-  <xs:attribute name="maxPercentage" type="core:percentage" default="100"/>
-</xs:complexType>
-</xs:schema>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtds/warfoundry-cats.xsd	Mon Mar 09 20:45:45 2009 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/cats"
+xmlns="http://ibboard.co.uk/warfoundry/cats"elementFormDefault="qualified">
+<xs:complexType name="categoriestype">
+  <xs:sequence>
+    <xs:element name="cat" type="cattype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="cattype">
+  <xs:attribute name="id" type="xs:ID" />   
+  <xs:attribute name="name" type="xs:string" use="required"/>
+  <xs:attribute name="minPoints" type="core:nonNegativeDecimal" default="0"/>
+  <xs:attribute name="maxPoints" type="core:infiniteOrNonNegativeDecimal" default="-1"/>
+  <xs:attribute name="minPercentage" type="core:percentage" default="0"/>
+  <xs:attribute name="maxPercentage" type="core:percentage" default="100"/>
+</xs:complexType>
+</xs:schema>
\ No newline at end of file