XSLTを使用したdatetimeからのタイムスタンプ

人生では、データとプレゼンテーションを区別することが大好きであるにもかかわらず、ロジックの一部をXSLTテンプレートに転送することが必要になる日が来るのです。



私の場合、地平線上で犯罪者は予見されませんでした。階層XMLログで2つのイベント間の時間を計算する必要がありました。 日付と時刻は、 RFC 3339と部分的に互換性のある形式で保存されていました。



この互換性は、日付yyyy-MM-dd



および時刻hh:mm:ss.SS



の正しい表記によって保証されましたが、標準から次の逸脱が発生しました。

  1. 日付と時刻は、文字T



    ではなくスペースで区切られます。
  2. ミリ秒を表す桁数は、「niode」から「many、many」までさまざまです。
  3. タイムゾーンはまったく示されていません。
最初はexslt.orgで既製のソリューションを使用したかった-date date:difference



、それを放棄しなければなりませんでした。 実際、ミリ秒の精度で差を取得する必要があり、このアルゴリズムは有効なxsd:duration



(ISO 8601)を返しました。これにはミリ秒は含まれていません。 さらに、他の人の出力を解析することは、正式ではありますが、あまり感謝されていません。 したがって、exsltを少し掘り下げて、私がパーサーを自分で書くことにしました。



exsltと同じ名前空間を持つテンプレートを拡張して収集することが決定されたため、コンテナタイプ< xsl:stylesheet/ >



適切です。

  1. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



  2. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



  3. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



  4. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



  5. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



  6. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



  7. <? xml version ="1.0" encoding ="utf-8" ? > < xsl:stylesheet version ="1.0" xmlns:date ="date" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes ="date"> <!-- Source code goes here --> </ xsl:stylesheet >



extension-element-prefixes



宣言された拡張ネームスペースはテンプレートで使用され、XMLネームスペースdate:*



は次のコンテナを宣言するために1回だけ使用されます。

  1. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  2. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  3. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  4. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  5. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  6. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  7. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  8. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  9. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  10. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  11. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  12. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  13. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



  14. < date:month > < january > 31 </ january > < february > 28 </ february > < march > 31 </ march > < april > 30 </ april > < may > 31 </ may > < june > 30 </ june > < july > 31 </ july > < august > 31 </ august > < september > 30 </ september > < october > 31 </ october > < november > 30 </ november > < december > 31 </ december > </ date:month >



番号または月名で日数を取得するために、変数を導入します:



< xsl:variable name ="date:month"

select ="document('')//date:month"/>







sum($date:month/*[$i>=position()])+($i>2)



-先月の$i



うるう年の総日数のようなXPathを書くことができます。



日付/時刻文字列を解析するプロセスでは、 NaN



との一致を数値で確認する必要があり、正の比較の場合は0



に置き換えます。 これにより多くの< xsl:if />



が生成され、コードが乱雑になります。 だから私はこのようなtranslate



を使い始めました:



translate($expression,'NaN',0)







しかし、そのようなコードもきちんと表示されません。 いくつかの審議の後、自動フォーマットの小数でオプションが選択されました。



< xsl:decimal-format NaN ="0"/>







興味深いことに、Opera 10.53では、 format-number



関数は3つの引数を処理できず、不明なエラーを生成します。これにより、次のような名前付きdecimal-format



数値形式を使用できなくなります。

  1. < xsl:decimal-format name ="date:NaN" NaN ="0">



  2. < xsl:decimal-format name ="date:NaN" NaN ="0">



つまり テンプレートをドロップするXPathは次のとおりformat-number($expression,0,'date:NaN')



format-number($expression,0,'date:NaN')







日時からタイムスタンプ


次のリストは、日時をミリ秒のタイムスタンプに変換するためのテンプレートです。

  1. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  2. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  3. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  4. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  5. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  6. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  7. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  8. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  9. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  10. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  11. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  12. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  13. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  14. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  15. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  16. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  17. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  18. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  19. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  20. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  21. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  22. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  23. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  24. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  25. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  26. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  27. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  28. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  29. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  30. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  31. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  32. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  33. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  34. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  35. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  36. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  37. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  38. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  39. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  40. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  41. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  42. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  43. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  44. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  45. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  46. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  47. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  48. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  49. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  50. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  51. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  52. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  53. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  54. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  55. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  56. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  57. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



  58. < xsl:template name ="date:timestamp" > < xsl:param name ="date-time" /> < xsl:variable name ="compact" select =" normalize-space( translate($date-time,'TZ ',''))" /> < xsl:variable name ="year" select =" translate( substring($compact,1, 4+(starts-with($compact,'+') or starts-with($compact,'-'))), '+','')"/> < xsl:variable name ="date" select ="substring-after($compact,$year)" /> < xsl:variable name ="time" select ="substring($date,7)" /> < xsl:variable name ="month" select ="format-number(substring($date,2,2)-1,0)" /> < xsl:variable name ="utc-offset" > < xsl:variable name ="raw" select =" concat( substring-after($time,'+'), substring-after($time,'-'))"/> < xsl:variable select =" format-number( (contains($time,'-')-.5) *2*(substring($raw,1,2)*60 +substring($raw,4,2)),0)"/> </ xsl:variable > < xsl:variable select =" format-number( 1000*( 24*3600*( $year*365-719527 +floor($year div 4) -floor($year div 100) +floor($year div 400) +sum($date:month/*[$month>=position()]) +format-number(substring($date,5,2)-1,0) -(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0))) +format-number( concat(0,substring($time,7, (substring($time,6,1)=':')*2)) +substring($time,1,2)*3600 +substring($time,4,2)*60,0) +$utc-offset*60) +format-number( round( (substring($time,9,1)='.') *1000*substring-before( translate( concat('0.',substring-after($time,'.'),'_'), '+-','__'),'_')),0),0)"/> </ xsl:template >



計算の詳細については説明しませんが、その機能についてのみ説明します。



@paramは、フォーマットされた文字列が渡される単一のパラメーター$date-time



受け入れます。 行内のスペースの存在と数は重要ではありません-それらはすべてブロードキャストされます。 日付区切り文字には、スペースを除く任意の1文字を使用できます。



パラメーターの一般化されたパターンは次のとおりです。



RFC 3339日時パターン



yyyy





MM





dd





T



日付識別子

hh



見る

mm





S



秒の小数部。任意の桁数を含むことができます(1桁ではない場合も含む)

Z



-UTCタイムゾーン識別子

[]



-括弧の内容は存在する場合と存在しない場合があります。

()



-括弧の内容が存在する必要があります。

|



-または



@output Unix時代1970-01-01T00の始まりからのミリ秒数を返します:00:00Z。



日時のタイムスタンプ


このリストは、数値からRFC形式の文字列への逆変換です。

  1. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  2. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  3. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  4. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  5. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  6. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  7. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  8. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  9. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  10. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  11. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  12. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  13. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  14. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  15. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  16. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  17. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  18. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  19. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  20. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  21. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  22. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  23. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  24. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  25. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  26. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  27. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  28. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  29. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  30. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  31. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  32. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  33. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  34. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  35. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  36. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  37. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  38. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  39. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  40. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  41. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  42. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  43. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  44. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  45. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  46. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  47. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  48. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  49. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  50. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  51. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



  52. < xsl:template name ="date:date-time" > < xsl:param name ="timestamp" /> < xsl:if test ="not(format-number($timestamp,0)='NaN')" > < xsl:variable name ="days" select ="$timestamp div (24*3600000)" /> < xsl:variable name ="time" select =" $timestamp div 1000 -floor($days)*24*3600" /> < xsl:variable name ="year" select =" 1970+floor( format-number($days div 365.24,'0.#'))" /> < xsl:variable name ="year-offset" select =" 719528-$year*365 -floor($year div 4) +floor($year div 100) -floor($year div 400) +floor($days)"/> < xsl:variable name ="month" select =" count($date:month /*[$year-offset>=sum(preceding-sibling::*)][last()] /preceding-sibling::*)" /> < xsl:variable name ="hours" select ="floor($time div 3600)" /> < xsl:variable name ="min" select ="floor($time div 60-$hours*60)" /> < xsl:variable name ="sec" select ="floor($time -$hours*3600-$min*60)" /> < xsl:variable select =" concat( format-number($year,'0000'),'-', format-number($month+1,'00'),'-', format-number( $year-offset -sum($date:month/*[$month>=position()]) +(2>$month and (($year mod 4=0 and $year mod 100!=0) or $year mod 400=0)), '00'),'T', format-number($hours,'00'),':', format-number($min,'00'),':', format-number($sec,'00'),'.', format-number( 1000*($time -$hours*3600 -$min*60-$sec), '000'),'Z')" /> </ xsl:if > </ xsl:template >



@param前のテンプレートと同様に、単一のパラメーターを取ります。 $timestamp



-1970-01-01T00:00:00Zから経過したミリ秒数。 日付が1970年の初めよりも早い場合、タイムスタンプは負でなければなりません。



@output文字列[ - | + ] yyyy - MM - dd T hh : mm : ss . SSS Z



[ - | + ] yyyy - MM - dd T hh : mm : ss . SSS Z







マイナスの年とプラスの年の両方でパターンをチェックしました-結果は真実に似ています。 テストとソースは、 rapidshareで取得できます。 急ぎが嫌いな場合は、別の場所に投稿します。



All Articles