Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 44 additions & 64 deletions repository/src/main/resources/xsd/repository.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<xs:complexType>
<xs:sequence>
<xs:element name="codeSet" type="fixr:codeSetType" minOccurs="0" maxOccurs="unbounded">
<xs:key name="codeKey">
<xs:key name="codeNameKey">
<xs:selector xpath="fixr:code"/>
<xs:field xpath="@name"/>
</xs:key>
Expand All @@ -77,7 +77,7 @@
<xs:key name="codeSetIdKey">
<xs:selector xpath="fixr:codeSet"/>
<xs:field xpath="@id"/>
<xs:field xpath="@scenarioId"/>
<xs:field xpath="@scenario"/>
</xs:key>
</xs:element>
<!-- Component definitions -->
Expand All @@ -98,7 +98,7 @@
<xs:key name="componentIdKey">
<xs:selector xpath="fixr:component"/>
<xs:field xpath="@id"/>
<xs:field xpath="@scenarioId"/>
<xs:field xpath="@scenario"/>
</xs:key>
</xs:element>
<!-- Concept definitions -->
Expand Down Expand Up @@ -127,18 +127,13 @@
<xs:key name="datatypeKey">
<xs:selector xpath="fixr:datatype"/>
<xs:field xpath="@name"/>
<xs:field xpath="@scenarioId"/>
</xs:key>
</xs:element>
<!-- Field definitions -->
<xs:element name="fields">
<xs:complexType>
<xs:sequence>
<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>
Comment on lines -138 to -141
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this up a level to fieldTypeOrCodeSetKey to match the pattern of other keys.

</xs:element>
<xs:element name="annotation" type="fixr:annotation" minOccurs="0"/>
</xs:sequence>
Expand All @@ -152,7 +147,11 @@
<xs:key name="fieldIdKey">
<xs:selector xpath="fixr:field"/>
<xs:field xpath="@id"/>
<xs:field xpath="@scenarioId"/>
<xs:field xpath="@scenario"/>
</xs:key>
<xs:key name="fieldTypeOrCodeSetKey">
<xs:selector xpath="fixr:field"/>
<xs:field xpath="@type|@codeSet"/>
</xs:key>
</xs:element>
<!-- Group definitions -->
Expand All @@ -173,7 +172,7 @@
<xs:key name="groupIdKey">
<xs:selector xpath="fixr:group"/>
<xs:field xpath="@id"/>
<xs:field xpath="@scenarioId"/>
<xs:field xpath="@scenario"/>
</xs:key>
</xs:element>
<!-- Message definitions -->
Expand All @@ -200,7 +199,7 @@
</xs:annotation>
<xs:selector xpath="fixr:message"/>
<xs:field xpath="@id"/>
<xs:field xpath="@scenarioId"/>
<xs:field xpath="@scenario"/>
</xs:key>
</xs:element>
<!-- Main schema element with references to all supported elements -->
Expand Down Expand Up @@ -245,65 +244,42 @@
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- Datatype definitions must have a unique combination of name and scenario ID -->
<xs:key name="datatypeRefKey">
<xs:selector xpath="fixr:datatypes/fixr:datatype"/>
<xs:field xpath="@name"/>
<xs:field xpath="@scenarioId"/>
</xs:key>
<!-- Type and scenario ID attributes in a field definition must reference a valid datatype name and scenario ID -->
<xs:keyref name="typeKeyref" refer="fixr:datatypeRefKey">
<!-- Type attribute of a code set definition must reference a valid datatype name -->
<xs:keyref name="codeSetTypeKeyRef" refer="fixr:datatypeKey">
<xs:selector xpath="fixr:codeSets/fixr:codeSet"/>
<xs:field xpath="@type"/>
</xs:keyref>
<!-- Type attribute of a field definition must reference a valid datatype name -->
<xs:keyref name="fieldTypeKeyRef" refer="fixr:datatypeKey">
<xs:selector xpath="fixr:fields/fixr:field"/>
<xs:field xpath="@type"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<!-- Code set definitions must have a unique combination of name and scenario ID -->
<xs:key name="codeSetRefKey">
<xs:selector xpath="fixr:codeSets/fixr:codeSet"/>
<xs:field xpath="@name"/>
<xs:field xpath="@scenarioId"/>
</xs:key>
<!-- Code set and scenario ID attributes in a field definition must reference a valid code set name and scenario ID -->
<xs:keyref name="codeSetKeyref" refer="fixr:codeSetRefKey">
<!-- Code set and scenario attributes in a field definition must reference a valid code set name and scenario -->
<xs:keyref name="fieldCodeSetKeyRef" refer="fixr:codeSetNameKey">
<xs:selector xpath="fixr:fields/fixr:field"/>
<xs:field xpath="@codeSet"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<!-- Code set definitions must have a unique name across all scenario names -->
<xs:key name="scenarioNameKey">
<xs:selector xpath="fixr:scenarios/fixr:scenario"/>
<xs:field xpath="@name"/>
</xs:key>
<!-- Code set definitions must have a unique ID across all scenario IDs -->
<xs:key name="scenarioIdKey">
<xs:selector xpath="fixr:scenarios/fixr:scenario"/>
<xs:field xpath="@id"/>
</xs:key>
<!-- A scenario ID used in a code set definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="codeSetScenarioKeyRef" refer="fixr:scenarioIdKey">
<xs:selector xpath="fixr:codeSet"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<!-- A scenario ID used in a datatype definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="datatypeScenarioKeyRef" refer="fixr:scenarioIdKey">
<xs:selector xpath="fixr:datatype"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<!-- A scenario ID used in a component definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="componentScenarioKeyRef" refer="fixr:scenarioIdKey">
<xs:selector xpath="fixr:component"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<!-- A scenario ID used in a group definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="groupScenarioKeyRef" refer="fixr:scenarioIdKey">
<xs:selector xpath="fixr:group"/>
<xs:field xpath="@scenarioId"/>
</xs:keyref>
<!-- A scenario ID used in a message definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="messageScenarioKeyRef" refer="fixr:scenarioIdKey">
<xs:selector xpath="fixr:message"/>
<xs:field xpath="@scenarioId"/>
<xs:field xpath="@scenario"/>
</xs:keyref>
<!-- A scenario used in a code set definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="codeSetScenarioKeyRef" refer="fixr:scenarioKey">
<xs:selector xpath="fixr:codeSets/fixr:codeSet"/>
<xs:field xpath="@scenario"/>
</xs:keyref>
<!-- A scenario used in a component definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="componentScenarioKeyRef" refer="fixr:scenarioKey">
<xs:selector xpath="fixr:components/fixr:component"/>
<xs:field xpath="@scenario"/>
</xs:keyref>
<!-- A scenario used in a group definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="groupScenarioKeyRef" refer="fixr:scenarioKey">
<xs:selector xpath="fixr:groups/fixr:group"/>
<xs:field xpath="@scenario"/>
</xs:keyref>
<!-- A scenario used in a message definition must be a valid scenario defined in the list of scenarios -->
<xs:keyref name="messageScenarioKeyRef" refer="fixr:scenarioKey">
<xs:selector xpath="fixr:messages/fixr:message"/>
<xs:field xpath="@scenario"/>
</xs:keyref>
</xs:element>
<!-- Scenario definitions -->
<xs:element name="scenarios">
Expand All @@ -317,6 +293,10 @@
</xs:sequence>
<xs:attribute ref="xml:base"/>
</xs:complexType>
<xs:key name="scenarioKey">
<xs:selector xpath="fixr:scenario"/>
<xs:field xpath="@name"/>
</xs:key>
</xs:element>
<!-- Section definitions -->
<xs:element name="sections">
Expand Down
15 changes: 0 additions & 15 deletions repository/src/main/resources/xsd/repositorytypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,6 @@
<xs:documentation>The use case of an element, distinguished by workflow, asset class, etc.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="scenarioId" type="fixr:id_t" default="1">
<xs:annotation>
<xs:documentation>Unique identifier of a scenario. Default is '1' for base scenario.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:simpleType name="presence_t">
<xs:restriction base="xs:string">
Expand Down Expand Up @@ -832,11 +827,6 @@
<xs:documentation>The use case of an element, distinguished by workflow, asset class, etc.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="scenarioId" type="fixr:id_t" default="1">
<xs:annotation>
<xs:documentation>Unique identifier of a scenario. Default is '1' for base scenario.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:attributeGroup name="scenarioRefGrp">
<xs:annotation>
Expand Down Expand Up @@ -892,11 +882,6 @@
<xs:sequence>
<xs:element name="annotation" type="fixr:annotation" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="fixr:id_t" default="1">
<xs:annotation>
<xs:documentation>Unique numeric identifier. Default is '1' is for base scenario.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" type="fixr:Name_t" default="base">
<xs:annotation>
<xs:documentation>Unique name</xs:documentation>
Expand Down
Loading