<xsl:output indent="yes" method="xml" version="1.0"
encoding="UTF-8" />
+ <xsl:param name="medium"/>
<!-- Extract metadata from MARC21/USMARC from streamlined marcxml format
http://www.loc.gov/marc/bibliographic/ecbdhome.html -->
<xsl:apply-templates />
</xsl:template>
+ <xsl:template match="tmarc:collection">
+ <collection>
+ <xsl:apply-templates />
+ </collection>
+ </xsl:template>
+
<xsl:template match="tmarc:r">
<xsl:variable name="title_medium" select="tmarc:d245/tmarc:sh" />
<xsl:variable name="journal_title" select="tmarc:d773/tmarc:st" />
</xsl:choose>
</xsl:variable>
- <xsl:variable name="medium">
+ <xsl:variable name="vmedium">
<xsl:choose>
- <xsl:when test="($typeofrec='a' or $typeofrec='t') and $biblevel='m'">book</xsl:when>
+ <xsl:when test="string-length($medium)"><xsl:value-of select="$medium" /></xsl:when>
+ <xsl:when test="($typeofrec='a' or $typeofrec='t') and $biblevel='m'">book</xsl:when>
<xsl:when test="$typeofrec='j' or $typeofrec='i'">
<xsl:text>recording</xsl:text>
<xsl:choose>
</xsl:choose>
</xsl:variable>
+ <xsl:variable name="has_fulltext">
+ <xsl:choose>
+ <xsl:when test="tmarc:d856/tmarc:sq">
+ <xsl:text>yes</xsl:text>
+ </xsl:when>
+ <xsl:when test="tmarc:d856/tmarc:si='TEXT*'">
+ <xsl:text>yes</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>no</xsl:text>
+ </xsl:otherwise>
+ </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>
+
+ <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>
+ <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" />
<xsl:for-each select="tmarc:d260">
<pz:metadata type="date">
- <xsl:value-of select="tmarc:sc" />
+ <xsl:value-of select="translate(tmarc:sc, 'cp[].', '')" />
</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" />
</pz:metadata>
</xsl:for-each>
+ <xsl:for-each select="tmarc:d911">
+ <pz:metadata type="description">
+ <xsl:for-each select="node()">
+ <xsl:value-of select="text()" />
+ </xsl:for-each>
+ </pz:metadata>
+ </xsl:for-each>
+
<xsl:for-each select="tmarc:d600">
<pz:metadata type="subject">
<xsl:value-of select="tmarc:sa" />
<xsl:value-of select="tmarc:su" />
</pz:metadata>
<pz:metadata type="electronic-text">
- <xsl:if test="tmarc:sy">
- <xsl:value-of select="tmarc:sy/text()" />
- </xsl:if>
- <xsl:if test="tmarc:s3">
- <xsl:value-of select="tmarc:s3/text()" />
- </xsl:if>
+ <xsl:choose>
+ <xsl:when test="tmarc:sy">
+ <xsl:value-of select="tmarc:sy/text()" />
+ </xsl:when>
+ <xsl:when test="tmarc:s3">
+ <xsl:value-of select="tmarc:s3/text()" />
+ </xsl:when>
+ <xsl:otherwise>Get resource</xsl:otherwise>
+ </xsl:choose>
</pz:metadata>
<pz:metadata type="electronic-note">
<xsl:value-of select="tmarc:sz" />
<xsl:text> </xsl:text>
</xsl:for-each>
</pz:metadata>
+ <xsl:if test="tmarc:st">
+ <pz:metadata type="journal-title">
+ <xsl:value-of select="tmarc:st"/>
+ </pz:metadata>
+ </xsl:if>
+ <xsl:if test="tmarc:sg">
+ <pz:metadata type="journal-subpart">
+ <xsl:value-of select="tmarc:sg"/>
+ </pz:metadata>
+ </xsl:if>
+ <xsl:if test="tmarc:sp">
+ <pz:metadata type="journal-title-abbrev">
+ <xsl:value-of select="tmarc:sp"/>
+ </pz:metadata>
+ </xsl:if>
</xsl:for-each>
<xsl:for-each select="tmarc:d852">
</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="$medium" />
- <xsl:if test="string-length($electronic) and $medium != 'electronic'">
+ <xsl:value-of select="$vmedium" />
+ <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
<xsl:text> (electronic)</xsl:text>
</xsl:if>
</pz:metadata>
</pz:metadata>
</xsl:for-each>
+ <xsl:for-each select="tmarc:d900/tmarc:se">
+ <pz:metadata type="fulltext">
+ <xsl:value-of select="." />
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="tmarc:d900/tmarc:sf">
+ <pz:metadata type="fulltext">
+ <xsl:value-of select="." />
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="tmarc:d900/tmarc:si">
+ <pz:metadata type="fulltext">
+ <xsl:value-of select="." />
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="tmarc:d900/tmarc:sk">
+ <pz:metadata type="fulltext">
+ <xsl:value-of select="." />
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="tmarc:d900/tmarc:sq">
+ <pz:metadata type="fulltext">
+ <xsl:value-of select="." />
+ </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="." />
+ </pz:metadata>
+ </xsl:for-each>
+
+ <xsl:for-each select="tmarc:d900/tmarc:sy">
+ <pz:metadata type="fulltext">
+ <xsl:value-of select="." />
+ </pz:metadata>
+ </xsl:for-each>
+
+
<!-- <xsl:if test="$fulltext_b"> <pz:metadata type="fulltext"> <xsl:value-of
select="$fulltext_b"/> </pz:metadata> </xsl:if> -->
- <xsl:for-each select="tmarc:d907">
- <!-- or tmarc:d901"> -->
+ <pz:metadata type="has-fulltext">
+ <xsl:value-of select="$has_fulltext"/>
+ </pz:metadata>
+
+ <xsl:for-each select="tmarc:d907 or tmarc:d901">
<pz:metadata type="iii-id">
<xsl:value-of select="tmarc:sa" />
</pz:metadata>
</xsl:for-each>
<xsl:for-each select="tmarc:d926">
- <pz:metadata type="holding">
- <xsl:for-each select="tmarc:s">
- <xsl:if test="position() > 1">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:value-of select="." />
- </xsl:for-each>
- </pz:metadata>
+ <pz:metadata type="locallocation">
+ <xsl:choose><xsl:when test="tmarc:sa">
+ <xsl:value-of select="tmarc:sa"/>
+ </xsl:when><xsl:otherwise>
+ <xsl:text>PAZPAR2_NULL_VALUE</xsl:text>
+ </xsl:otherwise></xsl:choose>
+ </pz:metadata>
+ <pz:metadata type="callnumber">
+ <xsl:choose><xsl:when test="tmarc:sc">
+ <xsl:value-of select="tmarc:sc"/>
+ </xsl:when><xsl:otherwise>
+ <xsl:text>PAZPAR2_NULL_VALUE</xsl:text>
+ </xsl:otherwise></xsl:choose>
+ </pz:metadata>
+ <pz:metadata type="available">
+ <xsl:choose><xsl:when test="tmarc:se">
+ <xsl:value-of select="tmarc:se"/>
+ </xsl:when><xsl:otherwise>
+ <xsl:text>PAZPAR2_NULL_VALUE</xsl:text>
+ </xsl:otherwise></xsl:choose>
+ </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>
</xsl:for-each>
+ <xsl:for-each select="tmarc:d999">
+ <pz:metadata type="localid">
+ <xsl:choose>
+ <xsl:when test="tmarc:sa">
+ <xsl:value-of select="tmarc:sa"/>
+ </xsl:when>
+ <xsl:when test="tmarc:sc">
+ <xsl:value-of select="tmarc:sc"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="tmarc:sd"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </pz:metadata>
+ </xsl:for-each>
+
+
<!-- passthrough id data -->
<xsl:for-each select="pz:metadata">
<xsl:copy-of select="." />