Open skinkie opened 8 years ago
NeTEx has a special trick (through the use of the version attribute that you can set to "any" if the version is unknow, undefined or the latest) to activate the vlaidation process. Alle the rules are at the end of the NeTEx_publication.xsd file. You can also define specific rules for external references as wa have done for the French profile (check http://www.normes-donnees-tc.org/wp-content/uploads/2015/10/Validation_NeTEx_Arr%C3%AAt_2015-v2.3.pdf in 4.1-Référence interne, externe et validation automatique, and http://www.normes-donnees-tc.org/wp-content/uploads/2015/11/NF_Profil-NeTEx-%C3%A9l%C3%A9ments-communsF-v1.5-v.pdf in 6.3.1-Codification des identifiants ... sorry it is in French)
For the Dutch schema I have implemented reference validation. For example:
<xsd:key name="LineId">
<xsd:selector xpath=".//netex:Line"/>
<xsd:field xpath="@id"/>
</xsd:key>
<xsd:keyref name="LineRef" refer="LineId">
<xsd:selector xpath=".//netex:LineRef"/>
<xsd:field xpath="@ref"/>
</xsd:keyref>
StartPointRef/EndPointRef are not being checked.
One of the things that currently seem to lack in the xml schema is the validation of the semantics of a NeTEx document. What I mean here is that a certain object types may refer to another (strict) object type which should fail in the XSD validation, when incorrect. An example of such reference can be found below.
The PointProjectionRef refers to a RoutePoint, there isn't any logic that nameOfRefClass would limit the reference made from this entity to the foreign entity. One would expect that the nameOfRefClass should be defined in the scope of this object. Hence a PointProjectionRef must only refer to object of class of Point. xs:keyref should facilitate this effort. http://docstore.mik.ua/orelly/xml/schema/ch09_03.htm
Secondary the reference itself is not to be present in the document and/or to be unique. If we consider the parent type of all ObjectIds we end up with an xsd:normalizedString. This would lead to the use of xs:ID upon definition and xs:IDREF upon reference. http://docstore.mik.ua/orelly/xml/schema/ch09_01.htm
The XML Source.
And the XML Schema's: