Turbomarc needs number check for date 903 map PAZ-973
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 3 Oct 2014 10:37:41 +0000 (12:37 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 3 Oct 2014 10:37:41 +0000 (12:37 +0200)
etc/xsl/tmarc.xsl

index 95e9975..c98ecbd 100644 (file)
       </xsl:for-each>
 
       <xsl:for-each select="tmarc:d903">
-        <xsl:if test="tmarc:sa">
+        <xsl:if test="number(tmarc:sa) &gt; 0">
           <pz:metadata type="publication-date">
-            <xsl:value-of select="substring(tmarc:sa,1,4)"/>
+            <xsl:value-of select="number(tmarc:sa)"/>
           </pz:metadata>
           <pz:metadata type="date">
-            <xsl:value-of select="substring(tmarc:sa,1,4)"/>
+            <xsl:value-of select="number(tmarc:sa)"/>
           </pz:metadata>
         </xsl:if>
       </xsl:for-each>