Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2007, 08:17 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default To get current year

Hi,
I want to get the current year to be displayed.So is there any provision on XSLT for this?Any help would be appriciated.Thank you.

DPD
 
Old May 17th, 2007, 08:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT 2.0 allows

year-from-date(current-date())

In 1.0 you either have to use an extension function, or pass the current date in to your stylesheet as a parameter.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 21st, 2007, 01:06 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Michael,
Thanks for the info.But I would like to know about the extension function for getting the current year as I am using XSLT 1.0.Any knid of help would be apreciated.Thanks.

DPD
 
Old May 21st, 2007, 06:46 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Take a look at the date/time library at www.exslt.org

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Week of Year kiwibey ASP.NET 2.0 Professional 0 June 3rd, 2007 11:14 PM
Date= starting of the current fiscal year rmanu7382 Reporting Services 0 April 3rd, 2006 12:42 AM
Year Validation jputhra SQL Server 2000 1 December 10th, 2004 10:03 AM
Fiscal Year jemacc SQL Server 2000 4 October 7th, 2004 03:05 AM
A week of the a year cirudinezidane Javascript 2 July 1st, 2004 09:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.