Skip to content

Commit

Permalink
Introduce OrderedVersionedChildStructure
Browse files Browse the repository at this point in the history
This would fix #769
Make it easier to validate obvious errors in implementations missing version and order attributes where applicable.
  • Loading branch information
skinkie committed Sep 4, 2024
1 parent 6170432 commit 4b91df7
Show file tree
Hide file tree
Showing 20 changed files with 67 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Rail transport, Roads and Road transport
<xsd:documentation>Name of source of the data.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:attribute name="order" type="xsd:positiveInteger" use="required">
<xsd:annotation>
<xsd:documentation>Order of name.</xsd:documentation>
</xsd:annotation>
Expand All @@ -149,7 +149,7 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for ALTERNATIVE NAME.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:element name="NamedObjectRef" type="VersionOfObjectRefStructure" minOccurs="0">
<xsd:annotation>
Expand Down Expand Up @@ -192,11 +192,6 @@ Rail transport, Roads and Road transport
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of name.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,10 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for a GROUP OF ENTITY MEMBERs. Subclass this for specific member types.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:element name="Description" type="MultilingualString" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of member within parent group.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,10 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for a POINT IN LINK SEQUENCE i.e. a Node of a graph.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="PointInLinkSequenceGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of POINT within parent.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down Expand Up @@ -176,15 +171,10 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for a LINK IN LINK SEQUENCE. I.e. an Edge of a graph.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="LinkInLinkSequenceGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of LINK in sequence.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,10 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for a POINT ON LINK.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="PointOnLinkGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>
Order of step in sequence
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for ALTERNATIVE TEXT </xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:element name="DataManagedObjectRef" type="VersionOfObjectRefStructure" minOccurs="0">
<xsd:annotation>
Expand All @@ -137,11 +137,6 @@ Rail transport, Roads and Road transport
<xsd:documentation>Name of language for which this is to be used. </xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of name.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Rail transport, Roads and Road transport
</xsd:annotation>
<xsd:simpleContent>
<xsd:extension base="VersionOfObjectRefStructure">
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:attribute name="order" type="xsd:positiveInteger" use="required">
<xsd:annotation>
<xsd:documentation>Order of element.</xsd:documentation>
</xsd:annotation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Rail transport, Roads and Road transport
<!-- ======================================================================= -->
<xsd:element name="VersionedChild" type="VersionedChildStructure" abstract="true" substitutionGroup="EntityInVersion">
<xsd:annotation>
<xsd:documentation>A child ENTIITY whose RESPONSIBILITY SET must be the same as its containing parent object, and which cannot exist independently of its parent.</xsd:documentation>
<xsd:documentation>A child ENTITY whose RESPONSIBILITY SET must be the same as its containing parent object, and which cannot exist independently of its parent.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="VersionedChildStructure">
Expand All @@ -125,6 +125,25 @@ Rail transport, Roads and Road transport
<xsd:element ref="Extensions" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:element name="OrderedVersionedChild" type="OrderedVersionedChildStructure" abstract="true" substitutionGroup="EntityInVersion">
<xsd:annotation>
<xsd:documentation>A ordered child ENTITY whose RESPONSIBILITY SET must be the same as its containing parent object, and which cannot exist independently of its parent.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="OrderedVersionedChildStructure">
<xsd:annotation>
<xsd:documentation>Type for VERSIONED CHILD.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:attribute name="order" type="xsd:positiveInteger" use="required">
<xsd:annotation>
<xsd:documentation>Order of element.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="DerivedView" type="DerivedViewStructure" abstract="true">
<xsd:annotation>
<xsd:documentation>Abstract derived view of a MANAGED OBJECT for general purpose use.</xsd:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Rail transport, Roads and Road transport
<xsd:documentation>Date reference was last changed.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="version" type="VersionIdType" use="optional">
<xsd:attribute name="version" type="VersionIdType" use="required">
<xsd:annotation>
<xsd:documentation>Version number of referenced entity.</xsd:documentation>
</xsd:annotation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,10 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for SECURITY LISTING.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="SecurityListingGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>order within list</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,19 +496,12 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for a TRAIN IN COMPOUND TRAIN.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:group ref="TrainInCompoundTrainGroup">
<xsd:annotation>
<xsd:documentation>Elements for a TRAIN IN COMPOUND TRAIN.</xsd:documentation>
</xsd:annotation>
</xsd:group>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>
Order of TRAIN IN COMPOUND TRAIN within TRAIN.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
14 changes: 2 additions & 12 deletions xsd/netex_part_1/part1_ifopt/netex_ifopt_stopPlace_version.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1282,15 +1282,10 @@ contained within its parent QUAY.</xsd:documentation>
<xsd:documentation>Type for a VEHICLE QUAY ALIGNMENT.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="VehicleQuayAlignmentGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of element.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down Expand Up @@ -1352,15 +1347,10 @@ contained within its parent QUAY.</xsd:documentation>
<xsd:documentation>Type for a VEHICLE POSTION ALIGNMENT.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="VehiclePositionAlignmentGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of attribute</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ Rail transport, Roads and ROAD transport
<xsd:documentation>Identifier of referenced entity.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:positiveInteger" use="optional">
<xsd:annotation>
<xsd:documentation>Relative order of ASSIGNMENT.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,6 @@ Rail transport, Roads and Road transport
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="AssignmentRefStructure">
<xsd:attribute name="version" type="VersionIdType" use="optional">
<xsd:annotation>
<xsd:documentation>Version number of referenced entity.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:positiveInteger" use="optional" default="1">
<xsd:annotation>
<xsd:documentation>Relative oOrder of ASSIGNMENT.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="ref" type="DisplayAssignmentIdType" use="required">
<xsd:annotation>
<xsd:documentation>Identifier of DISPLAY ASSIGNMENT.</xsd:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ LOGICAL DISPLAY corresponds to a SIRI STOP MONITORING point.</xsd:documentation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order in which to show ASSIGNMENT,</xsd:documentation>
<xsd:documentation>Order in which to show DISPLAY ASSIGNMENT.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="id" type="DisplayAssignmentIdType">
Expand Down
28 changes: 8 additions & 20 deletions xsd/netex_part_2/part2_journeyTimes/netex_call_version.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,13 @@ Rail transport, Roads and Road transport
<xsd:documentation>Data type for CALL.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="CallGroup"/>
<!-- The FacilityChangeElement has bee removed here in Siri 1.1, but it is still available at the same place through the AimedCallGroup->DisruptionGroup
(DisruptionGroup has been added to AimedCallGroup)
<xsd:element ref="FacilityChangeElement" minOccurs="0"/>
-->
<!-- The FacilityChangeElement has been removed here in Siri 1.1, but it is still available at the same place through the AimedCallGroup->DisruptionGroup (DisruptionGroup has been added to AimedCallGroup)
<xsd:element ref="FacilityChangeElement" minOccurs="0"/>
-->
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of Call within Journey.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="constrained" type="xsd:boolean"/>
</xsd:extension>
</xsd:complexContent>
Expand Down Expand Up @@ -304,19 +298,13 @@ Rail transport, Roads and Road transport
<xsd:documentation>Data type for DEAD RUN CALL.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="DeadRunCallGroup"/>
<!-- The FacilityChangeElement has bee removed here in Siri 1.1, but it is still available at the same place through the AimedDeadRunCallGroup->DisruptionGroup
(DisruptionGroup has been added to AimedDeadRunCallGroup)
<xsd:element ref="FacilityChangeElement" minOccurs="0"/>
-->
<!-- The FacilityChangeElement has bee removed here in Siri 1.1, but it is still available at the same place through the AimedDeadRunCallGroup->DisruptionGroup (DisruptionGroup has been added to AimedDeadRunCallGroup)
<xsd:element ref="FacilityChangeElement" minOccurs="0"/>
-->
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of DEAD RUN CALL within Journey.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ Rail transport, Roads and Road transport
<xsd:sequence>
<xsd:group ref="JourneyPartGroup"/>
</xsd:sequence>
<!-- Github: #770 -->
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of JOURNEY PART within JOURNEY.</xsd:documentation>
<xsd:documentation>Order of JOURNEY PART within JOURNEY.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
Expand Down Expand Up @@ -294,19 +295,14 @@ of the corresponding VEHICLE TYPE. true for forward.</xsd:documentation>
<xsd:documentation>Type for JOURNEY PART POSITION.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="JourneyPartPositionGroup">
<xsd:annotation>
<xsd:documentation>Elements for JOURNEY PART POSITION.</xsd:documentation>
</xsd:annotation>
</xsd:group>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order of JOURNEY PART POistion within JOURNEY PART.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down Expand Up @@ -445,6 +441,7 @@ of the corresponding VEHICLE TYPE. true for forward.</xsd:documentation>
<xsd:sequence>
<xsd:group ref="JourneyPartCoupleGroup"/>
</xsd:sequence>
<!-- Github: #770 -->
<xsd:attribute name="order" type="xsd:positiveInteger" use="required">
<xsd:annotation>
<xsd:documentation>Order of JOURNEY PART COUPLE. +v1.1</xsd:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,10 @@ Rail transport, Roads and Road transport
<xsd:documentation>Type for INTERCHANGE RULE PARAMETER.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="VersionedChildStructure">
<xsd:extension base="OrderedVersionedChildStructure">
<xsd:sequence>
<xsd:group ref="InterchangeRuleFilterGroup"/>
</xsd:sequence>
<xsd:attribute name="order" type="xsd:positiveInteger">
<xsd:annotation>
<xsd:documentation>Order in which to apply filter</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Rail transport, Roads and Road transport
<xsd:documentation>Identifier of a FARE ELEMENT IN SEQUENCE.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:positiveInteger"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
Expand Down
Loading

0 comments on commit 4b91df7

Please sign in to comment.