changeset 160:41b927998a41

Re #152: Test and fix extensibility of current schemas * Fix use of <xs:any> by defining <core:extension> tag * Remove unnecessary min/maxOccurs=1 attributes
author IBBoard <dev@ibboard.co.uk>
date Sun, 04 Oct 2009 10:49:17 +0000
parents 7b98e71b8511
children 81abc04b3dbe
files dtds/army.xsd dtds/race.xsd dtds/system.xsd dtds/warfoundry-core.xsd
diffstat 4 files changed, 31 insertions(+), 24 deletions(-) [+]
line diff
     1.1 --- a/dtds/army.xsd	Wed Sep 30 19:08:08 2009 +0000
     1.2 +++ b/dtds/army.xsd	Sun Oct 04 10:49:17 2009 +0000
     1.3 @@ -3,22 +3,22 @@
     1.4  <xs:element name="army">
     1.5  	<xs:complexType>
     1.6  		<xs:all>
     1.7 -			<xs:element name="units" minOccurs="1">
     1.8 +			<xs:element name="units">
     1.9  				<xs:complexType>
    1.10  					<xs:sequence>
    1.11  						<xs:element name="unit" minOccurs="0" maxOccurs="unbounded">
    1.12  							<xs:complexType>
    1.13  								<xs:all>
    1.14 -									<xs:element name="equipment" minOccurs="0" maxOccurs="1">
    1.15 +									<xs:element name="equipment" minOccurs="0">
    1.16  										<xs:complexType>
    1.17  											<xs:sequence>
    1.18 -												<xs:element name="equipItem" minOccurs="1" maxOccurs="unbounded">
    1.19 +												<xs:element name="equipItem" maxOccurs="unbounded">
    1.20  													<xs:complexType>
    1.21  														<xs:sequence>
    1.22 -															<xs:any minOccurs="0" />
    1.23 +															<xs:element ref="core:extension" minOccurs="0" />
    1.24  														</xs:sequence>
    1.25 -														<xs:attribute name="id" type="xs:string" /> <!-- ID reference to either a custom equipment item or a Race equipment item -->
    1.26 -														<xs:attribute name="amount" type="core:nonNegativeOrInfiniteIntegerOrPercentage" use="required"/><!-- Double used to allow for percentages to be stored -->
    1.27 +														<xs:attribute name="id" type="xs:string" />
    1.28 +														<xs:attribute name="amount" type="core:nonNegativeOrInfiniteIntegerOrPercentage" use="required"/>
    1.29  														<xs:attribute name="amountType" type="equipmentAmountType" default="ratio"/>
    1.30  														<xs:attribute name="isCustomEquipment" type="xs:boolean" default="false"/>
    1.31  														<xs:anyAttribute/>
    1.32 @@ -33,7 +33,7 @@
    1.33  												<xs:element name="containedUnit">
    1.34  													<xs:complexType>
    1.35  														<xs:sequence>
    1.36 -															<xs:any minOccurs="0" />
    1.37 +															<xs:element ref="core:extension" minOccurs="0" />
    1.38  														</xs:sequence>
    1.39  														<xs:attribute name="containedID" type="xs:IDREF" use="required"/>
    1.40  														<xs:anyAttribute/>
    1.41 @@ -42,7 +42,7 @@
    1.42  											</xs:sequence>
    1.43  										</xs:complexType>
    1.44  									</xs:element>
    1.45 -									<xs:any minOccurs="0" />
    1.46 +									<xs:element ref="core:extension" minOccurs="0" />
    1.47  								</xs:all>
    1.48  								<xs:attribute name="id" type="xs:ID" />
    1.49  								<xs:attribute name="unitType" type="xs:string" use="required"/>
    1.50 @@ -61,10 +61,10 @@
    1.51  						<xs:element name="customEquip" minOccurs="0" maxOccurs="unbounded">
    1.52  							<xs:complexType>
    1.53  								<xs:sequence>
    1.54 -									<xs:element name="customEquipPart" minOccurs="1" maxOccurs="unbounded">
    1.55 +									<xs:element name="customEquipPart"  maxOccurs="unbounded">
    1.56  										<xs:complexType>
    1.57  											<xs:sequence>
    1.58 -												<xs:any minOccurs="0" />
    1.59 +												<xs:element ref="core:extension" minOccurs="0" />
    1.60  											</xs:sequence>
    1.61  											<xs:attribute name="partIDRef" type="xs:string" />
    1.62  											<xs:anyAttribute/>
    1.63 @@ -78,7 +78,7 @@
    1.64  					</xs:sequence>
    1.65  				</xs:complexType>
    1.66  			</xs:element>
    1.67 -			<xs:any minOccurs="0" />
    1.68 +			<xs:element ref="core:extension" minOccurs="0" />
    1.69  		</xs:all>
    1.70  		<xs:attribute name="id" type="xs:ID" />
    1.71  		<xs:attribute name="name" type="xs:string" use="required"/>
     2.1 --- a/dtds/race.xsd	Wed Sep 30 19:08:08 2009 +0000
     2.2 +++ b/dtds/race.xsd	Sun Oct 04 10:49:17 2009 +0000
     2.3 @@ -4,16 +4,16 @@
     2.4  <xs:element name="race">
     2.5  	<xs:complexType>
     2.6  		<xs:all>
     2.7 -			<xs:element name="units" minOccurs="1">
     2.8 +			<xs:element name="units">
     2.9  				<xs:complexType>
    2.10  					<xs:sequence>
    2.11 -						<xs:element name="unit" minOccurs="1" maxOccurs="unbounded">
    2.12 +						<xs:element name="unit" maxOccurs="unbounded">
    2.13  							<xs:complexType>
    2.14  								<xs:all>
    2.15 -									<xs:element name="stats" minOccurs="1">
    2.16 +									<xs:element name="stats">
    2.17  										<xs:complexType>
    2.18  											<xs:sequence>
    2.19 -												<xs:element name="stat" minOccurs="1" maxOccurs="unbounded">
    2.20 +												<xs:element name="stat" maxOccurs="unbounded">
    2.21  													<xs:complexType>
    2.22  														<xs:simpleContent>
    2.23  															<xs:extension base="xs:string">
    2.24 @@ -114,7 +114,7 @@
    2.25  										</xs:complexType>
    2.26  									</xs:element>
    2.27  									<xs:element name="notes" type="xs:string" minOccurs="0" />
    2.28 -									<xs:any minOccurs="0" />
    2.29 +									<xs:element ref="core:extension" minOccurs="0" />
    2.30  								</xs:all>
    2.31  								<xs:attribute name="id" type="xs:ID" />
    2.32  								<xs:attribute name="typeName" type="xs:string" use="required"/>
    2.33 @@ -140,7 +140,7 @@
    2.34  							<xs:complexType>
    2.35  								<xs:all>
    2.36  									<xs:element name="description" type="xs:string" minOccurs="0" />
    2.37 -									<xs:any minOccurs="0" />
    2.38 +									<xs:element ref="core:extension" minOccurs="0" />
    2.39  								</xs:all>
    2.40  								<xs:attribute name="id" type="xs:ID" use="required"/>
    2.41  								<xs:attribute name="name" type="xs:string" use="required"/>
    2.42 @@ -160,7 +160,7 @@
    2.43  							<xs:complexType>
    2.44  								<xs:all>
    2.45  									<xs:element name="description" type="xs:string" />
    2.46 -									<xs:any minOccurs="0" />
    2.47 +									<xs:element ref="core:extension" minOccurs="0" />
    2.48  								</xs:all>
    2.49  								<xs:attribute name="id" type="xs:ID" use="required"/>
    2.50  								<xs:attribute name="name" type="xs:string" use="required"/>
    2.51 @@ -171,7 +171,7 @@
    2.52  					<xs:anyAttribute/>
    2.53  				</xs:complexType>
    2.54  			</xs:element>
    2.55 -			<xs:any minOccurs="0" />
    2.56 +			<xs:element ref="core:extension" minOccurs="0" />
    2.57  		</xs:all>
    2.58  		<xs:attribute name="id" type="xs:ID" />
    2.59  		<xs:attribute name="subid" type="xs:string" default=""/>
     3.1 --- a/dtds/system.xsd	Wed Sep 30 19:08:08 2009 +0000
     3.2 +++ b/dtds/system.xsd	Sun Oct 04 10:49:17 2009 +0000
     3.3 @@ -4,14 +4,14 @@
     3.4  <xs:element name="system">
     3.5  	<xs:complexType>
     3.6  		<xs:all>
     3.7 -			<xs:element name="categories" type="cats:categoriestype" minOccurs="1"/>
     3.8 -			<xs:element name="sysStatsList" minOccurs="1">
     3.9 +			<xs:element name="categories" type="cats:categoriestype"/>
    3.10 +			<xs:element name="sysStatsList">
    3.11  				<xs:complexType>
    3.12  					<xs:sequence>
    3.13 -						<xs:element name="sysStats" minOccurs="1" maxOccurs="unbounded">
    3.14 +						<xs:element name="sysStats" maxOccurs="unbounded">
    3.15  							<xs:complexType>
    3.16  								<xs:sequence>
    3.17 -									<xs:element name="sysStat" minOccurs="1" maxOccurs="unbounded">
    3.18 +									<xs:element name="sysStat" maxOccurs="unbounded">
    3.19  										<xs:complexType>
    3.20  											<xs:attribute name="name" type="xs:string" use="required"/>
    3.21  											<xs:anyAttribute/>
    3.22 @@ -27,7 +27,7 @@
    3.23  					<xs:anyAttribute/>
    3.24  				</xs:complexType>
    3.25  			</xs:element>
    3.26 -			<xs:any minOccurs="0" />
    3.27 +			<xs:element ref="core:extension" minOccurs="0" />
    3.28  		</xs:all>
    3.29  		<xs:attribute name="id" type="xs:ID" />
    3.30  		<xs:attribute name="name" type="xs:string" use="required"/>
     4.1 --- a/dtds/warfoundry-core.xsd	Wed Sep 30 19:08:08 2009 +0000
     4.2 +++ b/dtds/warfoundry-core.xsd	Sun Oct 04 10:49:17 2009 +0000
     4.3 @@ -1,6 +1,13 @@
     4.4  <?xml version="1.0"?>
     4.5  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ibboard.co.uk/warfoundry/core"
     4.6  xmlns="http://ibboard.co.uk/warfoundry/core" elementFormDefault="qualified">
     4.7 +<xs:element name="extension">
     4.8 +	<xs:complexType>
     4.9 +		<xs:sequence>
    4.10 +			<xs:any minOccurs="0" maxOccurs="unbounded" />
    4.11 +		</xs:sequence>
    4.12 +	</xs:complexType>
    4.13 +	</xs:element>
    4.14  <xs:simpleType name="positiveOrInfiniteInteger">
    4.15  	<xs:union memberTypes="xs:positiveInteger infinity"/>
    4.16  </xs:simpleType>