Typos.
[thenextsample.git] / pottery.xsd
blobd468038f735fe71f46f8e16a2fb8f978bc661a60
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3 A format for describing pottery glazes, samples and pieces.
4 -->
6 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
7 xmlns:db="http://docbook.org/ns/docbook"
8 targetNamespace="tag:fenglich.fastmail.fm,2007:Pottery"
9 xmlns="tag:fenglich.fastmail.fm,2007:Pottery"
10 elementFormDefault="qualified">
12 <!-- For xml:lang -->
13 <xs:import schemaLocation="xml.xsd"
14 namespace="http://www.w3.org/XML/1998/namespace"/>
16 <xs:import schemaLocation="docbook.xsd"
17 namespace="http://docbook.org/ns/docbook"/>
18 <!-- xml:id per http://www.w3.org/TR/2005/REC-xml-id-20050909/ -->
19 <!--
20 <xs:import schemaLocation="xmlid.xsd"
21 namespace="http://www.w3.org/XML/1998/namespace"/>
22 -->
24 <xs:simpleType name="sampleIDsType">
25 <xs:list itemType="sampleIDType"/>
26 </xs:simpleType>
28 <xs:simpleType name="sampleIDType">
29 <xs:restriction base="xs:string">
30 <xs:pattern value="(T|W)\d+"/>
31 </xs:restriction>
32 </xs:simpleType>
34 <xs:element name="pottery" type="potteryType"/>
36 <xs:complexType name="potteryType">
37 <xs:complexContent>
38 <xs:restriction base="xs:anyType">
39 <xs:sequence>
40 <xs:element name="components"
41 minOccurs="1"
42 maxOccurs="1"
43 type="componentsType">
44 <!-- TODO How do I put a uniqueness constraint on string(component)?. -->
45 </xs:element>
47 <xs:element name="pieces"
48 minOccurs="1"
49 maxOccurs="1"
50 type="piecesType">
51 </xs:element>
53 <xs:element name="samples"
54 minOccurs="1"
55 maxOccurs="1"
56 type="samplesType">
57 </xs:element>
59 <xs:element name="clays"
60 minOccurs="1"
61 maxOccurs="1"
62 type="claysType">
63 <xs:unique name="unique-clays-name">
64 <xs:selector xpath="clay"/>
65 <xs:field xpath="@name"/>
66 </xs:unique>
67 </xs:element>
69 <xs:element name="glazes"
70 minOccurs="1"
71 maxOccurs="1"
72 type="glazesType">
73 <xs:unique name="unique-glaze-name">
74 <!-- TODO Why doesn't this work? -->
75 <xs:selector xpath="glaze"/>
76 <xs:field xpath="@name"/>
77 </xs:unique>
79 <xs:unique name="unique-glaze-productID">
80 <!-- TODO Why doesn't this work? -->
81 <xs:selector xpath="glaze"/>
82 <xs:field xpath="@productID"/>
83 </xs:unique>
85 </xs:element>
87 </xs:sequence>
88 <xs:attribute name="version" type="xs:decimal"/>
89 <xs:attribute ref="xml:lang" use="required"/>
90 </xs:restriction>
91 </xs:complexContent>
92 </xs:complexType>
94 <xs:complexType name="samplesType">
95 <xs:sequence>
96 <xs:element name="sample" type="sampleType" minOccurs="1" maxOccurs="unbounded"/>
97 </xs:sequence>
98 </xs:complexType>
100 <xs:complexType name="piecesType">
101 <xs:sequence>
102 <xs:element name="piece" type="pieceType" minOccurs="0" maxOccurs="unbounded"/>
103 </xs:sequence>
104 </xs:complexType>
106 <xs:complexType name="imageType">
107 <xs:simpleContent>
108 <xs:extension base="xs:NCName"/>
109 </xs:simpleContent>
110 </xs:complexType>
112 <xs:complexType name="pieceType">
113 <xs:complexContent>
114 <xs:restriction base="xs:anyType">
115 <xs:sequence>
116 <xs:element name="measurementsWhenDone"
117 minOccurs="0"
118 maxOccurs="1">
119 <!-- HWD, Measurements are in millimeters. -->
120 <xs:complexType>
121 <xs:attribute name="height" type="xs:positiveInteger"/>
122 <xs:attribute name="width" type="xs:positiveInteger"/>
123 <xs:attribute name="depth" type="xs:positiveInteger"/>
124 </xs:complexType>
125 </xs:element>
126 <xs:element name="image"
127 type="imageType"
128 minOccurs="0"
129 maxOccurs="unbounded"/>
130 <xs:element name="clayref"
131 type="clayrefType"
132 minOccurs="1"
133 maxOccurs="unbounded"/>
134 <xs:element name="glazing"
135 type="glazingType"
136 minOccurs="0"
137 maxOccurs="unbounded"/>
138 <xs:element name="brushon"
139 type="brushonType"
140 minOccurs="0"
141 maxOccurs="unbounded"/>
142 <xs:element ref="db:para"
143 minOccurs="1"
144 maxOccurs="unbounded"/>
145 </xs:sequence>
146 <xs:attribute ref="xml:id" use="required"/>
147 </xs:restriction>
148 </xs:complexContent>
149 </xs:complexType>
151 <xs:complexType name="claysType">
152 <xs:sequence>
153 <xs:element name="clay" type="clayType" minOccurs="1" maxOccurs="unbounded"/>
154 </xs:sequence>
155 </xs:complexType>
157 <xs:complexType name="recipeType">
158 <xs:sequence>
159 <xs:element name="component" type="componentRefType" minOccurs="1" maxOccurs="unbounded"/>
160 </xs:sequence>
161 </xs:complexType>
163 <xs:complexType name="componentRefType">
164 <xs:attribute name="idref" type="xs:IDREF" use="required"/>
165 <xs:attribute name="replacementFor" type="xs:IDREF" use="optional"/>
166 <xs:attribute name="parts" use="required">
167 <xs:simpleType>
168 <xs:restriction base="xs:decimal">
169 <xs:minExclusive value="0"/>
170 <xs:maxInclusive value="100"/>
171 </xs:restriction>
172 </xs:simpleType>
173 </xs:attribute>
174 </xs:complexType>
176 <xs:complexType name="clayType">
177 <xs:attribute ref="xml:id" use="required"/>
178 <xs:attribute name="name" type="xs:normalizedString" use="required"/>
179 <xs:attribute name="manufacturer" type="xs:normalizedString" use="required"/>
180 <xs:attribute name="productID" type="xs:normalizedString" use="required"/>
181 </xs:complexType>
183 <xs:complexType name="clayrefType">
184 <xs:attribute name="idref" type="xs:IDREF" use="required"/>
185 <xs:attribute name="weightWhenWet" type="xs:positiveInteger" use="optional"/>
186 </xs:complexType>
188 <xs:complexType name="glazesType">
189 <xs:sequence>
190 <xs:element name="glaze" type="glazeType" minOccurs="0" maxOccurs="unbounded"/>
191 </xs:sequence>
192 </xs:complexType>
194 <xs:complexType name="glazeType">
195 <xs:complexContent>
196 <xs:restriction base="xs:anyType">
197 <xs:sequence>
198 <xs:element ref="db:para"
199 minOccurs="0"
200 maxOccurs="unbounded"/>
201 <xs:element name="recipe"
202 type="recipeType"
203 minOccurs="0"
204 maxOccurs="1">
205 <xs:unique name="unique-componentref">
206 <!-- TODO Why doesn't this work? -->
207 <xs:selector xpath="component"/>
208 <xs:field xpath="@idref"/>
209 <xs:field xpath="@replacementFor"/>
210 </xs:unique>
211 </xs:element>
212 </xs:sequence>
213 <xs:attribute ref="xml:id" use="required"/>
214 <xs:attribute name="name" type="xs:normalizedString" use="required"/>
215 <xs:attribute name="manufacturer" type="xs:normalizedString" use="required"/>
216 <xs:attribute name="productID" type="xs:normalizedString" use="optional"/>
217 <xs:attribute name="type" use="optional">
218 <xs:simpleType>
219 <xs:restriction base = "xs:string">
220 <xs:enumeration value = "BrushOn"/>
221 </xs:restriction>
222 </xs:simpleType>
223 </xs:attribute>
224 </xs:restriction>
225 </xs:complexContent>
227 </xs:complexType>
229 <xs:complexType name="sampleType">
230 <xs:sequence>
231 <xs:element name="image" type="imageType" minOccurs="0" maxOccurs="unbounded"/>
232 <xs:element name="tile" type="tileType" minOccurs="1" maxOccurs="unbounded"/>
233 <xs:element name="glazing" type="glazingType" minOccurs="0" maxOccurs="unbounded"/>
234 <xs:element name="brushon" type="brushonType" minOccurs="0" maxOccurs="unbounded"/>
235 <xs:element name="clayref" type="clayrefType" minOccurs="1" maxOccurs="unbounded"/>
236 <xs:element ref="db:para"
237 minOccurs="1"
238 maxOccurs="unbounded"/>
239 </xs:sequence>
240 <xs:attribute name="date" type="xs:date" use="required"/>
241 </xs:complexType>
243 <xs:complexType name="tileType">
244 <xs:attribute ref="xml:id" use="required"/>
245 </xs:complexType>
247 <xs:complexType name="glazingType">
248 <xs:attribute name="idref" use="required" type="xs:IDREF"/>
249 <xs:attribute name="hydrometerGravity" use="optional" type="hydrometerGravityType"/>
250 <xs:attribute name="sieved" use="required">
251 <xs:simpleType>
252 <xs:union memberTypes="xs:integer withMixerType"/>
253 </xs:simpleType>
254 </xs:attribute>
255 </xs:complexType>
257 <xs:complexType name="brushonType">
258 <xs:attribute name="idref" use="required" type="xs:IDREF"/>
259 </xs:complexType>
261 <xs:simpleType name="hydrometerGravityType">
262 <xs:restriction base="xs:integer"/>
263 </xs:simpleType>
265 <xs:simpleType name="withMixerType">
266 <xs:restriction base = "xs:string">
267 <xs:enumeration value = "WithMixer"/>
268 <xs:enumeration value = "no"/>
269 </xs:restriction>
270 </xs:simpleType>
272 <xs:complexType name="componentType">
273 <xs:simpleContent>
274 <xs:extension base="xs:normalizedString">
275 <xs:attribute ref="xml:id" use="required"/>
276 <xs:attribute name="price" type="xs:positiveInteger" use="optional"/>
277 <xs:attribute name="priceIsFor" type="xs:positiveInteger" use="optional"/>
278 </xs:extension>
279 </xs:simpleContent>
280 </xs:complexType>
282 <xs:complexType name="componentsType">
283 <xs:sequence>
284 <xs:element name="component" type="componentType" minOccurs="1" maxOccurs="unbounded"/>
285 </xs:sequence>
286 </xs:complexType>
288 </xs:schema>
289 <!--
290 vim: et:ts=4:sw=4:sts=4