-
Notifications
You must be signed in to change notification settings - Fork 524
/
example-schema.xml
77 lines (77 loc) · 4.03 KB
/
example-schema.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe"
xmlns:xi="http://www.w3.org/2001/XInclude"
package="baseline"
id="1"
version="0"
semanticVersion="5.2"
description="Example base schema which can be extended."
byteOrder="littleEndian">
<xi:include href="common-types.xml"/>
<types>
<type name="ModelYear" primitiveType="uint16"/>
<type name="VehicleCode" primitiveType="char" length="6" characterEncoding="ASCII"/>
<type name="Ron" primitiveType="uint8" minValue="90" maxValue="110"/>
<type name="someNumbers" primitiveType="uint32" length="4"/>
<type name="Percentage" primitiveType="int8" minValue="0" maxValue="100"/>
<composite name="Booster">
<enum name="BoostType" encodingType="char">
<validValue name="TURBO">T</validValue>
<validValue name="SUPERCHARGER">S</validValue>
<validValue name="NITROUS">N</validValue>
<validValue name="KERS">K</validValue>
</enum>
<type name="horsePower" primitiveType="uint8"/>
</composite>
<composite name="Engine">
<type name="capacity" primitiveType="uint16"/>
<type name="numCylinders" primitiveType="uint8"/>
<type name="maxRpm" primitiveType="uint16" presence="constant">9000</type>
<type name="manufacturerCode" primitiveType="char" length="3"/>
<type name="fuel" primitiveType="char" presence="constant">Petrol</type>
<ref name="efficiency" type="Percentage"/>
<ref name="boosterEnabled" type="BooleanType"/>
<ref name="booster" type="Booster"/>
</composite>
<enum name="BooleanType" encodingType="uint8" description="Boolean Type.">
<validValue name="F" description="False value representation.">0</validValue>
<validValue name="T" description="True value representation.">1</validValue>
</enum>
<enum name="Model" encodingType="char">
<validValue name="A">A</validValue>
<validValue name="B">B</validValue>
<validValue name="C">C</validValue>
</enum>
<set name="OptionalExtras" encodingType="uint8">
<choice name="sunRoof">0</choice>
<choice name="sportsPack">1</choice>
<choice name="cruiseControl">2</choice>
</set>
</types>
<sbe:message name="Car" id="1" description="Description of a basic Car">
<field name="serialNumber" id="1" type="uint64"/>
<field name="modelYear" id="2" type="ModelYear"/>
<field name="available" id="3" type="BooleanType"/>
<field name="code" id="4" type="Model"/>
<field name="someNumbers" id="5" type="someNumbers"/>
<field name="vehicleCode" id="6" type="VehicleCode"/>
<field name="extras" id="7" type="OptionalExtras"/>
<field name="discountedModel" id="8" type="Model" presence="constant" valueRef="Model.C"/>
<field name="engine" id="9" type="Engine"/>
<group name="fuelFigures" id="10" dimensionType="groupSizeEncoding">
<field name="speed" id="11" type="uint16"/>
<field name="mpg" id="12" type="float"/>
<data name="usageDescription" id="200" type="varAsciiEncoding"/>
</group>
<group name="performanceFigures" id="13" dimensionType="groupSizeEncoding">
<field name="octaneRating" id="14" type="Ron"/>
<group name="acceleration" id="15" dimensionType="groupSizeEncoding">
<field name="mph" id="16" type="uint16"/>
<field name="seconds" id="17" type="float"/>
</group>
</group>
<data name="manufacturer" id="18" type="varStringEncoding"/>
<data name="model" id="19" type="varStringEncoding"/>
<data name="activationCode" id="20" type="varAsciiEncoding"/>
</sbe:message>
</sbe:messageSchema>