[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Adding a xs:yearMonthDuration to a xs:dateTime to obtain a new xs:dateTime variable


Subject: Re: [xsl] Adding a xs:yearMonthDuration to a xs:dateTime to obtain a new xs:dateTime variable
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 16 Oct 2006 14:13:06 +0200

Allan Kamau wrote:

I am using saxon8.
If I use <xsl:variable name="tmp3"
select='$currentGridDate+xs:yearMonthDuration("P1M")'/>
or
<xsl:variable name="tmp3" as="xs:dateTime"
select='$currentGridDate+xs:yearMonthDuration("P1M")'/>


The datetype of $tmp3 will be xs:dayTimeDuration in
both cases.

I think that you should explicitly convert the first argument to xs:dateTime, or it must be explicitly declared. This works, and returns "2004-12-15T15:12:10" (which is 1 day and 1 hour later than the supplied date time):


<xsl:value-of select="xs:dateTime('2004-12-14T14:12:10') + xs:dayTimeDuration('P1DT1H')"></xsl:value-of>

I tried it with Saxon 8.8, newest release.

Hth,

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


Current Thread