Update
[thenextsample.git] / pottery.xsd
blob01daea88d2c5d8360c3e0da85438b99260e7bbb3
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 targetNamespace="tag:fenglich.fastmail.fm,2007:Pottery"
8 xmlns="tag:fenglich.fastmail.fm,2007:Pottery"
9 elementFormDefault="qualified">
11 <!-- For xml:lang -->
12 <xs:import schemaLocation="xml.xsd"
13 namespace="http://www.w3.org/XML/1998/namespace"/>
15 <!-- xml:id per http://www.w3.org/TR/2005/REC-xml-id-20050909/ -->
16 <!--
17 <xs:import schemaLocation="xmlid.xsd"
18 namespace="http://www.w3.org/XML/1998/namespace"/>
19 -->
21 <xs:simpleType name="sampleIDsType">
22 <xs:list itemType="sampleIDType"/>
23 </xs:simpleType>
25 <xs:simpleType name="sampleIDType">
26 <xs:restriction base="xs:string">
27 <xs:pattern value="(T|W)\d+"/>
28 </xs:restriction>
29 </xs:simpleType>
31 <xs:element name="pottery" type="potteryType"/>
33 <xs:complexType name="potteryType">
34 <xs:complexContent>
35 <xs:restriction base="xs:anyType">
36 <xs:sequence>
37 <xs:element name="pieces"
38 minOccurs="1"
39 maxOccurs="1"
40 type="piecesType">
41 <xs:unique name="unique-pieces">
42 <xs:selector xpath="piece"/>
43 <xs:field xpath="@id"/>
44 </xs:unique>
45 </xs:element>
47 <xs:element name="samples"
48 minOccurs="1"
49 maxOccurs="1"
50 type="samplesType">
51 <xs:unique name="unique-samples">
52 <xs:selector xpath="sample"/>
53 <xs:field xpath="brick/@id"/>
54 </xs:unique>
55 </xs:element>
57 <xs:element name="clays"
58 minOccurs="1"
59 maxOccurs="1"
60 type="claysType">
61 <xs:unique name="unique-clays-id">
62 <xs:selector xpath="clay"/>
63 <xs:field xpath="@id"/>
64 </xs:unique>
65 <xs:unique name="unique-clays-name">
66 <xs:selector xpath="clay"/>
67 <xs:field xpath="@name"/>
68 </xs:unique>
69 </xs:element>
71 <xs:element name="glazes"
72 minOccurs="1"
73 maxOccurs="1"
74 type="glazesType">
75 <xs:unique name="unique-glazes-id">
76 <xs:selector xpath="glaze"/>
77 <xs:field xpath="@id"/>
78 </xs:unique>
80 <xs:unique name="unique-glazes-name">
81 <xs:selector xpath="glaze"/>
82 <xs:field xpath="@name"/>
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="pieceType">
107 <xs:complexContent>
108 <xs:restriction base="xs:anyType">
109 <xs:sequence>
110 <xs:element name="clayref"
111 type="clayrefType"
112 minOccurs="0"
113 maxOccurs="unbounded"/>
114 <xs:element name="glazing"
115 type="glazingType"
116 minOccurs="0"
117 maxOccurs="unbounded"/>
118 <xs:element name="note"
119 type="noteType"
120 minOccurs="1"
121 maxOccurs="unbounded"/>
122 </xs:sequence>
123 <xs:attribute ref="xml:id" use="required"/>
124 </xs:restriction>
125 </xs:complexContent>
126 </xs:complexType>
128 <xs:complexType name="noteType">
129 <xs:simpleContent>
130 <xs:extension base="xs:normalizedString">
131 <xs:attribute name="date" use="required" type="xs:date"/>
132 </xs:extension>
133 </xs:simpleContent>
134 </xs:complexType>
136 <xs:complexType name="claysType">
137 <xs:sequence>
138 <xs:element name="clay" type="clayType" minOccurs="0" maxOccurs="unbounded"/>
139 </xs:sequence>
140 </xs:complexType>
142 <xs:complexType name="clayType">
143 <xs:attribute ref="xml:id" use="required"/>
144 <xs:attribute name="name" type="xs:normalizedString" use="required"/>
145 <xs:attribute name="manufacturer" type="xs:normalizedString" use="required"/>
146 <xs:attribute name="productID" type="xs:normalizedString" use="required"/>
147 </xs:complexType>
149 <xs:complexType name="clayrefType">
150 <xs:attribute name="idref" type="xs:NCName" use="required"/>
151 <xs:attribute name="weightWhenWet" type="xs:positiveInteger" use="optional"/>
152 </xs:complexType>
154 <xs:complexType name="glazesType">
155 <xs:sequence>
156 <xs:element name="glaze" type="glazeType" minOccurs="0" maxOccurs="unbounded"/>
157 </xs:sequence>
158 </xs:complexType>
160 <xs:complexType name="glazeType">
161 <xs:attribute ref="xml:id" use="required"/>
162 <xs:attribute name="name" type="xs:normalizedString" use="required"/>
163 <xs:attribute name="manufacturer" type="xs:normalizedString" use="required"/>
164 <xs:attribute name="productID" type="xs:normalizedString" use="optional"/>
165 <xs:attribute name="description" type="xs:normalizedString" use="optional"/>
166 </xs:complexType>
168 <xs:complexType name="sampleType">
169 <xs:sequence>
170 <xs:element name="brick" type="brickType" minOccurs="1" maxOccurs="unbounded"/>
171 <xs:element name="glazing" type="glazingType" minOccurs="0" maxOccurs="unbounded"/>
172 <xs:element name="clayref" type="clayrefType" minOccurs="0" maxOccurs="unbounded"/>
173 <xs:element name="note" type="xs:normalizedString" minOccurs="1"/>
174 </xs:sequence>
175 <xs:attribute name="date" type="xs:date" use="required"/>
176 </xs:complexType>
178 <xs:complexType name="brickType">
179 <xs:attribute ref="xml:id" use="required"/>
180 </xs:complexType>
182 <xs:complexType name="glazingType">
183 <xs:attribute name="idref" use="required" type="xs:NCName"/>
184 <xs:attribute name="viscosity" use="optional" type="viscosityType"/>
185 <xs:attribute name="trickled" use="optional" type="xs:boolean" default="false"/>
186 </xs:complexType>
188 <xs:simpleType name="viscosityType">
189 <xs:restriction base="xs:integer"/>
190 </xs:simpleType>
191 </xs:schema>
192 <!--
193 vim: et:ts=4:sw=4:sts=4