Adds OCLC number as specified by LoT
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Mon, 6 Dec 2010 18:19:44 +0000 (19:19 +0100)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Mon, 6 Dec 2010 18:19:44 +0000 (19:19 +0100)
etc/tmarc.xsl

index 8784bc1..3a1e7ff 100644 (file)
       </xsl:choose>
     </xsl:variable>
 
+    <xsl:variable name="oclc_number">
+      <xsl:choose>
+        <xsl:when test='contains(tmarc:c001,"ocn") or
+                        contains(tmarc:c001,"ocm") or
+                        contains(tmarc:c001,"OCoLC") '>
+         <xsl:value-of select="tmarc:c001"/>
+        </xsl:when>
+        <xsl:when test='contains(tmarc:d035/tmarc:sa,"ocn") or
+                        contains(tmarc:d035/tmarc:sa,"ocm") or
+                        contains(tmarc:d035/tmarc:sa,"OCoLC") '>
+         <xsl:value-of select="tmarc:d035/tmarc:sa"/>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
     <pz:record>
 <!--
       <xsl:attribute name="mergekey">
         </pz:metadata>
       </xsl:for-each>
 
+      <pz:metadata type="oclc-number">
+        <xsl:value-of select="$oclc_number" />
+      </pz:metadata>
+
       <xsl:for-each select="tmarc:d010">
         <pz:metadata type="lccn">
           <xsl:value-of select="tmarc:sa" />