Re: [xsl] Adding duration to date

Subject: Re: [xsl] Adding duration to date
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 24 Jul 2007 17:55:17 +0100
On 7/24/07, tom tom <tomxsllist@xxxxxxxxxxx> wrote:
I wish to add a duration to a date, something along the lines of:

<xsl:value-of select="current-date() + xdt:yearMonthDuration('P6D')"/>.

I am using saxon 8.x, what is the correct way to do this, what should my
namespace declarations be to make this work and does the way I do this
depend on which version of Saxon / another processor I am using?

Use:


current-date() + xs:dayTimeDuration('P6D')

where "xs" is the standard prefix for the XML Schema namespace:
http://www.w3.org/2001/XMLSchema

cheers
andrew
--
http://andrewjwelch.com

Current Thread