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

RE: [xsl] Error -- Could not find function: adjust-time-to-timezone


Subject: RE: [xsl] Error -- Could not find function: adjust-time-to-timezone
From: <Girish.Chelankara@xxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Jan 2007 17:56:00 +0530

Hi Abel,

Thanks for the corrections. May be there is some version problem because
of which it still gives the strange error.

Could you please let me know whether there is any method by which I can
get the Local Country Time out of the GMT time.

Thanks & Regards,
Girish C

-----Original Message-----
From: Abel Braaksma [mailto:abel.online@xxxxxxxxx]
Sent: Thursday, January 25, 2007 2:46 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Error -- Could not find function:
adjust-time-to-timezone

The error code is strange, however your code cannot possibly run.

   1. The xpath-datatypes namespace is defunct
   2. the xsl:variable does not have an attribute 'value'
   3. if 'value' should be 'select', then the content of that attribute
is illegal (must be quoted)
   4. if you try xs:time('20:30') it will fail, the time is "too short"

Here's a rewrite of your code that works with Saxon 8.8 (just tested
it):

<xsl:variable name="MY_TIME" select=" '20:30:10' "/>
<xsl:variable name="DURATION" select=" '-PT6H' "/>
<xsl:value-of
       select="adjust-time-to-timezone(xs:time($MY_TIME),
                   xs:dayTimeDuration($DURATION))"/>

the namespace 'xs' must be bound to "http://www.w3.org/2001/XMLSchema"

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


Girish.Chelankara@xxxxxxxxxxxxxxxxxx wrote:
> Hi,
>
> I am using "Saxon 8" and trying to call the function
> "adjust-time-to-timezone" as per the following code. It gives me the
> error "could not find function".
> I tried changing the version of Saxon and also by changing various
> attributes and values of xsl:stylesheet tag. Still it gives the same
> error.
> Please help.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:fn="http://www.w3.org/TR/xpath-functions"
> xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
>
>       <xsl:output method="text"/>
>       <xsl:template match="myxml/elem1">
>             <xsl:variable name="MY_TIME" value="20:30"/>
>             <xsl:variable name="DURATION" value="-PT6H"/>
>             <xsl:value-of
>
select="adjust-time-to-timezone(xs:time($MY_TIME),xdt:dayTimeDuration($D
> URATION))"/>
>       </xsl:template>
>
> </xsl:stylesheet>
>
> Thanks & Regards,
> Girish C


Current Thread