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

Re: XSL Calendar functions?

Subject: Re: XSL Calendar functions?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 29 Mar 2007 22:40:41 +0200
Re:  XSL Calendar functions?
Thomas Zastrow wrote:


I looked around for some calendar / date / functions in XSL, but there seems nothing to be in the standard? Are there any free stylesheets for creating a calendar or so?



Take a look at the XSLT Standard Library: http://xsltsl.sourceforge.net/, or, more specifically, here: http://xsltsl.sourceforge.net/date-time.html


If you can use XSLT 2.0, you will find that the standard has very many time/date functions, duration functions and date/time arithmetics using simple addition/subtraction. Also, XPath 2.0 adds the current-date(), current-time() and current-dateTime() functions, which were severely missing in XSLT 1.0.

If you do need the current date/time in XSLT 1.0 (which is not possible directly), you have five options (and neither are in the XSLT SL):

1. Use the document() function with a date/time server that returns its info in XHTML or XML

2. Use an extension function (i.e., Saxon provides an interface to .NET or Java)

3. Use a global parameter and set it from the calling app

4. Use a system-property and make sure it is set from the calling up right before the transformation starts

5. Some processors may offer you an extension instruction or function that gives the current date/time out of the box


HTH,


Cheers,
-- Abel Braaksma
  http://www.nuntia.nl

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.