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

format-date and xsd:date

Subject: format-date and xsd:date
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Mon, 9 Aug 2004 21:51:54 -0400
xsd date
I'm not really sure where this question/comment ought to go, but since it came in the midst of working with XSTL 2, this seems a good place.

The data-typing-related support in XSLT 2 is based on XML Schema. So, in both cases, a "date" is defined as YYYY-MM-DD, and anything else is invalid. While this makes sense when you consider YYYY/MM/DD, MM-DD-YYYY and so forth, why can't all of the following be valid dates?

YYYY-MM-DD
YYYY-MM
YYYY

This comes out of working with bibliographic data, where one typically has issue dates of year-only, sometimes year-and-month, and only occasionally the full "date" as understood by xs:date.

This means I have to define my own schema patterns if I write a schema, and my own equivalents to handle the stuff in XSLT 2 if I don't want to select the substrings.

Does nobody else find this a problem? Is there any prospect to change it?

I'm just having a hard time understanding how I can code a schema to enforce dates of the sort I deal with and also get the advantage of the datatyping and XSLT 2 date formatting.

If I do:

<date year="1999" month="03"/>

... that's easy to control and flexible, but there's no format-month function (in Saxon 8 at least).

Bruce

Current Thread

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