1<?xml version="1.0" encoding="utf-8"?>
2<!--
3 Copyright(c) 2018, MIPI Alliance, Inc.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 * Redistributions of source code must retain the above copyright
10   notice, this list of conditions and the following disclaimer.
11
12 * Redistributions in binary form must reproduce the above copyright
13   notice, this list of conditions and the following disclaimer in
14   the documentation and/or other materials provided with the
15   distribution.
16
17 * Neither the name of the copyright holder nor the names of its
18   contributors may be used to endorse or promote products derived
19   from this software without specific prior written permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33 -->
34
35<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
36    targetNamespace="http://www.mipi.org/1.0/sys-t"
37    xmlns="http://www.mipi.org/1.0/sys-t"
38    xmlns:syst="http://www.mipi.org/1.0/sys-t"
39    elementFormDefault="qualified">
40
41  <xs:element name="Collateral">
42    <xs:complexType>
43      <xs:sequence minOccurs="1" maxOccurs="unbounded">
44        <xs:element name ="Client">
45          <xs:complexType>
46            <xs:sequence>
47              <xs:element name ="Guids">
48                <xs:complexType>
49                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
50                    <xs:element name ="Guid" type="typeGuid"/>
51                  </xs:sequence>
52                </xs:complexType>
53                <xs:unique name="uniqueGuidIds">
54                  <xs:selector xpath="syst:Guid" />
55                  <xs:field xpath="@ID" />
56                </xs:unique>
57              </xs:element>
58              <xs:element name ="Builds" minOccurs="0" maxOccurs="1" >
59                <xs:complexType>
60                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
61                    <xs:element name ="Build" type="typeBuild"/>
62                  </xs:sequence>
63                </xs:complexType>
64                <xs:unique name="uniqueBuildIds">
65                  <xs:selector xpath="syst:Build" />
66                  <xs:field xpath="@ID" />
67                </xs:unique>
68              </xs:element>
69              <xs:element name ="Options" minOccurs="0" maxOccurs="1" >
70                <xs:complexType>
71                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
72                    <xs:element name ="Option" type="typeOption"/>
73                  </xs:sequence>
74                </xs:complexType>
75              </xs:element>
76              <xs:element name ="Modules" minOccurs="0" maxOccurs="1" >
77                <xs:complexType>
78                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
79                    <xs:element name ="Module" type="typeModule"/>
80                  </xs:sequence>
81                </xs:complexType>
82                <xs:unique name="uniqueModuleIds">
83                  <xs:selector xpath="syst:Module" />
84                  <xs:field xpath="@ID" />
85                </xs:unique>
86              </xs:element>
87              <xs:element name="SourceFiles"  minOccurs="0" maxOccurs="1">
88                <xs:complexType>
89                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
90                    <xs:element name ="File" type="typeFile"/>
91                  </xs:sequence>
92                </xs:complexType>
93                <xs:unique name="uniqueSourceIds">
94                  <xs:selector xpath="syst:File" />
95                  <xs:field xpath="@ID" />
96                </xs:unique>
97              </xs:element>
98              <xs:element name="Catalog32" minOccurs="0" maxOccurs="1">
99                <xs:complexType>
100                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
101                    <xs:element name ="Format" type="typeCatalog32"/>
102                  </xs:sequence>
103                </xs:complexType>
104                <xs:unique name="uniqueCatalog32Ids">
105                  <xs:selector xpath="syst:Format" />
106                  <xs:field xpath="@ID" />
107                </xs:unique>
108              </xs:element>
109              <xs:element name="Catalog64" minOccurs="0" maxOccurs="1">
110                <xs:complexType>
111                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
112                    <xs:element name ="Format" type="typeCatalog64"/>
113                  </xs:sequence>
114                </xs:complexType>
115                <xs:unique name="uniqueCatalog64Ids">
116                  <xs:selector xpath="syst:Format" />
117                  <xs:field xpath="@ID" />
118                </xs:unique>
119              </xs:element>
120              <xs:element name="Short32" minOccurs="0" maxOccurs="1">
121                <xs:complexType>
122                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
123                    <xs:element name ="Format" type="typeShort32"/>
124                  </xs:sequence>
125                </xs:complexType>
126                <xs:unique name="uniqueShort32Ids">
127                  <xs:selector xpath="syst:Format" />
128                  <xs:field xpath="@ID" />
129                </xs:unique>
130            </xs:element>
131              <xs:element name="Short64" minOccurs="0" maxOccurs="1">
132                <xs:complexType>
133                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
134                    <xs:element name ="Format" type="typeShort64"/>
135                  </xs:sequence>
136                </xs:complexType>
137                <xs:unique name="uniqueShort64Ids">
138                  <xs:selector xpath="syst:Format" />
139                  <xs:field xpath="@ID" />
140                </xs:unique>
141              </xs:element>
142              <xs:element name="Write" minOccurs="0" maxOccurs="1">
143                <xs:complexType>
144                  <xs:sequence minOccurs="1" maxOccurs="unbounded">
145                    <xs:element name ="Protocol" type="Write"/>
146                  </xs:sequence>
147                </xs:complexType>
148                <xs:unique name="uniqueWriteIds">
149                  <xs:selector xpath="syst:Protocol" />
150                  <xs:field xpath="@ID" />
151                </xs:unique>
152              </xs:element>
153            </xs:sequence>
154            <xs:attribute name="Name"  type="xs:string" use="required" />
155          </xs:complexType>
156        </xs:element>
157      </xs:sequence>
158    </xs:complexType>
159  </xs:element>
160
161  <xs:complexType name="typeGuid">
162    <xs:simpleContent>
163      <xs:extension base="xs:string">
164        <xs:attribute name="ID"  type="guidString" use="required" />
165        <xs:attribute name="Mask" type="guidString" use="optional" />
166      </xs:extension>
167    </xs:simpleContent>
168  </xs:complexType>
169
170  <xs:complexType name="typeBuild">
171    <xs:simpleContent>
172      <xs:extension base="xs:string">
173        <xs:attribute name="ID" type="unsigned64" use="required" />
174        <xs:attribute name="Mask" type="unsigned64" use="optional" />
175      </xs:extension>
176    </xs:simpleContent>
177  </xs:complexType>
178
179  <!-- Complex SyS-T XML type definitions -->
180
181  <xs:complexType name="typeModule">
182    <xs:simpleContent>
183      <xs:extension base="xs:string">
184        <xs:attribute name="ID" type="unsigned64" use="required" />
185        <xs:attribute name="Mask" type="unsigned64" use="optional" />
186      </xs:extension>
187    </xs:simpleContent>
188  </xs:complexType>
189
190  <xs:complexType name="typeOption">
191    <xs:simpleContent>
192      <xs:extension base="xs:string">
193        <xs:attribute name="Name" type="xs:string" use="required" />
194      </xs:extension>
195    </xs:simpleContent>
196  </xs:complexType>
197
198  <xs:complexType name="typeFile">
199    <xs:simpleContent>
200      <xs:extension base="nonEmptyString">
201        <xs:attribute name="ID" type="unsigned32" use="required" />
202        <xs:attribute name="Mask" type="unsigned32" use="optional" />
203      </xs:extension>
204    </xs:simpleContent>
205  </xs:complexType>
206
207  <xs:complexType name="typeCatalog32">
208    <xs:simpleContent>
209      <xs:extension base="nonEmptyString">
210        <xs:attribute name="ID" type="unsigned32" use="required" />
211        <xs:attribute name="Mask" type="unsigned32" use="optional" />
212        <xs:attribute name="File" type="unsigned32" use="optional"/>
213        <xs:attribute name="Line" type="unsigned32" use="optional"/>
214      </xs:extension>
215    </xs:simpleContent>
216  </xs:complexType>
217
218  <xs:complexType name="typeCatalog64">
219    <xs:simpleContent>
220      <xs:extension base="nonEmptyString">
221        <xs:attribute name="ID" type="unsigned64" use="required" />
222        <xs:attribute name="Mask" type="unsigned64" use="optional" />
223        <xs:attribute name="File" type="unsigned32" use="optional"/>
224        <xs:attribute name="Line" type="unsigned32" use="optional"/>
225      </xs:extension>
226    </xs:simpleContent>
227  </xs:complexType>
228
229  <xs:complexType name="typeShort32">
230    <xs:simpleContent>
231      <xs:extension base="nonEmptyString">
232        <xs:attribute name="ID" type="unsigned32" use="required" />
233        <xs:attribute name="Mask" type="unsigned32" use="optional" />
234        <xs:attribute name="File" type="unsigned32" use="optional"/>
235        <xs:attribute name="Line" type="unsigned32" use="optional"/>
236      </xs:extension>
237    </xs:simpleContent>
238  </xs:complexType>
239
240  <xs:complexType name="typeShort64">
241    <xs:simpleContent>
242      <xs:extension base="nonEmptyString">
243        <xs:attribute name="ID" type="unsigned64" use="required" />
244        <xs:attribute name="Mask" type="unsigned64" use="optional" />
245        <xs:attribute name="File" type="unsigned32" use="optional"/>
246        <xs:attribute name="Line" type="unsigned32" use="optional"/>
247      </xs:extension>
248    </xs:simpleContent>
249  </xs:complexType>
250
251  <xs:complexType name="Write">
252    <xs:simpleContent>
253      <xs:extension base="nonEmptyString">
254        <xs:attribute name="ID" type="unsigned6" use="required" />
255        <xs:attribute name="Mask" type="unsigned6" use="optional" />
256      </xs:extension>
257    </xs:simpleContent>
258  </xs:complexType>
259
260  <!-- Simple type definitions -->
261
262  <xs:simpleType name="nonEmptyString">
263    <xs:restriction base="xs:string">
264      <xs:minLength value="1"/>
265    </xs:restriction>
266  </xs:simpleType>
267
268  <xs:simpleType name="unsigned32">
269    <xs:restriction base="xs:string">
270      <xs:pattern value="0x[0-9a-fA-F]{1,8}|0|[1-9][0-9]{1,9}"/>
271    </xs:restriction>
272  </xs:simpleType>
273
274  <xs:simpleType name="unsigned64">
275    <xs:restriction base="xs:string">
276      <xs:pattern value="0x[0-9a-fA-F]{1,16}|0|[1-9][0-9]{1,20}"/>
277    </xs:restriction>
278  </xs:simpleType>
279
280  <xs:simpleType name="unsigned6">
281    <xs:restriction base="xs:string">
282      <xs:pattern value="0x[0-9a-fA-F]{0,2}|0|[1-9][0-9]{1,2}"/>
283    </xs:restriction>
284  </xs:simpleType>
285
286  <xs:simpleType name="guidString">
287    <xs:restriction base="xs:string">
288      <xs:pattern value="\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\}"/>
289    </xs:restriction>
290  </xs:simpleType>
291
292</xs:schema>
293