W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2007

[Bug 4471] [F+O] Casting date/time timezone offset 0 values to string/untypedAtomic

From: <bugzilla@wiggum.w3.org>
Date: Tue, 01 May 2007 21:46:38 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1Hj0BC-0004s6-G6@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4471





------- Comment #2 from mike@saxonica.com  2007-05-01 21:46 -------
Proposed change: in 17.1.5 Casting to Date and Time Types, change

declare function eg:convertTZtoString($tz as xs:dayTimeDuration?) as xs:string
{
   if (empty($tz)) then ""
   else 
     let $tzh := fn:hours-from-dayTimeDuration($tz)
     let $tzm := fn:minutes-from-dayTimeDuration($tz)
     let $plusMinus := if ($tzh >= 0) then "+" else "-"
     let $tzhString := eg:convertTo2CharString(fn:abs($tzh))
     let $tzmString := eg:convertTo2CharString(fn:abs($tzm))
     return fn:concat($plusMinus, $tzhString, ":", $tzmString)
}

to

declare function eg:convertTZtoString($tz as xs:dayTimeDuration?) as xs:string
{
   if (empty($tz)) 
     then ""
   else if ($tz eq xs:dayTimeDuration('PT0H'))
     then "Z"
   else 
     let $tzh := fn:hours-from-dayTimeDuration($tz)
     let $tzm := fn:minutes-from-dayTimeDuration($tz)
     let $plusMinus := if ($tzh >= 0) then "+" else "-"
     let $tzhString := eg:convertTo2CharString(fn:abs($tzh))
     let $tzmString := eg:convertTo2CharString(fn:abs($tzm))
     return fn:concat($plusMinus, $tzhString, ":", $tzmString)
}
Received on Tuesday, 1 May 2007 21:46:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:18 UTC