Skip to content

Conversation

@skinkie
Copy link
Contributor

@skinkie skinkie commented Oct 5, 2025

As requested by @thbar script and executed code to compare.

This code checks NeTEx_publication.xsd for selectors (xpath) that do not exist in the XML Schema at all. This is hygiene.

@skinkie skinkie self-assigned this Oct 5, 2025
@skinkie skinkie added the hygiene Technical dept, results in a breaking change. label Oct 5, 2025
@skinkie skinkie marked this pull request as draft October 5, 2025 11:29
@skinkie skinkie marked this pull request as ready for review October 5, 2025 11:42
Copy link
Contributor

@ue71603 ue71603 left a comment

Choose a reason for hiding this comment

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

An MD file is needed to explain what is in the scripts folder. It should tell, what the script is doing.

@skinkie skinkie requested a review from ue71603 October 8, 2025 00:17
Copy link
Contributor

@ue71603 ue71603 left a comment

Choose a reason for hiding this comment

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

So things like

<!-- =====GroupOfServicesMember Key ========================== -->
		<xsd:keyref name="GroupOfServicesMember_KeyRef" refer="netex:GroupOfServicesMember_AnyVersionedKey_ordered">
			<xsd:selector xpath=".//netex:GroupOfServicesMemberRef"/>
			<xsd:field xpath="@ref"/>
			<xsd:field xpath="@version"/>
		</xsd:keyref>
		<xsd:key name="GroupOfServicesMember_AnyVersionedKey_ordered">
			<xsd:selector xpath=".//netex:GroupOfServicesMember"/>
			<xsd:field xpath="@id"/>
			<xsd:field xpath="@version"/>
		</xsd:key>
		<!-- =====JourneyFrequencyGroup============================== -->
		<!-- =====JourneyFrequencyGroup unique========================== -->
		<xsd:unique name="JourneyFrequencyGroup_UniqueBy_Id_Version">
			<xsd:annotation>
				<xsd:documentation>Every [JourneyFrequencyGroup Id + Version] must be unique within document.</xsd:documentation>
			</xsd:annotation>
			<xsd:selector xpath=".//netex:JourneyFrequencyGroup"/>
			<xsd:field xpath="@id"/>
			<xsd:field xpath="@version"/>
		</xsd:unique>

don't exist in the XSD? Is this really so or was something not merged into the XSD?

Copy link
Contributor

@ue71603 ue71603 left a comment

Choose a reason for hiding this comment

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

better example:


		<!-- =====ParkingAreaCapacityAssignment=========================== -->
		<!-- =====ParkingAreaCapacityAssignment unique========================== -->
		<xsd:unique name="ParkingAreaCapacityAssignment_UniqueBy_Id_Version_Order">
			<xsd:annotation>
				<xsd:documentation>Every [ParkingAreaCapacityAssignment Id + Version + order] must be unique within document.</xsd:documentation>
			</xsd:annotation>
			<xsd:selector xpath=".//netex:ParkingAreaCapacityAssignment"/>
			<xsd:field xpath="@id"/>
			<xsd:field xpath="@version"/>
		</xsd:unique>
		<!-- =====ParkingAreaCapacityAssignment Key ========================== -->
		<xsd:keyref name="ParkingAreaCapacityAssignment_KeyRef" refer="netex:ParkingAreaCapacityAssignment_AnyVersionedKey">
			<xsd:selector xpath=".//netex:ParkingAreaCapacityAssignmentRef"/>
			<xsd:field xpath="@ref"/>
			<xsd:field xpath="@version"/>
		</xsd:keyref>
		<xsd:key name="ParkingAreaCapacityAssignment_AnyVersionedKey">
			<xsd:selector xpath=".//netex:ParkingAreaCapacityAssignment"/>
			<xsd:field xpath="@id"/>
			<xsd:field xpath="@version"/>
		</xsd:key>

@skinkie
Copy link
Contributor Author

skinkie commented Oct 8, 2025

@ue71603

git checkout next
git pull 
grep -ri name=\"ParkingAreaCapacityAssignment\" # empty
grep -ri name=\"ParkingAreaCapacityAssignmentRef\" # empty

Here you see that both selectors never exists in the schema.

GroupOfServicesMember exists, but GroupOfServicesMemberRef does not. Hence the relationship does not make sense, there is nothing to check for so the constraint is removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hygiene Technical dept, results in a breaking change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants