[xquery-talk] compare dayTimeDuration ?

Sébastien Geindre sebastien.geindre at meteo.fr
Mon Feb 26 11:41:58 PST 2007


Sébastien Geindre a écrit :
> oXygen eclipse plugin do not valid my query because of :
> *Axis step child::element(false) cannot be used here: the context item 
> is undefined*
>
> Any ideas ?

the function was badwritten....sorry for the polution.... ;-)
           if ($r1 <= $v1) then
               if ($r2 <= $v1) then false()
               else true()
           else
               if ($r1 <= $v2) then true()
               else false()
>
>
> declare function local:isTimeOverlaped(    $foo as element(FOO),
>                                         $dateTimeRequest as xs:dateTime ,
>                                         $timeSpanRequest as xs:integer)
> as xs:boolean {
>    let $analysisTime as xs:dateTime := xs:dateTime($foo/gml:timePosition)
>    let $forecastTime as xs:dayTimeDuration := 
> xs:dayTimeDuration(concat("PT",$foo/forecastTime, "M"))
>    let $validityPeriod as xs:dayTimeDuration := 
> xs:dayTimeDuration(concat("PT",$foo/validityPeriod, "M"))
>
>    let $timeSpan as xs:dayTimeDuration := 
> xs:dayTimeDuration(concat("PT",$timeSpanRequest, "M"))
>
>    let $v1 as xs:dateTime := $analysisTime + $forecastTime
>    let $v2 as xs:dateTime := $v1 + $validityPeriod
>
>    let $r1 as xs:dateTime := $dateTimeRequest
>    let $r2 as xs:dateTime := $dateTimeRequest + $timeSpan
>    
>     return
>            if ($r1 <= $v1) then
>         *       if ($r2 <= $v1) then xs:boolean(false)*
>                else xs:boolean(true)
>            else
>                if ($r1 <= $v2) then xs:boolean(true)
>                else xs:boolean(false)
>                   
> };
>
>
>
> Geindre Sébastien a écrit :
>> hi all,
>>
>> is there any date comparison function in xquery ?
>>
>> thanks
>>
>> _______________________________________________
>> talk at x-query.com
>> http://x-query.com/mailman/listinfo/talk
>>
>
>
> -- 
> Sébastien Geindre
> DPREVI/AERO/DEV
> sebastien.geindre at meteo.fr
> 05 61 07 84 93
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk


-- 
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre at meteo.fr
05 61 07 84 93






More information about the talk mailing list