[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Here's the regex for the xs:dateTime datatype
- From: "Toby Considine" <Toby.Considine@gmail.com>
- To: "'Liam R. E. Quin'" <liam@fromoldbooks.org>,"'David Carlisle'" <d.p.carlisle@gmail.com>
- Date: Tue, 14 Aug 2018 12:39:57 -0400
And as we wander down the road toward the one true solution, be sure to consider the non-Gregorian issues that can be quite engrossing. A start is the
Hijira calendar for the Islamic world
Shamsi & Jalaali (Persian) Calendar for Iran
The calendars based on blends of Solar and Lunar, including
Jewish Calendar
Chinese Calendar
At a minimum you should handle the issues described in RFC 7529...https://tools.ietf.org/html/rfc7529
tc
. It is a purely solar calendar, containing 12 months originally based on the zodiac cons
-----Original Message-----
From: Liam R. E. Quin [mailto:liam@fromoldbooks.org]
Sent: Tuesday, August 14, 2018 10:38 AM
To: David Carlisle <d.p.carlisle@gmail.com>
Cc: Michael Kay <mike@saxonica.com>; Costello, Roger L. <costello@mitre.org>; XML Developers List <xml-dev@lists.xml.org>
Subject: Re: [xml-dev] Here's the regex for the xs:dateTime datatype
On Tue, 2018-08-14 at 10:35 +0100, David Carlisle wrote:
> I don't fancy
> trying to encode the leap year rules as a regex:-)
There's a 4KByte regexp for time and date given in the O'Reilly Mastering Regular Expressions book. You could write it much more simply with Perl 6 regular expressions, which use a grammar, but those aren't (as far as i can tell) widely used or supported by libraries in other languages. It still doens't handle leap seconds correctly, i think.
> Also this doesn't account for any historic dates around calendar
> changes with variant numbers of days in a month.
The XSD calendar is "proleptic" and pretends the changes never happened. To get them right you have to know the geographic perspective, because the calendar changes happened at different years in different countries.
Since you can't get it right it's best not to try, but to go only as far as is useful, i think. Once the regexp gets even as complex as Roger's, it's goint to be impractical for most users to work out why their input wasn't valid. I like Peter's YYYY-MM-DD attribute
It'd be nice to have a standard way to designate something like HTML's default helper text to be shown in form fields; this is different from a default value.
Liam
--
Liam Quin, https://www.holoweb.net/liam/cv/ Web slave for vintage clipart http://www.fromoldbooks.org/ Available for XML/Document/Information Architecture/ XSL/XQuery/Web/Text Processing/A11Y work & consulting.
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]