NeTEx icon indicating copy to clipboard operation
NeTEx copied to clipboard

Mutually exclusive attributes (for version and versionRef)

Open skinkie opened this issue 1 year ago • 3 comments

https://stackoverflow.com/questions/33748490/how-to-define-mutually-exclusive-attributes-in-xsd

skinkie avatar Sep 04 '24 12:09 skinkie

This may work when applied to every unique ref-element, but not at the top level (NeTEx_publication.xsd) hence cannot be disabled. Why? Because the constraint may only be applied on the local element (like the uniqueness of the key in the key-value-list).

diff --git a/xsd/netex_part_1/part1_tacticalPlanning/netex_servicePattern_support.xsd b/xsd/netex_part_1/part1_tacticalPlanning/netex_servicePattern_support.xsd
index d1ef9e63..9a78af18 100644
--- a/xsd/netex_part_1/part1_tacticalPlanning/netex_servicePattern_support.xsd
+++ b/xsd/netex_part_1/part1_tacticalPlanning/netex_servicePattern_support.xsd
@@ -82,6 +82,10 @@ Rail transport, Roads and Road transport
                <xsd:annotation>
                        <xsd:documentation>Reference to a SCHEDULED STOP POINT.</xsd:documentation>
                </xsd:annotation>
+           <xsd:key name="ScheduledStopPointRefVersionRequired">
+               <xsd:selector xpath="."/>
+               <xsd:field xpath="@version|@versionRef"/>
+           </xsd:key>
        </xsd:element>
        <xsd:complexType name="ScheduledStopPointRefStructure">
                <xsd:annotation>

skinkie avatar Sep 04 '24 13:09 skinkie

We would need to discuss we would do it, or can it be done automatically, but I think the above would significantly help the missing element situation.

skinkie avatar Sep 04 '24 13:09 skinkie

Keep this discussion opened and try to find proposal for next milestone (2.1)

Aurige avatar Oct 29 '24 13:10 Aurige