-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A sample grammar for ISO 8601 #76
Conversation
samples/ISO-8601-2004/README.md
Outdated
</local-datetime> | ||
``` | ||
|
||
If a datetime includes a specific offset from UTC, the sign is only included on the hour if its negative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a mistake to me.
If I want to round-trip the XML back into an ISO 8601 (or similar) string, I need to have something like if (substring( offset-hour, 1, 1 ) eq '-') then '-' else '+'
. While that is not hard, it seems unnecessary. My instinct is to put a @direction
on <utc-offset>
(with value +
or -
, because in iXML we can’t convert that to east
or west
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I added a note about that specifically to draw attention to the choice to see what others thought. I'm not sure I'd want to specify east
or west
to be honest, as I'm not sure I'd be able to guess which one was +
and which one was -
😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've pushed an update that uses @direction
on the offset-hour
and makes it explicitly +
or -
instead of making the hour value signed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent.
Heh-heh. I was hoping for east
and west
precisely to make me look it up every time, so I would finally learn it!
|
||
Constructed by Norm Tovey-Walsh, April 2022. | ||
|
||
There are two grammars in this directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn’t this scream for some sort of <ix:include>
mechanism?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. Shame about the ambiguities, but I don't think it can be helped.
No description provided.