Altova Mailing List Archives
>xsl-list Archive Home
>Recent entries
>Thread Prev -
>Thread Next - RE: [xsl] format-date and xsd:date
[xsl] format-date and xsd:date
To:
Date: 8/10/2004 1:52:00 AM
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
Disclaimer
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

