view schemas/race.xsd @ 369:c2bc207a1571

Re #346: Add core schema support for requirements * Allow extra attributes * Remove unnecessary attribute (copy and paste error) * Be explicit about min count
author IBBoard <dev@ibboard.co.uk>
date Sat, 28 May 2011 16:02:36 +0000
parents 8cfb1818823d
children 376da2b24de1
line source
1 <?xml version="1.0"?>
2 <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"
3 targetNamespace="http://ibboard.co.uk/warfoundry/race" xmlns="http://ibboard.co.uk/warfoundry/race" xmlns:race="http://ibboard.co.uk/warfoundry/race" elementFormDefault="qualified">
4 <xs:element name="race">
5 <xs:complexType>
6 <xs:sequence>
7 <xs:element name="categories" type="cats:categoriestype" minOccurs="0">
8 <xs:key name="catsKey">
9 <xs:selector xpath="cats:cat"/>
10 <xs:field xpath="@id"/>
11 </xs:key>
12 </xs:element>
13 <xs:element name="units">
14 <xs:complexType>
15 <xs:sequence>
16 <xs:element name="unit" maxOccurs="unbounded" type="unit">
17 <xs:keyref name="equipSlotRef" refer="equipSlotKey">
18 <xs:selector xpath="race:unitEquipment/race:unitEquipmentItem"/>
19 <xs:field xpath="@equipmentSlot"/>
20 </xs:keyref>
21 <xs:key name="equipSlotKey">
22 <xs:selector xpath="race:equipmentSlots/race:equipmentSlot"/>
23 <xs:field xpath="@name"/>
24 </xs:key>
25 </xs:element>
26 </xs:sequence>
27 </xs:complexType>
28 </xs:element>
29 <xs:element name="equipment" minOccurs="0" type="equipment">
30 </xs:element>
31 <xs:element name="abilities" minOccurs="0">
32 <xs:complexType>
33 <xs:sequence>
34 <xs:element name="ability" maxOccurs="unbounded">
35 <xs:complexType>
36 <xs:sequence>
37 <xs:element name="description" type="xs:string" />
38 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
39 </xs:sequence>
40 <xs:attribute name="id" type="xs:string" use="required"/>
41 <xs:attribute name="name" type="xs:string" use="required"/>
42 <xs:anyAttribute processContents="lax"/>
43 </xs:complexType>
44 </xs:element>
45 </xs:sequence>
46 <xs:anyAttribute processContents="lax"/>
47 </xs:complexType>
48 </xs:element>
49 <xs:element name="memberTypes" minOccurs="0">
50 <xs:complexType>
51 <xs:sequence>
52 <xs:element name="memberType" maxOccurs="unbounded">
53 <xs:complexType>
54 <xs:sequence>
55 <xs:element name="stats" type="stats" minOccurs="0"/>
56 </xs:sequence>
57 <xs:attribute name="id" type="xs:string" use="required"/>
58 <xs:attribute name="name" type="xs:string" use="required"/>
59 <xs:anyAttribute processContents="lax"/>
60 </xs:complexType>
61 </xs:element>
62 </xs:sequence>
63 </xs:complexType>
64 </xs:element>
65 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
66 </xs:sequence>
67 <xs:attribute name="id" type="xs:string" use="required" />
68 <xs:attribute name="subid" type="xs:string" default=""/>
69 <xs:attribute name="name" type="xs:string" use="required"/>
70 <xs:attribute name="defaultArmyName" type="xs:string" default="" />
71 <xs:attribute name="system" type="xs:string" use="required"/>
72 <xs:anyAttribute processContents="lax"/>
73 </xs:complexType>
74 <xs:keyref name="memberTypeRef" refer="memberTypeKey">
75 <xs:selector xpath="race:units/race:unit/race:unitMembers/race:unitMember"/>
76 <xs:field xpath="@typeID"/>
77 </xs:keyref>
78 <xs:key name="memberTypeKey">
79 <xs:selector xpath="race:memberTypes/race:memberType"/>
80 <xs:field xpath="@id"/>
81 </xs:key>
82 <xs:keyref name="abilityRef" refer="abilityKey">
83 <xs:selector xpath="race:units/race:unit/race:unitAbilities/race:unitAbility"/>
84 <xs:field xpath="@abilityID"/>
85 </xs:keyref>
86 <xs:key name="abilityKey">
87 <xs:selector xpath="race:abilities/race:ability"/>
88 <xs:field xpath="@id"/>
89 </xs:key>
90 <xs:keyref name="equipmentItemRef" refer="equipmentItemKey">
91 <xs:selector xpath="race:units/race:unit/race:unitEquipment/race:unitEquipmentItem"/>
92 <xs:field xpath="@id"/>
93 </xs:keyref>
94 <xs:key name="equipmentItemKey">
95 <xs:selector xpath="race:equipment/race:equipmentItem"/>
96 <xs:field xpath="@id"/>
97 </xs:key>
98 <xs:keyref name="containedUnitRef" refer="unitKey">
99 <xs:selector xpath="race:units/race:unit/race:contains/race:containedUnit"/>
100 <xs:field xpath="@containedID"/>
101 </xs:keyref>
102 <xs:key name="unitKey">
103 <xs:selector xpath="race:units/race:unit"/>
104 <xs:field xpath="@id"/>
105 </xs:key>
106 </xs:element>
108 <!--Reusable complex types -->
109 <xs:complexType name="unit">
110 <xs:sequence>
111 <xs:element name="stats" type="stats" minOccurs="0"/>
112 <xs:element name="equipmentSlots" minOccurs="0">
113 <xs:complexType>
114 <xs:sequence>
115 <xs:element name="equipmentSlot" maxOccurs="unbounded">
116 <xs:complexType>
117 <xs:sequence>
118 <xs:element name="maxLimit" type="core:limit" />
119 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
120 </xs:sequence>
121 <xs:attribute name="name" type="xs:string" use="required"/>
122 <xs:anyAttribute processContents="lax"/>
123 </xs:complexType>
124 </xs:element>
125 </xs:sequence>
126 </xs:complexType>
127 </xs:element>
128 <xs:element name="unitEquipment" minOccurs="0">
129 <xs:complexType>
130 <xs:sequence>
131 <xs:element name="unitEquipmentItem" maxOccurs="unbounded">
132 <xs:complexType>
133 <xs:sequence>
134 <xs:element name="minLimit" minOccurs="0" type="core:limit" />
135 <xs:element name="maxLimit" minOccurs="0" type="core:limit" />
136 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
137 </xs:sequence>
138 <xs:attribute name="id" type="xs:string" use="required" />
139 <xs:attribute name="required" type="xs:boolean" default="false"/>
140 <!-- exclusivityGroup is deprecated in favour of the comma-separated exclusivityGroups -->
141 <xs:attribute name="exclusivityGroup" type="xs:string" default=""/>
142 <xs:attribute name="exclusivityGroups" type="xs:string" default=""/>
143 <xs:attribute name="equipmentSlot" type="xs:string"/>
144 <xs:attribute name="roundDirection" type="core:updowntype" default="up"/>
145 <xs:attribute name="costMultiplier" type="core:nonNegativeDouble" default="1"/>
146 <xs:attribute name="costRounding" type="costroundingtype" default="UpToHalf"/>
147 <xs:anyAttribute processContents="lax"/>
148 </xs:complexType>
149 </xs:element>
150 </xs:sequence>
151 <xs:anyAttribute processContents="lax"/>
152 </xs:complexType>
153 </xs:element>
154 <xs:element name="unitAbilities" minOccurs="0">
155 <xs:complexType>
156 <xs:sequence>
157 <xs:element name="unitAbility" maxOccurs="unbounded">
158 <xs:complexType>
159 <xs:sequence>
160 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
161 </xs:sequence>
162 <xs:attribute name="abilityID" type="xs:string" />
163 <xs:attribute name="required" type="xs:boolean" default="true"/>
164 <xs:anyAttribute processContents="lax"/>
165 </xs:complexType>
166 </xs:element>
167 </xs:sequence>
168 <xs:anyAttribute processContents="lax"/>
169 </xs:complexType>
170 </xs:element>
171 <xs:element name="requirements" minOccurs="0">
172 <xs:complexType>
173 <xs:sequence>
174 <xs:element name="requirement">
175 <xs:complexType>
176 <xs:sequence>
177 <xs:element name="data" minOccurs="0" maxOccurs="1">
178 <xs:complexType>
179 <xs:simpleContent>
180 <xs:extension base="xs:string">
181 <xs:anyAttribute processContents="lax"/>
182 </xs:extension>
183 </xs:simpleContent>
184 </xs:complexType>
185 </xs:element>
186 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
187 </xs:sequence>
188 <xs:attribute name="requirementName" type="xs:string" use="required"/>
189 <xs:anyAttribute processContents="lax"/>
190 </xs:complexType>
191 </xs:element>
192 </xs:sequence>
193 <xs:anyAttribute processContents="lax"/>
194 </xs:complexType>
195 </xs:element>
196 <xs:element name="contains" minOccurs="0">
197 <xs:complexType>
198 <xs:sequence>
199 <xs:element name="containedUnit" maxOccurs="unbounded">
200 <xs:complexType>
201 <xs:sequence>
202 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
203 </xs:sequence>
204 <xs:attribute name="containedID" type="xs:string" use="required"/>
205 <xs:anyAttribute processContents="lax"/>
206 </xs:complexType>
207 </xs:element>
208 </xs:sequence>
209 <xs:anyAttribute processContents="lax"/>
210 </xs:complexType>
211 </xs:element>
212 <xs:element name="extraData" minOccurs="0">
213 <xs:complexType>
214 <xs:sequence>
215 <xs:element name="data" maxOccurs="unbounded">
216 <xs:complexType>
217 <xs:simpleContent>
218 <xs:extension base="xs:string">
219 <xs:attribute name="id" type="xs:string" use="required"/>
220 <xs:anyAttribute processContents="lax"/>
221 </xs:extension>
222 </xs:simpleContent>
223 </xs:complexType>
224 </xs:element>
225 </xs:sequence>
226 <xs:anyAttribute processContents="lax"/>
227 </xs:complexType>
228 <xs:key name="extraDataKey">
229 <xs:selector xpath="race:data"/>
230 <xs:field xpath="@id"/>
231 </xs:key>
232 </xs:element>
233 <xs:element name="unitMembers" minOccurs="0">
234 <xs:complexType>
235 <xs:sequence>
236 <xs:element name="unitMember" maxOccurs="unbounded">
237 <xs:complexType>
238 <xs:sequence>
239 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
240 </xs:sequence>
241 <xs:attribute name="typeID" type="xs:string" use="required"/>
242 <xs:anyAttribute processContents="lax"/>
243 </xs:complexType>
244 </xs:element>
245 </xs:sequence>
246 </xs:complexType>
247 </xs:element>
248 <xs:element name="unitCategories" minOccurs="0">
249 <xs:complexType>
250 <xs:sequence>
251 <xs:element name="unitCategory" maxOccurs="unbounded">
252 <xs:complexType>
253 <xs:sequence>
254 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
255 </xs:sequence>
256 <xs:attribute name="catID" type="xs:string" use="required"/>
257 <xs:anyAttribute processContents="lax"/>
258 </xs:complexType>
259 </xs:element>
260 </xs:sequence>
261 </xs:complexType>
262 </xs:element>
263 <xs:element name="notes" type="xs:string" minOccurs="0" />
264 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
265 </xs:sequence>
266 <xs:attribute name="id" type="xs:string" use="required" />
267 <xs:attribute name="typeName" type="xs:string" use="required"/>
268 <xs:attribute name="cat" type="xs:string" use="required"/>
269 <xs:attribute name="points" type="core:nonNegativeNonInfiniteDouble" use="required"/>
270 <xs:attribute name="basePoints" type="core:nonNegativeNonInfiniteDouble" default="0"/>
271 <xs:attribute name="baseSize" type="xs:nonNegativeInteger" default="0"/>
272 <xs:attribute name="minSize" type="xs:nonNegativeInteger" default="5"/>
273 <xs:attribute name="maxSize" type="core:positiveOrInfiniteInteger" default="-1"/>
274 <xs:attribute name="minNum" type="xs:nonNegativeInteger" default="0"/>
275 <xs:attribute name="maxNum" type="core:positiveOrInfiniteInteger" default="-1"/>
276 <xs:anyAttribute processContents="lax"/>
277 </xs:complexType>
279 <xs:complexType name="stats">
280 <xs:sequence>
281 <xs:element name="stat" maxOccurs="unbounded">
282 <xs:complexType>
283 <xs:simpleContent>
284 <xs:extension base="xs:string">
285 <xs:attribute name="name" type="xs:string" use="required"/>
286 <xs:anyAttribute processContents="lax"/>
287 </xs:extension>
288 </xs:simpleContent>
289 </xs:complexType>
290 </xs:element>
291 </xs:sequence>
292 <xs:attribute name="statSet" type="xs:string" default="" />
293 <xs:anyAttribute processContents="lax"/>
294 </xs:complexType>
296 <xs:complexType name="equipment">
297 <xs:sequence>
298 <xs:element name="equipmentItem" maxOccurs="unbounded">
299 <xs:complexType>
300 <xs:sequence>
301 <xs:element name="description" type="xs:string" minOccurs="0" />
302 <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
303 </xs:sequence>
304 <xs:attribute name="id" type="xs:string" use="required"/>
305 <xs:attribute name="name" type="xs:string" use="required"/>
306 <xs:attribute name="cost" type="core:nonNegativeNonInfiniteDouble" use="required"/>
307 <xs:anyAttribute processContents="lax"/>
308 </xs:complexType>
309 </xs:element>
310 </xs:sequence>
311 <xs:anyAttribute processContents="lax"/>
312 </xs:complexType>
314 <!--Reusable simple types -->
315 <xs:simpleType name="costroundingtype">
316 <xs:restriction base="xs:string">
317 <xs:enumeration value="Up"/>
318 <xs:enumeration value="Down"/>
319 <xs:enumeration value="Banker"/>
320 <xs:enumeration value="UpToHalf"/>
321 <xs:enumeration value="DownToHalf"/>
322 <xs:enumeration value="BankerToHalf"/>
323 </xs:restriction>
324 </xs:simpleType>
325 </xs:schema>