-
Notifications
You must be signed in to change notification settings - Fork 536
/
Copy pathsbe.xsd
388 lines (388 loc) · 17.9 KB
/
sbe.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:sbe="http://fixprotocol.io/2016/sbe" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fixprotocol.io/2016/sbe" elementFormDefault="unqualified" version="1.0 Draft Standard">
<xs:annotation>
<xs:documentation>
Message schema for FIX Simple Binary Encoding
Version: 1.0 Draft Standard
© Copyright 2014-2016 FIX Protocol Limited
License: Creative Commons Attribution-NoDerivatives 4.0 International Public License
</xs:documentation>
</xs:annotation>
<xs:element name="messageSchema">
<xs:annotation>
<xs:documentation>
Root of XML document, holds all message templates
and their elements
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="types" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
More than one set of types may be provided.
Names must be unique across all encoding
types.
Encoding types may appear in any order.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="type" type="sbe:encodedDataType"/>
<xs:element name="composite" type="sbe:compositeDataType"/>
<xs:element name="enum" type="sbe:enumType"/>
<xs:element name="set" type="sbe:setType"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element ref="sbe:message" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="package" type="xs:string"/>
<xs:attribute name="id" type="xs:unsignedShort">
<xs:annotation>
<xs:documentation>Unique ID of a message schema
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version" type="xs:nonNegativeInteger" use="required">
<xs:annotation>
<xs:documentation>The version of a message schema. Initial version
is 0.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="semanticVersion" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Application layer specification version, such as
FIX version 'FIX.5.0SP2'
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attribute name="byteOrder" default="littleEndian">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="bigEndian"/>
<xs:enumeration value="littleEndian"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="headerType" type="sbe:symbolicName_t" default="messageHeader">
<xs:annotation>
<xs:documentation>
Name of the encoding type of the message header,
which is the same for all messages in a schema. The name has a
default, but an encoding of that name must be present under a
'types' element.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="message" type="sbe:blockType">
<xs:annotation>
<xs:documentation>
A message type, also known as a message template
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="blockType">
<xs:annotation>
<xs:documentation>Base type of message and repeating group entry
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="field" type="sbe:fieldType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Fixed-length fields</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="group" type="sbe:groupType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="data" type="sbe:fieldType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Variable-length fields</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="id" type="xs:unsignedShort" use="required">
<xs:annotation>
<xs:documentation>Unique ID of a message template
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="blockLength" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation>Space reserved for root level of message, not
include groups or variable-length
data elements.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="sbe:semanticAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:complexType>
<xs:complexType name="groupType">
<xs:annotation>
<xs:documentation>
A repeating group contains an array of entries
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="sbe:blockType">
<xs:attribute name="dimensionType" type="sbe:symbolicName_t" default="groupSizeEncoding"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="encodedDataType" mixed="true">
<xs:annotation>
<xs:documentation>
Simple wire encoding consisting of a primitive type
or array of primitives
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:token">
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="nullValue" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Override of default null indicator for the data
type in SBE specification,
as a string.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="minValue" type="xs:string" use="optional"/>
<xs:attribute name="maxValue" type="xs:string" use="optional"/>
<xs:attribute name="length" type="xs:nonNegativeInteger" default="1"/>
<xs:attribute name="primitiveType" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="char"/>
<xs:enumeration value="int8"/>
<xs:enumeration value="int16"/>
<xs:enumeration value="int32"/>
<xs:enumeration value="int64"/>
<xs:enumeration value="uint8"/>
<xs:enumeration value="uint16"/>
<xs:enumeration value="uint32"/>
<xs:enumeration value="uint64"/>
<xs:enumeration value="float"/>
<xs:enumeration value="double"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="characterEncoding" type="xs:string" use="optional"/>
<xs:attributeGroup ref="sbe:alignmentAttributes"/>
<xs:attributeGroup ref="sbe:presenceAttributes"/>
<xs:attributeGroup ref="sbe:semanticAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="compositeDataType" mixed="true">
<xs:annotation>
<xs:documentation>
A wire encoding composed of multiple parts
</xs:documentation>
</xs:annotation>
<xs:choice maxOccurs="unbounded">
<xs:element name="type" type="sbe:encodedDataType"/>
<xs:element name="enum" type="sbe:enumType"/>
<xs:element name="set" type="sbe:setType"/>
<xs:element name="composite" type="sbe:compositeDataType"/>
<xs:element name="ref" type="sbe:refType"/>
</xs:choice>
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attributeGroup ref="sbe:alignmentAttributes"/>
<xs:attributeGroup ref="sbe:semanticAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:complexType>
<xs:complexType name="enumType" mixed="true">
<xs:annotation>
<xs:documentation>
An enumeration of valid values
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="validValue" type="sbe:validValue" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="encodingType" type="sbe:symbolicName_t" use="required"/>
<xs:attributeGroup ref="sbe:alignmentAttributes"/>
<xs:attributeGroup ref="sbe:semanticAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:complexType>
<xs:complexType name="validValue">
<xs:annotation>
<xs:documentation>
Valid value as a string
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:token">
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="refType" mixed="true">
<xs:annotation>
<xs:documentation>
A reference to any existing encoding type (simple type, enum or set)
to reuse as a member of a composite type
</xs:documentation>
</xs:annotation>
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="type" type="sbe:symbolicName_t" use="required"/>
<xs:attributeGroup ref="sbe:alignmentAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:complexType>
<xs:complexType name="setType" mixed="true">
<xs:annotation>
<xs:documentation>
A multi value choice (encoded as a bitset)
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="choice" type="sbe:choice" maxOccurs="64"/>
</xs:sequence>
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="encodingType" type="sbe:symbolicName_t" use="required"/>
<xs:attributeGroup ref="sbe:alignmentAttributes"/>
<xs:attributeGroup ref="sbe:semanticAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:complexType>
<xs:complexType name="choice">
<xs:annotation>
<xs:documentation>
A choice within a multi value set. Value is the
position within a bitset (zero-based index).
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:nonNegativeInteger">
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="fieldType">
<xs:annotation>
<xs:documentation>
A field of a message of a specified dataType
</xs:documentation>
</xs:annotation>
<xs:attribute name="name" type="sbe:symbolicName_t" use="required"/>
<xs:attribute name="id" type="xs:unsignedShort" use="required"/>
<xs:attribute name="type" type="sbe:symbolicName_t" use="required">
<xs:annotation>
<xs:documentation>Must match the name of an encoding contained by
'types' element
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="epoch" type="xs:string" default="unix"/>
<xs:attribute name="timeUnit" type="xs:string" default="nanosecond">
<xs:annotation>
<xs:documentation>Deprecated - only for back compatibility with RC2
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="sbe:alignmentAttributes"/>
<xs:attributeGroup ref="sbe:presenceAttributes"/>
<xs:attributeGroup ref="sbe:semanticAttributes"/>
<xs:attributeGroup ref="sbe:versionAttributes"/>
<!-- start of time period - default is UNIX epoch -->
</xs:complexType>
<xs:attributeGroup name="semanticAttributes">
<xs:annotation>
<xs:documentation>
Application layer class. Maps a field or encoding
to a FIX data type.
</xs:documentation>
</xs:annotation>
<xs:attribute name="semanticType" type="xs:token" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:attributeGroup>
<xs:attributeGroup name="versionAttributes">
<xs:annotation>
<xs:documentation>
Schema versioning supports message extension
</xs:documentation>
</xs:annotation>
<xs:attribute name="sinceVersion" type="xs:nonNegativeInteger" default="0">
<xs:annotation>
<xs:documentation>
The schema version in which an element was added
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="deprecated" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation>
The version of the schema in which an element was
deprecated. It is retained for back compatibility but should no
longer be used by updated applications.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="alignmentAttributes">
<xs:attribute name="offset" type="xs:unsignedInt" use="optional">
<xs:annotation>
<xs:documentation>Offset from start of a composite type or block
as a zero-based index.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="presenceAttributes">
<xs:attribute name="presence" default="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="required">
<xs:annotation>
<xs:documentation>The value must always be populated
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="optional">
<xs:annotation>
<xs:documentation>Value may be set to nullValue for its data type
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="constant">
<xs:annotation>
<xs:documentation>Value does not vary so it need not be
serialized on the wire
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="valueRef" type="sbe:qualifiedName_t" use="optional">
<xs:annotation>
<xs:documentation>A constant value as valid value of an enum
in the form enum-name.valid-value-name
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:simpleType name="symbolicName_t">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="64"/>
<xs:pattern value="([A-Z]|[a-z]|_)([0-9]|[A-Z]|[a-z]|_)*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="qualifiedName_t">
<xs:restriction base="xs:string">
<xs:pattern value="([A-Z]|[a-z]|_)([0-9]|[A-Z]|[a-z]|_)*\.([A-Z]|[a-z]|_)([0-9]|[A-Z]|[a-z]|_)*"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>