Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
[pazpar2-moved-to-github.git] / etc / tmarc.xsl
index a62a31d..ad945f9 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" />
         </xsl:if>
       </xsl:for-each>
 
+      <xsl:for-each select="tmarc:d876">
+        <xsl:if test="tmarc:sf">
+          <pz:metadata type="loan-period">
+            <xsl:value-of select="tmarc:sf" />
+          </pz:metadata>
+        </xsl:if>
+      </xsl:for-each>
+
       <pz:metadata type="medium">
         <xsl:value-of select="$vmedium" />
        <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
         </pz:metadata>
       </xsl:for-each>
 
+      <xsl:for-each select="tmarc:d900/tmarc:ss">
+        <pz:metadata type="fulltext">
+          <xsl:value-of select="." />
+        </pz:metadata>
+      </xsl:for-each>
+
       <xsl:for-each select="tmarc:d900/tmarc:su">
         <pz:metadata type="fulltext">
           <xsl:value-of select="." />
         <xsl:value-of select="$has_fulltext"/>
       </pz:metadata>
 
-      <xsl:for-each select="tmarc:d907">
-        <!-- or tmarc:d901"> -->
+      <xsl:for-each select="tmarc:d901 ! tmarc:d907">
         <pz:metadata type="iii-id">
           <xsl:value-of select="tmarc:sa" />
         </pz:metadata>
        </pz:metadata>
       </xsl:for-each>
 
+      <!-- OhioLINK holdings -->
+      <xsl:for-each select="tmarc:d945">
+       <pz:metadata type="locallocation">
+          <xsl:choose>
+            <xsl:when test="tmarc:sa">
+              <xsl:value-of select="tmarc:sa"/>
+            </xsl:when>
+            <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+          </xsl:choose>
+       </pz:metadata>
+       <pz:metadata type="callnumber">
+          <xsl:choose>
+           <xsl:when test="tmarc:sb">
+              <xsl:value-of select="tmarc:sb"/>
+            </xsl:when>
+            <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+          </xsl:choose>
+       </pz:metadata>
+       <pz:metadata type="publicnote">
+          <xsl:choose>
+            <xsl:when test="tmarc:sc">
+              <xsl:value-of select="tmarc:sc"/>
+            </xsl:when>
+            <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+          </xsl:choose>
+       </pz:metadata>
+       <pz:metadata type="available">
+          <xsl:choose>
+            <xsl:when test="tmarc:ss = 'N'">Available</xsl:when>
+            <xsl:when test="tmarc:ss != 'N'">
+              <xsl:choose>
+               <xsl:when test="tmarc:sd">
+                  <xsl:value-of select="tmarc:sd"/>
+               </xsl:when>
+               <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:otherwise>PAZPAR2_NULL_VALUE</xsl:otherwise>
+          </xsl:choose>
+       </pz:metadata>      
+      </xsl:for-each>
+
       <xsl:for-each select="tmarc:d948">
         <pz:metadata type="holding">
           <xsl:for-each select="tmarc:s">