[railML2+3] Problems with 24:00:00 for midnight at end of day [message #3536] |
Tue, 01 April 2025 20:58  |
Thomas Nygreen
Messages: 89 Registered: March 2008
|
Member |
|
|
Dear all!
It has come to our attention that the default System.Xml library in MS .NET does not handle the time value/component "24:00:00" for midnight at the end of the day. This is a legal value for xs:time and legal part of xs:dateTime values according to the XML definition. For xs:time "24:00:00" is identical to "00:00:00", and for xs:dateTime "24:00:00" of one day is identical to "00:00:00" of the next day.
Except for IS:uptime, the use of "00:00:00" or "24:00:00" is not mentioned in the railML documentation or wiki. We have since 2021 recommended to use "24:00:00" for the @until attribute of IS:uptime, when referring to midnight at the end of the day. As a commonly used library is unable to parse the value "24:00:00" we will no longer recommend using it for IS:uptime, but this issue also extends to all railML attributes of type xs:time and xs:dateTime.
I am writing here in the timetable forum because xs:time is most heavily used in the timetable subschema, and any input from the timetable community is valuable in determining the way forward.
So the questions to the community are:
1. Are you using "24:00:00" in your interfaces?
2. Should we syntactically disallow the use of "24:00:00" from railML 3.4 onwards?
Best regards,
Thomas Nygreen
Thomas Nygreen – Common Schema Coordinator
railML.org (Registry of Associations: VR 5750)
Altplauen 19h; 01187 Dresden; Germany www.railML.org
[Updated on: Thu, 10 April 2025 17:08] Report message to a moderator
|
|
|
Re: [railML2+3] Problems with 24:00:00 for midnight at end of day [message #3558 is a reply to message #3536] |
Thu, 10 April 2025 17:12   |
Thomas Nygreen
Messages: 89 Registered: March 2008
|
Member |
|
|
Hello again,
I have tested and verified that "24:00:00" can be excluded from xs:time and xs:dateTime with restriction patterns:
<xs:simpleType name="tTimeUniqueMidnight">
<xs:restriction base="xs:time">
<xs:pattern value="([0-1][0-9]|2[0-3]).*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="tDateTimeUniqueMidnight">
<xs:restriction base="xs:dateTime">
<xs:pattern value="[0-9-]{10}T([0-1][0-9]|2[0-3]).*"/>
</xs:restriction>
</xs:simpleType>
It remains to be decided if we want to do this, so any feedback is very welcome.
Git issue: https://development.railml.org/railml/version3/-/issues/646
Best regards
Thomas
Thomas Nygreen – Common Schema Coordinator
railML.org (Registry of Associations: VR 5750)
Altplauen 19h; 01187 Dresden; Germany www.railML.org
|
|
|
Re: [railML2+3] Problems with 24:00:00 for midnight at end of day [message #3559 is a reply to message #3558] |
Fri, 11 April 2025 08:41  |
David Lichti
Messages: 51 Registered: December 2020
|
Member |
|
|
Hi Thomas,
Answering your questions:
1. Yes. We have patched our XML serialization library to properly generate 24:00 values in railML 3.2.
2. No. For example, the <period> element would loose the ability to explicitly express a period that ends at midnight.
We do use 24:00 as a time period bound, for example in possessions, which are being exported as railML. This is a relevant value. If the domain of xs:time values was restricted, we would have to
- approximate 24:00 by 23:59:59.
- imply 24:00 by omiting the period@to attribute.
- imply 24:00 by using a value of 00:00.
- model 24:00 with an additional dayOffset attribute.
None of these are particularly enticing.
Best regards
|
|
|