Explorar el Código

fixed date parse

a.binder hace 8 años
padre
commit
db9d181911
Se han modificado 1 ficheros con 12 adiciones y 8 borrados
  1. 12 8
      SE/schema/default_db_xml_cache.public/default_db/dateTime.xsl

+ 12 - 8
SE/schema/default_db_xml_cache.public/default_db/dateTime.xsl

@@ -7,9 +7,10 @@
     version="2.0">
     
     
-    <xsl:variable name="data" select="'2017-10-10T00:00:00'"/>
+    <xsl:variable name="debug.dateTime.data" select="'2017-10-10T00:00:00'"/>
    
-    <xsl:variable name="data2" select="'01.02.2017'"/>
+    <xsl:variable name="debug.dateTime.data2" select="'01.02.2017'"/>
+    <xsl:variable name="debug.dateTime.data3" select="'1.12.2008'"/>
     
     
     <xsl:function name="system_cache__dita:year">
@@ -18,16 +19,16 @@
             
             <xsl:when test="string($date) castable as xs:dateTime">
                 <xsl:message>#20 passed as dateTime</xsl:message>
-                <xsl:value-of select="format-date(xs:date(xs:dateTime($data)),'[Y]')"/>
+                <xsl:value-of select="format-date(xs:date(xs:dateTime($date)),'[Y]')"/>
             </xsl:when>
             <xsl:when test="string($date) castable as xs:date">
                 <xsl:message>#20 passed as date</xsl:message>
                 <xsl:value-of select="format-date(xs:date($date),'[Y]')"/>
             </xsl:when>
-            <!--<xsl:when test="tokenize(string($date),'\.')[3]">
+            <xsl:when test="tokenize(string($date),'\.')[3]">
                 <xsl:message>#20 passed as tokenize</xsl:message>
                 <xsl:value-of select="tokenize($date,'\.')[3]"/>
-            </xsl:when>-->
+            </xsl:when>
             <xsl:otherwise>
                 <xsl:message terminate="yes">#28 Error in date format for value <xsl:value-of select="$date"/>! </xsl:message>
             </xsl:otherwise>
@@ -39,9 +40,12 @@
     
     
     
-    <xsl:template name="main">
-        <xsl:value-of select="$data"/>=<xsl:value-of select="system_cache__dita:year($data)"/><xsl:text>
+    <xsl:template name="debug.dateTime">
+        <xsl:value-of select="$debug.dateTime.data"/>=<xsl:value-of select="system_cache__dita:year($debug.dateTime.data)"/><xsl:text>
+</xsl:text>
+        <xsl:value-of select="$debug.dateTime.data2"/>=<xsl:value-of select="system_cache__dita:year($debug.dateTime.data2)"/><xsl:text>
+</xsl:text>
+        <xsl:value-of select="$debug.dateTime.data3"/>=<xsl:value-of select="system_cache__dita:year($debug.dateTime.data3)"/><xsl:text>
 </xsl:text>
-        <xsl:value-of select="$data2"/>=<xsl:value-of select="system_cache__dita:year($data2)"/>
     </xsl:template>
 </xsl:stylesheet>