Skip to content

Commit 05e01dd

Browse files
committed
Use qualified elements in schema #117
- make elementFormDefault="qualified" - make 'messageSchema', 'types', and 'messages' top elements (to allow partial included XML's validation) - move 'message' inside 'messages' (to disallow it to be top-element in XML) - fix XML sample (namespaces, remove redundant attributes) - fix type (XIinclude -> XInclude)
1 parent 1ba166d commit 05e01dd

File tree

8 files changed

+70
-67
lines changed

8 files changed

+70
-67
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Version 2.0 RC2 was approved by the Global Technical Committee on August 15, 201
2626
Themes of this release:
2727

2828
* Clarification about single-byte character sets
29-
* Improvement of the XML schema, including support for XIinclude
29+
* Improvement of the XML schema, including support for XInclude
3030

3131
### Version 2.0 Release Candidate 1
3232

v2-0-RC3/doc/00Title.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FIX Simple Binary Encoding
55

66
## Technical Specification
77

8-
Version 2.0 Release Candidate 2
8+
Version 2.0 Release Candidate 3
99

1010
**THIS DOCUMENT IS A RELEASE CANDIDATE FOR A PROPOSED FIX TECHNICAL
1111
STANDARD. A RELEASE CANDIDATE HAS BEEN APPROVED BY THE GLOBAL TECHNICAL

v2-0-RC3/doc/04MessageSchema.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
XML schema for SBE message schemas
55
---------
6-
See [SBE XSD](../resources/sbe-2.0rc2.xsd) for the normative XML Schema Definition (XSD) for SBE.
6+
See [SBE XSD](../resources/sbe-2.0rc3.xsd) for the normative XML Schema Definition (XSD) for SBE.
77

88
The SBE schema is defined with W3C XML Schema Definition Language (XSD) version 1.0. (XSD version 1.1 was standardized.
99
However, since it is not supported by all XML processors, the SBE XSD is constrained to features of version 1.0.)
@@ -367,7 +367,7 @@ The `name` attribute of the `<choice>` uniquely identifies it.
367367
| sinceVersion | Documents the version of a schema in which a choice was added | nonNegativeInteger | default = 0 | |
368368
| deprecated | Documents the version of a schema in which a choice was deprecated. It should no longer be used in new messages. | nonnegativeInteger | optional | Must be less than or equal to the version of the message schema. |
369369

370-
#### `<choice>` element content
370+
#### `< choice >` element content
371371

372372
The element is required to carry a value, which is an unsigned integer
373373
representing a zero-based index to a bit within a bitset. Zero is the

v2-0-RC3/doc/07Examples.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Not all FIX enumeration values are listed in the samples.
99
## SBE Message Schema
1010
```xml
1111
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
12-
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" package="Examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe sbe-2.0rc2.xsd">
12+
<messageSchema xmlns="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" package="Examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe sbe-2.0rc3.xsd">
1313
<types>
1414
<type name="date" primitiveType="uint16"/>
1515
<type name="enumEncoding" primitiveType="char"/>
@@ -98,12 +98,12 @@ Not all FIX enumeration values are listed in the samples.
9898
</enum>
9999
</types>
100100
<messages>
101-
<sbe:message name="BusinessMessageReject" id="97" blockLength="9" semanticType="j">
101+
<message name="BusinessMessageReject" id="97" blockLength="9" semanticType="j">
102102
<field name="BusinesRejectRefId" id="379" type="idString" offset="0" semanticType="String"/>
103103
<field name="BusinessRejectReason" id="380" type="businessRejectReasonEnum" offset="8" semanticType="int"/>
104104
<data name="Text" id="58" type="DATA" semanticType="data"/>
105-
</sbe:message>
106-
<sbe:message name="ExecutionReport" id="98" blockLength="42" semanticType="8">
105+
</message>
106+
<message name="ExecutionReport" id="98" blockLength="42" semanticType="8">
107107
<field name="OrderID" id="37" type="idString" offset="0" semanticType="String"/>
108108
<field name="ExecID" id="17" type="idString" offset="8" semanticType="String"/>
109109
<field name="ExecType" id="150" type="execTypeEnum" offset="16" semanticType="char"/>
@@ -118,8 +118,8 @@ Not all FIX enumeration values are listed in the samples.
118118
<field name="FillPx" id="1364" type="decimalEncoding" offset="0" semanticType="Price"/>
119119
<field name="FillQty" id="1365" type="qtyEncoding" offset="8" semanticType="Qty"/>
120120
</group>
121-
</sbe:message>
122-
<sbe:message name="NewOrderSingle" id="99" blockLength="54" semanticType="D">
121+
</message>
122+
<message name="NewOrderSingle" id="99" blockLength="54" semanticType="D">
123123
<field name="ClOrdId" id="11" type="idString" offset="0" semanticType="String"/>
124124
<field name="Account" id="1" type="idString" offset="8" semanticType="String"/>
125125
<field name="Symbol" id="55" type="idString" offset="16" semanticType="String"/>
@@ -129,9 +129,9 @@ Not all FIX enumeration values are listed in the samples.
129129
<field name="OrdType" id="40" type="ordTypeEnum" offset="37" semanticType="char"/>
130130
<field name="Price" id="44" type="decimalEncoding" offset="38" semanticType="Price" presence="optional"/>
131131
<field name="StopPx" id="99" type="decimalEncoding" offset="46" semanticType="Price" presence="optional"/>
132-
</sbe:message>
132+
</message>
133133
</messages>
134-
</sbe:messageSchema>
134+
</messageSchema>
135135
```
136136

137137

v2-0-RC3/resources/xml/examples.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" package="examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe ../xsd/sbe-2.0rc2.xsd">
2+
<messageSchema xmlns="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" package="examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe ../xsd/sbe-2.0rc3.xsd">
33
<!-- include commonly used types -->
4-
<xi:include href="types-include.xml" parse="xml"/>
4+
<xi:include href="types-include.xml"/>
55
<types>
66
<type name="date" primitiveType="uint16"/>
77
<type name="enumEncoding" primitiveType="char"/>
@@ -84,7 +84,7 @@
8484
</enum>
8585
</types>
8686
<messages>
87-
<sbe:message name="ExecutionReport" id="98" blockLength="42" semanticType="8">
87+
<message name="ExecutionReport" id="98" blockLength="42" semanticType="8">
8888
<field name="OrderID" id="37" type="idString" offset="0" semanticType="String"/>
8989
<field name="ExecID" id="17" type="idString" offset="8" semanticType="String"/>
9090
<field name="ExecType" id="150" type="execTypeEnum" offset="16" semanticType="char"/>
@@ -99,8 +99,8 @@
9999
<field name="FillPx" id="1364" type="decimalEncoding" offset="0" semanticType="Price"/>
100100
<field name="FillQty" id="1365" type="qtyEncoding" offset="8" semanticType="Qty"/>
101101
</group>
102-
</sbe:message>
103-
<sbe:message name="NewOrderSingle" id="99" blockLength="54" semanticType="D">
102+
</message>
103+
<message name="NewOrderSingle" id="99" blockLength="54" semanticType="D">
104104
<field name="ClOrdId" id="11" type="idString" offset="0" semanticType="String"/>
105105
<field name="Account" id="1" type="idString" offset="8" semanticType="String"/>
106106
<field name="Symbol" id="55" type="idString" offset="16" semanticType="String"/>
@@ -110,8 +110,8 @@
110110
<field name="OrdType" id="40" type="ordTypeEnum" offset="37" semanticType="char"/>
111111
<field name="Price" id="44" type="decimalEncoding" offset="38" semanticType="Price" presence="optional"/>
112112
<field name="StopPx" id="99" type="decimalEncoding" offset="46" semanticType="Price" presence="optional"/>
113-
</sbe:message>
113+
</message>
114114
</messages>
115115
<!-- include commonly used messages -->
116-
<xi:include href="messages-include.xml" parse="xml"/>
117-
</sbe:messageSchema>
116+
<xi:include href="messages-include.xml"/>
117+
</messageSchema>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<messages xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" description="Commonly used messsages may be imported into multiple message schemas using XInclude">
3-
<sbe:message name="BusinessMessageReject" id="97" blockLength="9" semanticType="j">
2+
<messages xmlns="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://fixprotocol.io/2017/sbe ../xsd/sbe-2.0rc3.xsd"
3+
description="Commonly used messsages may be imported into multiple message schemas using XInclude">
4+
<message name="BusinessMessageReject" id="97" blockLength="9" semanticType="j">
45
<field name="BusinesRejectRefId" id="379" type="idString" offset="0" semanticType="String"/>
56
<field name="BusinessRejectReason" id="380" type="businessRejectReasonEnum" offset="8" semanticType="int"/>
67
<data name="Text" id="58" type="DATA" semanticType="data"/>
7-
</sbe:message>
8+
</message>
89
</messages>

v2-0-RC3/resources/xml/types-include.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<types xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<types xmlns="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://fixprotocol.io/2017/sbe ../xsd/sbe-2.0rc3.xsd"
33
description="Commonly used types may be imported into multiple message schemas using XInclude">
44
<composite name="MONTH_YEAR">
55
<type name="year" primitiveType="uint16"/>

v2-0-RC3/resources/xsd/sbe-2.0rc3.xsd

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<xs:schema xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fixprotocol.io/2017/sbe" elementFormDefault="unqualified" version="2.0RC2">
2+
<xs:schema xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fixprotocol.io/2017/sbe" elementFormDefault="qualified" version="2.0RC3">
33
<xs:annotation>
44
<xs:documentation>
55
Message schema for FIX Simple Binary Encoding
@@ -20,46 +20,8 @@
2020
</xs:annotation>
2121
<xs:complexType>
2222
<xs:sequence>
23-
<xs:element name="types" maxOccurs="unbounded">
24-
<xs:annotation>
25-
<xs:documentation>
26-
More than one set of types may be provided.
27-
Names must be unique across all encoding
28-
types.
29-
Encoding types may appear in any order.
30-
</xs:documentation>
31-
</xs:annotation>
32-
<xs:complexType>
33-
<xs:choice maxOccurs="unbounded">
34-
<xs:element name="type" type="sbe:simpleDataType"/>
35-
<xs:element name="composite" type="sbe:compositeDataType"/>
36-
<xs:element name="enum" type="sbe:enumType"/>
37-
<xs:element name="set" type="sbe:setType"/>
38-
</xs:choice>
39-
<xs:attribute name="description" type="xs:string"/>
40-
<xs:attribute name="package" type="xs:string">
41-
<xs:annotation>
42-
<xs:documentation>Overrides the messageSchema package</xs:documentation>
43-
</xs:annotation>
44-
</xs:attribute>
45-
<xs:attribute ref="xml:base"/>
46-
</xs:complexType>
47-
</xs:element>
48-
<xs:element name="messages" maxOccurs="unbounded">
49-
<xs:complexType>
50-
<xs:sequence>
51-
<xs:element ref="sbe:message" maxOccurs="unbounded"/>
52-
</xs:sequence>
53-
<xs:attribute name="description" type="xs:string"/>
54-
<xs:attribute name="package" type="xs:string">
55-
<xs:annotation>
56-
<xs:documentation>Overrides the messageSchema package</xs:documentation>
57-
</xs:annotation>
58-
</xs:attribute>
59-
<!-- required to support XIinclude -->
60-
<xs:attribute ref="xml:base"/>
61-
</xs:complexType>
62-
</xs:element>
23+
<xs:element ref="sbe:types" maxOccurs="unbounded"/>
24+
<xs:element ref="sbe:messages" maxOccurs="unbounded"/>
6325
</xs:sequence>
6426
<xs:attribute name="package" type="xs:string"/>
6527
<xs:attribute name="id" type="xs:unsignedShort">
@@ -102,12 +64,52 @@
10264
</xs:attribute>
10365
</xs:complexType>
10466
</xs:element>
105-
<xs:element name="message" type="sbe:blockType">
67+
<xs:element name="messages">
68+
<xs:complexType>
69+
<xs:sequence>
70+
<xs:element name="message" type="sbe:blockType" maxOccurs="unbounded">
71+
<xs:annotation>
72+
<xs:documentation>
73+
A message type, also known as a message template
74+
</xs:documentation>
75+
</xs:annotation>
76+
</xs:element>
77+
</xs:sequence>
78+
<xs:attribute name="description" type="xs:string"/>
79+
<xs:attribute name="package" type="xs:string">
80+
<xs:annotation>
81+
<xs:documentation>Overrides the messageSchema package</xs:documentation>
82+
</xs:annotation>
83+
</xs:attribute>
84+
<!-- required to support XInclude -->
85+
<xs:attribute ref="xml:base"/>
86+
</xs:complexType>
87+
</xs:element>
88+
<xs:element name="types">
10689
<xs:annotation>
10790
<xs:documentation>
108-
A message type, also known as a message template
91+
More than one set of types may be provided.
92+
Names must be unique across all encoding
93+
types.
94+
Encoding types may appear in any order.
10995
</xs:documentation>
11096
</xs:annotation>
97+
<xs:complexType>
98+
<xs:choice maxOccurs="unbounded">
99+
<xs:element name="type" type="sbe:simpleDataType"/>
100+
<xs:element name="composite" type="sbe:compositeDataType"/>
101+
<xs:element name="enum" type="sbe:enumType"/>
102+
<xs:element name="set" type="sbe:setType"/>
103+
</xs:choice>
104+
<xs:attribute name="description" type="xs:string"/>
105+
<xs:attribute name="package" type="xs:string">
106+
<xs:annotation>
107+
<xs:documentation>Overrides the messageSchema package</xs:documentation>
108+
</xs:annotation>
109+
</xs:attribute>
110+
<!-- required to support XInclude -->
111+
<xs:attribute ref="xml:base"/>
112+
</xs:complexType>
111113
</xs:element>
112114
<!-- Complex types -->
113115
<xs:complexType name="blockType">

0 commit comments

Comments
 (0)