Skip to content
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

Merged
merged 3 commits into from
Apr 19, 2022
Merged

A sample grammar for ISO 8601 #76

merged 3 commits into from
Apr 19, 2022

Conversation

ndw
Copy link
Contributor

@ndw ndw commented Apr 17, 2022

No description provided.

</local-datetime>
```

If a datetime includes a specific offset from UTC, the sign is only included on the hour if its negative.
Copy link

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).

Copy link
Contributor Author

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 - 😆

Copy link
Contributor Author

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.

Copy link

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:
Copy link

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #75

@ndw ndw self-assigned this Apr 18, 2022
@ndw ndw added the samples Issues or proposals related to sample grammars label Apr 18, 2022
@ndw ndw added this to the Version 1.0 milestone Apr 18, 2022
Copy link
Contributor

@yamahito yamahito left a 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.

@ndw ndw merged commit 1d0af07 into invisibleXML:master Apr 19, 2022
@ndw ndw deleted the iso8601 branch April 19, 2022 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues or proposals related to sample grammars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants