[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: 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@g...>
  • Date: Tue, 14 Aug 2018 12:39:57 -0400

RE:  Here's the regex for the xs:dateTime datatype
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@m...>; XML Developers List <xml-dev@l...>
Subject: Re:  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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.