Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Gracefully accept omission of 'T' letter? #2

Open
addicticks-dev opened this issue Apr 19, 2019 · 0 comments
Open

Gracefully accept omission of 'T' letter? #2

addicticks-dev opened this issue Apr 19, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@addicticks-dev
Copy link
Contributor

Considering this value:

2018-03-14 23:30:28.123Z

(the 'T' letter has been replaced by a space).

Should the library accept such value?

In the XML Schema Specification for xsd:dateTime it clearly states that the 'T' letter is mandatory as a separator between the date and the time value.

However, the XML Schema Specification is based on ISO-8601 which allows to replace the 'T' character with a space (strictly speaking it allows to "omit" it). Also, there's RFC-3339 which also allows the 'T' character to be replaced by space. Hence there's the misunderstood notion by some that it is acceptable to replace the 'T' character with a space.

There's no doubt that the above example value is not compliant with XML Schema. It is simply not a xsd:dateTime value. But the scenario is still seen in the wild from time to time. The argument seems to be readability, but that is a strange argument, because if the value is placed in XML (or JSON) then we are already outside the realm intended for human consumption. The right thing to do in the scenario would be to go back to the producer of the XML and ask him to change so that the value becomes compliant with XML Schema Specification. But what if he won't or can't or legacy compatibility issues dictates otherwise?

@addicticks-dev addicticks-dev added the enhancement New feature or request label Apr 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant