Picks date from c008 when d260 is not available.
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 4 May 2011 20:06:51 +0000 (22:06 +0200)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 4 May 2011 20:06:51 +0000 (22:06 +0200)
Supports custom date format as found in some EBSCO and Gale targets.

etc/tmarc.xsl

index e6bec43..822e65d 100644 (file)
       </xsl:choose>
     </xsl:variable>
 
+    <xsl:variable name="date_008">
+      <xsl:choose>
+        <xsl:when test="contains('cestpudikmr', substring(tmarc:c008, 7, 1))">
+          <xsl:value-of select="substring(tmarc:c008, 8, 4)" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    <xsl:variable name="date_end_008">
+      <xsl:choose>
+        <xsl:when test="contains('dikmr', substring(tmarc:c008, 7, 1))">
+          <xsl:value-of select="substring(tmarc:c008, 12, 4)" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
     <pz:record>
 <!--
       <xsl:attribute name="mergekey">
         </pz:metadata>
       </xsl:for-each>
 
+      <xsl:if test="$date_008 and not(tmarc:d260)">
+        <pz:metadata type="date">
+          <xsl:choose>
+            <xsl:when test="$date_end_008">
+              <xsl:value-of select="concat($date_008,'-',$date_end_008)" />
+            </xsl:when>
+            <xsl:otherwise> 
+              <xsl:value-of select="$date_008" />
+            </xsl:otherwise>
+          </xsl:choose>
+        </pz:metadata>
+      </xsl:if>
+
+
       <xsl:for-each select="tmarc:d130">
         <pz:metadata type="title-uniform">
           <xsl:value-of select="tmarc:sa" />