Skip to content

Commit

Permalink
[repository schema] Field type attribute does not distinguish between…
Browse files Browse the repository at this point in the history
… datatype and code set reference FIXTradingCommunity#170

Note: Sample file does not pass validation due to schema changes.
  • Loading branch information
donmendelson committed Sep 22, 2022
1 parent bf708b6 commit 6341fc7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
23 changes: 19 additions & 4 deletions repository/src/main/resources/xsd/repository.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@
<xs:element name="fields">
<xs:complexType>
<xs:sequence>
<xs:element name="field" type="fixr:fieldType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="field" type="fixr:fieldType" minOccurs="0" maxOccurs="unbounded">
<xs:key name="typeKey">
<xs:selector xpath="."/>
<xs:field xpath="@type|@codeSet"/>
</xs:key>
</xs:element>
<xs:element name="annotation" type="fixr:annotation" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="latestEP" type="fixr:EP_t"/>
Expand Down Expand Up @@ -250,16 +255,26 @@
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:key name="typeKey">
<xs:selector xpath="fixr:codeSets/fixr:codeSet|fixr:datatypes/fixr:datatype"/>
<xs:key name="datatypeRefKey">
<xs:selector xpath="fixr:datatypes/fixr:datatype"/>
<xs:field xpath="@name"/>
<xs:field xpath="@scenarioId"/>
</xs:key>
<xs:keyref name="typeKeyref" refer="fixr:typeKey">
<xs:keyref name="typeKeyref" refer="fixr:datatypeRefKey">
<xs:selector xpath="fixr:fields/fixr:field"/>
<xs:field xpath="@type"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<xs:key name="codesetRefKey">
<xs:selector xpath="fixr:codeSets/fixr:codeSet"/>
<xs:field xpath="@name"/>
<xs:field xpath="@scenarioId"/>
</xs:key>
<xs:keyref name="codesetKeyref" refer="fixr:codesetRefKey">
<xs:selector xpath="fixr:fields/fixr:field"/>
<xs:field xpath="@codeSet"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<xs:key name="scenarioNameKey">
<xs:selector xpath="fixr:scenarios/fixr:scenario"/>
<xs:field xpath="@name"/>
Expand Down
13 changes: 9 additions & 4 deletions repository/src/main/resources/xsd/repositorytypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
<xs:documentation>Name of this rule</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" type="xs:string">
<xs:attribute name="type" type="fixr:Name_t">
<xs:annotation>
<xs:documentation>Overrides the type of the referenced field.
</xs:documentation>
Expand Down Expand Up @@ -484,10 +484,15 @@
</xs:sequence>
<xs:attributeGroup ref="fixr:oidGrp"/>
<xs:attributeGroup ref="fixr:entityAttribGrp"/>
<xs:attribute name="type" type="xs:string" use="required">
<xs:attribute name="type" type="fixr:Name_t">
<xs:annotation>
<xs:documentation>Attribute type refers to either a datatype or a
codeSet, which carries an underlying datatype.
<xs:documentation>Attribute type refers to a datatype name
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="codeSet" type="fixr:Name_t">
<xs:annotation>
<xs:documentation>Attribute codeSet refers to a codeSet name
</xs:documentation>
</xs:annotation>
</xs:attribute>
Expand Down

0 comments on commit 6341fc7

Please sign in to comment.