xsl-list
[Top] [All Lists]

Re: [xsl] Adding duration to date

2007-07-24 09:55:37
On 7/24/07, tom tom <tomxsllist(_at_)hotmail(_dot_)com> 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--