xsl-list
[Top] [All Lists]

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

2006-10-16 05:13:49
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

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>