changeset 21:1e18de815472

Re #32 - Migrate WarFoundry to schemas * Add "WarFoundry-Core" schema to define numerical types with -1 taking a special value * Add "WarFoundry-Cats" to store common category definition between race and system * Add full system schema * Add partial implementation of race schema Re #34 - Remove choices and base/increment * "WarFoundry-Cats" schema only includes min/max points and percentage
author IBBoard <dev@ibboard.co.uk>
date Sat, 07 Mar 2009 20:47:32 +0000
parents b7c93a5821cd
children 28e99aa0053f
files dtds/race.xsd dtds/system.xsd dtds/warfoundry-cats.xml dtds/warfoundry-core.xsd
diffstat 4 files changed, 126 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtds/race.xsd	Sat Mar 07 20:47:32 2009 +0000
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:core="http://ibboard.co.uk/warfoundry/core" xmlns:cats="http://ibboard.co.uk/warfoundry/cats"
+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:element name="categories" type="cats:categoriestype" />
+      <xs:element name="equipment" type="equipmenttype" />
+      <xs:element name="abilities" type="abilitiestype" />
+    </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:complexType>
+</xs:element>
+<xs:complexType name="unitstype">
+  <xs:sequence>
+    <xs:element name="unit" type="unittype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="unittype">
+  <xs:sequence>
+    <xs:element name="unitCats" type="unitcatstype"/>
+    <xs:element name="stats" type="statstype" />
+    <xs:element name="unitEquipment" type="unitequipmenttype" />
+    <xs:element name="requirements" type="requirementstype" />
+    <xs:element name="contains" type="containstype" />
+    <xs:element name="requirements" type="requirementstype" />
+  </xs:sequence>
+  <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"/>
+  <xs:attribute name="unitPoints" type="core:nonNegativeDecimal" default="0"/>
+  <xs:attribute name="points" type="core:nonNegativeDecimal" use="required"/>
+  <xs:attribute name="minNumber" type="core:nonNegativeInteger" default="0"/>
+  <xs:attribute name="maxNumber" type="core:infiniteOrNonNegativeInteger" default="-1"/>
+  <xs:attribute name="minSize" type="core:positiveInteger" default="5"/>
+  <xs:attribute name="maxSize" type="core:infiniteOrNonNegativeInteger" default="-1"/>
+  <xs:attribute name="baseSize" type="xsd:nonNegativeInteger" default="0"/>
+</xs:complexType>
+<xs:complexType name="statstype">
+  <xs:sequence>
+    <xs:element name="stat" type="stattype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="stattype">
+  <xs:simpleContent>
+    <xs:extension base="xs:string"/>
+  </xs:simpleContent>
+  <xs:attribute name="name" type="xs:string" use="required"/>
+</xs:complexType>
+</xs:schema>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtds/system.xsd	Sat Mar 07 20:47:32 2009 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:core="http://ibboard.co.uk/warfoundry/core" xmlns:cats="http://ibboard.co.uk/warfoundry/cats"
+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: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:complexType>
+</xs:element>
+<xs:complexType name="statslisttype">
+  <xs:sequence>
+    <xs:element name="sysStats" type="sysstatstype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+</xs:complexType>
+<xs:complexType name="sysstatstype">
+  <xs:sequence>
+    <xs:element name="sysStat" type="sysstattype" minOccurs="1" maxOccurs="unbounded"/>
+  </xs:sequence>
+  <xs:attribute name="id" type="xs:ID" />   
+</xs:complexType>
+<xs:complexType name="sysstattype">
+  <xs:attribute name="name" type="xs:string" use="required"/>
+</xs:complexType>
+</xs:schema>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtds/warfoundry-cats.xml	Sat Mar 07 20:47:32 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtds/warfoundry-core.xsd	Sat Mar 07 20:47:32 2009 +0000
@@ -0,0 +1,25 @@
+<?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:simpleType name="infiniteOrNonNegativeDecimal">
+  <xs:restriction base="xs:decimal">
+    <xs:minInclusive value="-1"/>
+  </xs:restriction>
+</xs:simpleType>
+<xs:simpleType name="infiniteOrNonNegativeInteger">
+  <xs:restriction base="xs:integer">
+    <xs:minInclusive value="-1"/>
+  </xs:restriction>
+</xs:simpleType>
+<xs:simpleType name="nonNegativeDecimal">
+  <xs:restriction base="xs:decimal">
+    <xs:minInclusive value="0"/>
+  </xs:restriction>
+</xs:simpleType>
+<xs:simpleType name="percentage">
+  <xs:restriction base="xs:decimal">
+    <xs:minInclusive value="0"/>
+    <xs:maxInclusive value="100"/>
+  </xs:restriction>
+</xs:simpleType>
+</xs:schema>
\ No newline at end of file