1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
5 xmlns:zs="http://www.loc.gov/zing/srw/"
6 xmlns:tmarc="http://www.indexdata.com/turbomarc">
8 <xsl:output indent="yes" method="xml" version="1.0"
10 <xsl:param name="medium"/>
12 <!-- Extract metadata from MARC21/USMARC from streamlined marcxml format
13 http://www.loc.gov/marc/bibliographic/ecbdhome.html -->
14 <xsl:template name="record-hook" />
17 <xsl:template match="/">
18 <xsl:apply-templates />
21 <xsl:template match="zs:searchRetrieveResponse">
22 <xsl:apply-templates />
25 <xsl:template match="zs:records">
27 <xsl:apply-templates />
31 <xsl:template match="zs:record">
32 <xsl:apply-templates />
35 <xsl:template match="zs:recordData">
36 <xsl:apply-templates />
39 <xsl:template match="doc">
41 <xsl:apply-templates />
45 <xsl:template match="art">
46 <xsl:variable name="journal_title" select="journal/title" />
47 <xsl:variable name="journal_issn" select="journal/issn" />
48 <xsl:variable name="date" select="journal/year" />
49 <xsl:variable name="month" select="journal/month" />
50 <xsl:variable name="description" select="abstract/abstract" />
52 <xsl:variable name="has_fulltext" select="article/fulltext"/>
53 <xsl:variable name="has_title" select="article/title"/>
55 <xsl:variable name="vmedium">
57 <xsl:when test="$has_title and $has_fulltext">
58 <xsl:text>e-article</xsl:text>
60 <xsl:when test="$has_title and not($has_fulltext)">
61 <xsl:text>article</xsl:text>
64 <xsl:text>other</xsl:text>
71 <xsl:for-each select="localInfo/systemno">
72 <pz:metadata type="id">
73 <xsl:value-of select="."/>
77 <xsl:for-each select="author/name">
78 <pz:metadata type="author">
79 <xsl:value-of select="." />
83 <xsl:for-each select="article/title">
84 <pz:metadata type="title">
85 <xsl:value-of select="." />
89 <xsl:for-each select="journal/issn">
90 <pz:metadata type="issn">
91 <xsl:value-of select="." />
95 <xsl:for-each select="journal/title">
96 <pz:metadata type="journal-title">
97 <xsl:value-of select="." />
101 <xsl:for-each select="journal/vol">
102 <pz:metadata type="journal-number">
103 <xsl:value-of select="." />
107 <xsl:for-each select="journal/issue">
108 <pz:metadata type="issue-number">
109 <xsl:value-of select="." />
113 <xsl:for-each select="journal">
114 <pz:metadata type="journal-subpart">
116 <xsl:text>Vol. </xsl:text><xsl:value-of select="vol" /><xsl:text>,</xsl:text>
118 <xsl:if test="issue">
120 <xsl:text> no. </xsl:text>
122 <xsl:if test="not(vol)">
123 <xsl:text>No. </xsl:text>
125 <xsl:value-of select="issue" />
127 <xsl:text> (</xsl:text>
128 <xsl:if test="month">
130 <xsl:when test="$month='01'">
131 <xsl:text>Jan. </xsl:text>
133 <xsl:when test="$month='02'">
134 <xsl:text>Feb. </xsl:text>
136 <xsl:when test="$month='03'">
137 <xsl:text>Mar. </xsl:text>
139 <xsl:when test="$month='04'">
140 <xsl:text>Apr. </xsl:text>
142 <xsl:when test="$month='05'">
143 <xsl:text>May </xsl:text>
145 <xsl:when test="$month='06'">
146 <xsl:text>June </xsl:text>
148 <xsl:when test="$month='07'">
149 <xsl:text>July </xsl:text>
151 <xsl:when test="$month='08'">
152 <xsl:text>Aug. </xsl:text>
154 <xsl:when test="$month='09'">
155 <xsl:text>Sept. </xsl:text>
157 <xsl:when test="$month='10'">
158 <xsl:text>Oct. </xsl:text>
160 <xsl:when test="$month='11'">
161 <xsl:text>Nov. </xsl:text>
163 <xsl:when test="$month='12'">
164 <xsl:text>Dec. </xsl:text>
167 <xsl:value-of select="$month"/><xsl:text> </xsl:text>
171 <xsl:value-of select="year" /><xsl:text>)</xsl:text>
173 <xsl:text>, p. </xsl:text><xsl:value-of select="page" />
178 <pz:metadata type="description">
179 <xsl:value-of select="$description" />
182 <xsl:for-each select="ctrlT/term">
183 <pz:metadata type="subject">
184 <xsl:value-of select="." />
188 <xsl:for-each select="article/fulltext">
189 <pz:metadata type="fulltext">
190 <xsl:value-of select="." />
194 <pz:metadata type="medium">
195 <xsl:value-of select="$vmedium" />
197 <xsl:if test="string-length($electronic) and $vmedium != 'electronic'">
198 <xsl:text> (electronic)</xsl:text>
204 <!-- passthrough id data -->
205 <xsl:for-each select="pz:metadata">
206 <xsl:copy-of select="." />
209 <!-- other stylesheets importing this might want to define this -->
210 <xsl:call-template name="record-hook" />
216 <xsl:template match="text()" />