Adds 'has-fulltext' flag
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 27 Oct 2010 01:49:42 +0000 (03:49 +0200)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Wed, 27 Oct 2010 01:49:42 +0000 (03:49 +0200)
etc/marc21.xsl

index 8ef68ce..bb60a32 100644 (file)
       </xsl:choose>
     </xsl:variable>
 
+    <xsl:variable name="has_fulltext">
+      <xsl:choose>
+        <xsl:when test="marc:datafield[@tag='856']/marc:subfield[@code='q']">
+          <xsl:text>yes</xsl:text>
+        </xsl:when>
+        <xsl:when test="marc:datafield[@tag='856']/marc:subfield[@code='i']='TEXT*'">
+          <xsl:text>yes</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>no</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+
     <pz:record>
-      
       <xsl:for-each select="marc:controlfield[@tag='001']">
         <pz:metadata type="id">
           <xsl:value-of select="."/>
        </pz:metadata>
       </xsl:for-each>
 
+      <pz:metadata type="has-fulltext">
+        <xsl:value-of select="$has_fulltext"/> 
+      </pz:metadata>
+
       <xsl:for-each select="marc:datafield[@tag='773']">
        <pz:metadata type="citation">
              <xsl:for-each select="*">