XSLTGeneral 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
Consider using the date/time handling library available at www.exslt.org. Many of the functions described in this library are available as templates which you can simply include into your stylesheet.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
in the stylesheet header im calling:
xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex"
in the template i now have following parameters declared:
<xsl:param name="dobyear" select="substring((dob),1,4)" /> //this is getting the YYYY in my dob element
<xsl:param name="currentyear" select="ex:year()" /> //this gets current year
Suggest you explicitly output both values immediately before the calculation to make sure they are what you expect. If that doesn't help post an example we can test for ourselves.