Skip to content

Commit 86e3bd5

Browse files
committed
XInclude does not work because of missing xml:base attribute allowance #94
1 parent 6d16b2c commit 86e3bd5

File tree

4 files changed

+64
-80
lines changed

4 files changed

+64
-80
lines changed
Lines changed: 34 additions & 36 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"
3-
package="Examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe sbe.xsd">
4-
<xi:include href="Includes.xml" parse="xml"/>
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.xsd">
3+
<!-- include commonly used types -->
4+
<xi:include href="types-include.xml" parse="xml"/>
55
<types>
66
<type name="date" primitiveType="uint16"/>
77
<type name="enumEncoding" primitiveType="char"/>
@@ -12,7 +12,6 @@ package="Examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocati
1212
<type name="length" primitiveType="uint16"/>
1313
<type name="varData" length="0" primitiveType="uint8"/>
1414
</composite>
15-
1615
<composite name="groupSizeEncoding">
1716
<type name="blockLength" primitiveType="uint16"/>
1817
<type name="numInGroup" primitiveType="uint16"/>
@@ -84,36 +83,35 @@ package="Examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocati
8483
<validValue name="Sell">2</validValue>
8584
</enum>
8685
</types>
87-
<sbe:message name="BusinessMessageReject" id="97" blockLength="9" semanticType="j">
88-
<field name="BusinesRejectRefId" id="379" type="idString" offset="0" semanticType="String"/>
89-
<field name="BusinessRejectReason" id="380" type="businessRejectReasonEnum" offset="8" semanticType="int"/>
90-
<data name="Text" id="58" type="DATA" semanticType="data"/>
91-
</sbe:message>
92-
<sbe:message name="ExecutionReport" id="98" blockLength="42" semanticType="8">
93-
<field name="OrderID" id="37" type="idString" offset="0" semanticType="String"/>
94-
<field name="ExecID" id="17" type="idString" offset="8" semanticType="String"/>
95-
<field name="ExecType" id="150" type="execTypeEnum" offset="16" semanticType="char"/>
96-
<field name="OrdStatus" id="39" type="ordStatusEnum" offset="17" semanticType="char"/>
97-
<field name="Symbol" id="55" type="idString" offset="18" semanticType="String"/>
98-
<field name="MaturityMonthYear" id="200" type="MONTH_YEAR" offset="26" semanticType="MonthYear"/>
99-
<field name="Side" id="54" type="sideEnum" offset="31" semanticType="char"/>
100-
<field name="LeavesQty" id="151" type="qtyEncoding" offset="32" semanticType="Qty"/>
101-
<field name="CumQty" id="14" type="qtyEncoding" offset="36" semanticType="Qty"/>
102-
<field name="TradeDate" id="75" type="date" offset="40" semanticType="LocalMktDate"/>
103-
<group name="FillsGrp" id="2112" blockLength="12" dimensionType="groupSizeEncoding">
104-
<field name="FillPx" id="1364" type="decimalEncoding" offset="0" semanticType="Price"/>
105-
<field name="FillQty" id="1365" type="qtyEncoding" offset="8" semanticType="Qty"/>
106-
</group>
107-
</sbe:message>
108-
<sbe:message name="NewOrderSingle" id="99" blockLength="54" semanticType="D">
109-
<field name="ClOrdId" id="11" type="idString" offset="0" semanticType="String"/>
110-
<field name="Account" id="1" type="idString" offset="8" semanticType="String"/>
111-
<field name="Symbol" id="55" type="idString" offset="16" semanticType="String"/>
112-
<field name="Side" id="54" type="sideEnum" offset="24" semanticType="char"/>
113-
<field name="TransactTime" id="60" type="timestampEncoding" offset="25" semanticType="UTCTimestamp"/>
114-
<field name="OrderQty" id="38" type="qtyEncoding" offset="33" semanticType="Qty"/>
115-
<field name="OrdType" id="40" type="ordTypeEnum" offset="37" semanticType="char"/>
116-
<field name="Price" id="44" type="decimalEncoding" offset="38" semanticType="Price" presence="optional"/>
117-
<field name="StopPx" id="99" type="decimalEncoding" offset="46" semanticType="Price" presence="optional"/>
118-
</sbe:message>
86+
<messages>
87+
<sbe:message name="ExecutionReport" id="98" blockLength="42" semanticType="8">
88+
<field name="OrderID" id="37" type="idString" offset="0" semanticType="String"/>
89+
<field name="ExecID" id="17" type="idString" offset="8" semanticType="String"/>
90+
<field name="ExecType" id="150" type="execTypeEnum" offset="16" semanticType="char"/>
91+
<field name="OrdStatus" id="39" type="ordStatusEnum" offset="17" semanticType="char"/>
92+
<field name="Symbol" id="55" type="idString" offset="18" semanticType="String"/>
93+
<field name="MaturityMonthYear" id="200" type="MONTH_YEAR" offset="26" semanticType="MonthYear"/>
94+
<field name="Side" id="54" type="sideEnum" offset="31" semanticType="char"/>
95+
<field name="LeavesQty" id="151" type="qtyEncoding" offset="32" semanticType="Qty"/>
96+
<field name="CumQty" id="14" type="qtyEncoding" offset="36" semanticType="Qty"/>
97+
<field name="TradeDate" id="75" type="date" offset="40" semanticType="LocalMktDate"/>
98+
<group name="FillsGrp" id="2112" blockLength="12" dimensionType="groupSizeEncoding">
99+
<field name="FillPx" id="1364" type="decimalEncoding" offset="0" semanticType="Price"/>
100+
<field name="FillQty" id="1365" type="qtyEncoding" offset="8" semanticType="Qty"/>
101+
</group>
102+
</sbe:message>
103+
<sbe:message name="NewOrderSingle" id="99" blockLength="54" semanticType="D">
104+
<field name="ClOrdId" id="11" type="idString" offset="0" semanticType="String"/>
105+
<field name="Account" id="1" type="idString" offset="8" semanticType="String"/>
106+
<field name="Symbol" id="55" type="idString" offset="16" semanticType="String"/>
107+
<field name="Side" id="54" type="sideEnum" offset="24" semanticType="char"/>
108+
<field name="TransactTime" id="60" type="timestampEncoding" offset="25" semanticType="UTCTimestamp"/>
109+
<field name="OrderQty" id="38" type="qtyEncoding" offset="33" semanticType="Qty"/>
110+
<field name="OrdType" id="40" type="ordTypeEnum" offset="37" semanticType="char"/>
111+
<field name="Price" id="44" type="decimalEncoding" offset="38" semanticType="Price" presence="optional"/>
112+
<field name="StopPx" id="99" type="decimalEncoding" offset="46" semanticType="Price" presence="optional"/>
113+
</sbe:message>
114+
</messages>
115+
<!-- include commonly used messages -->
116+
<xi:include href="messages-include.xml" parse="xml"/>
119117
</sbe:messageSchema>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?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">
4+
<field name="BusinesRejectRefId" id="379" type="idString" offset="0" semanticType="String"/>
5+
<field name="BusinessRejectReason" id="380" type="businessRejectReasonEnum" offset="8" semanticType="int"/>
6+
<data name="Text" id="58" type="DATA" semanticType="data"/>
7+
</sbe:message>
8+
</messages>
Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- edited with XMLSpy v2018 sp1 (x64) (http://www.altova.com) by Don Mendelson (FIX Protocol Ltd. (FPL)) -->
3-
<xs:schema xmlns:sbe="http://fixprotocol.io/2017/sbe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" targetNamespace="http://fixprotocol.io/2017/sbe" elementFormDefault="unqualified" version="2.0RC2" vc:minVersion="1.1">
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">
43
<xs:annotation>
54
<xs:documentation>
65
Message schema for FIX Simple Binary Encoding
@@ -38,10 +37,29 @@
3837
<xs:element name="set" type="sbe:setType"/>
3938
</xs:choice>
4039
<xs:attribute name="description" type="xs:string"/>
41-
<xs:attribute ref="xml:base" />
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"/>
4261
</xs:complexType>
4362
</xs:element>
44-
<xs:element ref="sbe:message" maxOccurs="unbounded"/>
4563
</xs:sequence>
4664
<xs:attribute name="package" type="xs:string"/>
4765
<xs:attribute name="id" type="xs:unsignedShort">
@@ -169,16 +187,6 @@
169187
<xs:attributeGroup ref="sbe:primitiveTypeAttributes"/>
170188
<xs:attributeGroup ref="sbe:offsetAttributes"/>
171189
<xs:attributeGroup ref="sbe:presenceAttributes"/>
172-
<xs:assert test="not (@offset and @alignment)">
173-
<xs:annotation>
174-
<xs:documentation>Attributes offset and alignment are mutually exclusive</xs:documentation>
175-
</xs:annotation>
176-
</xs:assert>
177-
<xs:assert test="not (@presence='constant' and (@nullValue or @minValue or @maxValue))">
178-
<xs:annotation>
179-
<xs:documentation>Constant is mutually exclusive with value attributes</xs:documentation>
180-
</xs:annotation>
181-
</xs:assert>
182190
</xs:extension>
183191
</xs:simpleContent>
184192
</xs:complexType>
@@ -199,11 +207,6 @@
199207
<xs:attribute name="description" type="xs:string"/>
200208
<xs:attributeGroup ref="sbe:offsetAttributes"/>
201209
<xs:attributeGroup ref="sbe:versionAttributes"/>
202-
<xs:assert test="not (@offset and @alignment)">
203-
<xs:annotation>
204-
<xs:documentation>Attributes offset and alignment are mutually exclusive</xs:documentation>
205-
</xs:annotation>
206-
</xs:assert>
207210
</xs:complexType>
208211
<xs:complexType name="enumType" mixed="true">
209212
<xs:annotation>
@@ -219,11 +222,6 @@
219222
<xs:attribute name="description" type="xs:string"/>
220223
<xs:attributeGroup ref="sbe:offsetAttributes"/>
221224
<xs:attributeGroup ref="sbe:versionAttributes"/>
222-
<xs:assert test="not (@offset and @alignment)">
223-
<xs:annotation>
224-
<xs:documentation>Attributes offset and alignment are mutually exclusive</xs:documentation>
225-
</xs:annotation>
226-
</xs:assert>
227225
</xs:complexType>
228226
<xs:complexType name="validValue">
229227
<xs:annotation>
@@ -254,11 +252,6 @@
254252
</xs:annotation>
255253
</xs:attribute>
256254
<xs:attributeGroup ref="sbe:offsetAttributes"/>
257-
<xs:assert test="not (@offset and @alignment)">
258-
<xs:annotation>
259-
<xs:documentation>Attributes offset and alignment are mutually exclusive</xs:documentation>
260-
</xs:annotation>
261-
</xs:assert>
262255
</xs:complexType>
263256
<xs:complexType name="setType" mixed="true">
264257
<xs:annotation>
@@ -274,11 +267,6 @@
274267
<xs:attribute name="description" type="xs:string"/>
275268
<xs:attributeGroup ref="sbe:offsetAttributes"/>
276269
<xs:attributeGroup ref="sbe:versionAttributes"/>
277-
<xs:assert test="not (@offset and @alignment)">
278-
<xs:annotation>
279-
<xs:documentation>Attributes offset and alignment are mutually exclusive</xs:documentation>
280-
</xs:annotation>
281-
</xs:assert>
282270
</xs:complexType>
283271
<xs:complexType name="choice">
284272
<xs:annotation>
@@ -314,16 +302,6 @@
314302
<xs:attributeGroup ref="sbe:presenceAttributes"/>
315303
<xs:attributeGroup ref="sbe:semanticAttributes"/>
316304
<xs:attributeGroup ref="sbe:versionAttributes"/>
317-
<xs:assert test="not (@offset and @alignment)">
318-
<xs:annotation>
319-
<xs:documentation>Attributes offset and alignment are mutually exclusive</xs:documentation>
320-
</xs:annotation>
321-
</xs:assert>
322-
<xs:assert test="not (@presence='constant' and (@nullValue or @minValue or @maxValue))">
323-
<xs:annotation>
324-
<xs:documentation>Constant is mutually exclusive with value attributes</xs:documentation>
325-
</xs:annotation>
326-
</xs:assert>
327305
</xs:complexType>
328306
<!-- Simple types -->
329307
<xs:simpleType name="qualifiedName_t">

0 commit comments

Comments
 (0)