1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!-- $Id: marc21.xsl,v 1.22 2007-10-04 12:01:15 adam Exp $ -->
5 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
6 xmlns:
pz=
"http://www.indexdata.com/pazpar2/1.0"
7 xmlns:
marc=
"http://www.loc.gov/MARC21/slim">
10 <xsl:output indent=
"yes" method=
"xml" version=
"1.0" encoding=
"UTF-8"/>
12 <!-- Extract metadata from MARC21/USMARC
13 http://www.loc.gov/marc/bibliographic/ecbdhome.html
15 <xsl:include href=
"pz2-ourl-marc21.xsl" />
17 <xsl:template match=
"/marc:record">
18 <xsl:variable name=
"title_medium" select=
"marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
19 <xsl:variable name=
"journal_title" select=
"marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
20 <xsl:variable name=
"electronic_location_url" select=
"marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
21 <xsl:variable name=
"fulltext_a" select=
"marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
22 <xsl:variable name=
"fulltext_b" select=
"marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
23 <xsl:variable name=
"medium">
25 <xsl:when test=
"$title_medium">
26 <xsl:value-of select=
"substring-after(substring-before($title_medium,']'),'[')"/>
28 <xsl:when test=
"$fulltext_a">
29 <xsl:text>electronic resource
</xsl:text>
31 <xsl:when test=
"$fulltext_b">
32 <xsl:text>electronic resource
</xsl:text>
34 <xsl:when test=
"$electronic_location_url">
35 <xsl:text>electronic resource
</xsl:text>
37 <xsl:when test=
"$journal_title">
38 <xsl:text>article
</xsl:text>
41 <xsl:text>book
</xsl:text>
46 <xsl:variable name=
"mergekey">
47 <xsl:text>title
</xsl:text>
49 <xsl:when test=
"marc:datafield[@tag='240']">
50 <xsl:value-of select=
"marc:datafield[@tag='240']/marc:subfield[@code='a']"/>
53 <xsl:value-of select=
"marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
56 <xsl:text> author
</xsl:text>
57 <xsl:value-of select=
"marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
59 <xsl:text> medium </xsl:text>
60 <xsl:value-of select="$medium"/>
65 <xsl:attribute name=
"mergekey">
66 <xsl:value-of select=
"$mergekey"/>
70 <xsl:for-each select=
"marc:controlfield[@tag='001']">
71 <pz:metadata type=
"id">
72 <xsl:value-of select=
"."/>
76 <xsl:for-each select=
"marc:datafield[@tag='010']">
77 <pz:metadata type=
"lccn">
78 <xsl:value-of select=
"marc:subfield[@code='a']"/>
82 <xsl:for-each select=
"marc:datafield[@tag='999']">
83 <pz:metadata type=
"kohaid">
84 <xsl:value-of select=
"marc:subfield[@code='c']"/>
89 <xsl:for-each select=
"marc:datafield[@tag='020']">
90 <pz:metadata type=
"isbn">
91 <xsl:value-of select=
"marc:subfield[@code='a']"/>
95 <xsl:for-each select=
"marc:datafield[@tag='022']">
96 <pz:metadata type=
"issn">
97 <xsl:value-of select=
"marc:subfield[@code='a']"/>
101 <xsl:for-each select=
"marc:datafield[@tag='027']">
102 <pz:metadata type=
"tech-rep-nr">
103 <xsl:value-of select=
"marc:subfield[@code='a']"/>
107 <xsl:for-each select=
"marc:datafield[@tag='100']">
108 <pz:metadata type=
"author">
109 <xsl:value-of select=
"marc:subfield[@code='a']"/>
111 <pz:metadata type=
"author-title">
112 <xsl:value-of select=
"marc:subfield[@code='c']"/>
114 <pz:metadata type=
"author-date">
115 <xsl:value-of select=
"marc:subfield[@code='d']"/>
119 <xsl:for-each select=
"marc:datafield[@tag='110']">
120 <pz:metadata type=
"corporate-name">
121 <xsl:value-of select=
"marc:subfield[@code='a']"/>
123 <pz:metadata type=
"corporate-location">
124 <xsl:value-of select=
"marc:subfield[@code='c']"/>
126 <pz:metadata type=
"corporate-date">
127 <xsl:value-of select=
"marc:subfield[@code='d']"/>
131 <xsl:for-each select=
"marc:datafield[@tag='111']">
132 <pz:metadata type=
"meeting-name">
133 <xsl:value-of select=
"marc:subfield[@code='a']"/>
135 <pz:metadata type=
"meeting-location">
136 <xsl:value-of select=
"marc:subfield[@code='c']"/>
138 <pz:metadata type=
"meeting-date">
139 <xsl:value-of select=
"marc:subfield[@code='d']"/>
143 <xsl:for-each select=
"marc:datafield[@tag='260']">
144 <pz:metadata type=
"date">
145 <xsl:value-of select=
"marc:subfield[@code='c']"/>
149 <xsl:for-each select=
"marc:datafield[@tag='245']">
150 <pz:metadata type=
"title">
151 <xsl:value-of select=
"marc:subfield[@code='a']"/>
153 <pz:metadata type=
"title-remainder">
154 <xsl:value-of select=
"marc:subfield[@code='b']"/>
156 <pz:metadata type=
"title-responsibility">
157 <xsl:value-of select=
"marc:subfield[@code='c']"/>
159 <pz:metadata type=
"title-dates">
160 <xsl:value-of select=
"marc:subfield[@code='f']"/>
162 <pz:metadata type=
"title-medium">
163 <xsl:value-of select=
"marc:subfield[@code='h']"/>
165 <pz:metadata type=
"title-number-section">
166 <xsl:value-of select=
"marc:subfield[@code='n']"/>
170 <xsl:for-each select=
"marc:datafield[@tag='250']">
171 <pz:metadata type=
"edition">
172 <xsl:value-of select=
"marc:subfield[@code='a']"/>
176 <xsl:for-each select=
"marc:datafield[@tag='260']">
177 <pz:metadata type=
"publication-place">
178 <xsl:value-of select=
"marc:subfield[@code='a']"/>
180 <pz:metadata type=
"publication-name">
181 <xsl:value-of select=
"marc:subfield[@code='b']"/>
183 <pz:metadata type=
"publication-date">
184 <xsl:value-of select=
"marc:subfield[@code='c']"/>
188 <xsl:for-each select=
"marc:datafield[@tag='300']">
189 <pz:metadata type=
"physical-extent">
190 <xsl:value-of select=
"marc:subfield[@code='a']"/>
192 <pz:metadata type=
"physical-format">
193 <xsl:value-of select=
"marc:subfield[@code='b']"/>
195 <pz:metadata type=
"physical-dimensions">
196 <xsl:value-of select=
"marc:subfield[@code='c']"/>
198 <pz:metadata type=
"physical-accomp">
199 <xsl:value-of select=
"marc:subfield[@code='e']"/>
201 <pz:metadata type=
"physical-unittype">
202 <xsl:value-of select=
"marc:subfield[@code='f']"/>
204 <pz:metadata type=
"physical-unitsize">
205 <xsl:value-of select=
"marc:subfield[@code='g']"/>
207 <pz:metadata type=
"physical-specified">
208 <xsl:value-of select=
"marc:subfield[@code='3']"/>
212 <xsl:for-each select=
"marc:datafield[@tag='440']">
213 <pz:metadata type=
"series-title">
214 <xsl:value-of select=
"marc:subfield[@code='a']"/>
218 <xsl:for-each select=
"marc:datafield[@tag >= 500 and @tag <= 599]
219 [@tag != '506' and @tag != '530' and
220 @tag != '540' and @tag != '546'
222 <pz:metadata type=
"description">
223 <xsl:value-of select=
"*/text()"/>
227 <xsl:for-each select=
"marc:datafield[@tag='650' or @tag='653']">
228 <pz:metadata type=
"subject">
229 <xsl:value-of select=
"marc:subfield[@code='a']"/>
231 <pz:metadata type=
"subject-long">
232 <xsl:for-each select=
"marc:subfield">
233 <xsl:if test=
"position() > 1">
234 <xsl:text>,
</xsl:text>
236 <xsl:value-of select=
"."/>
241 <xsl:for-each select=
"marc:datafield[@tag='856']">
242 <pz:metadata type=
"electronic-url">
243 <xsl:value-of select=
"marc:subfield[@code='u']"/>
245 <pz:metadata type=
"electronic-text">
246 <xsl:value-of select=
"marc:subfield[@code='y']"/>
248 <pz:metadata type=
"electronic-note">
249 <xsl:value-of select=
"marc:subfield[@code='z']"/>
253 <xsl:for-each select=
"marc:datafield[@tag='773']">
254 <pz:metadata type=
"citation">
255 <xsl:for-each select=
"*">
256 <xsl:value-of select=
"normalize-space(.)"/>
257 <xsl:text> </xsl:text>
262 <pz:metadata type=
"medium">
263 <xsl:value-of select=
"$medium"/>
266 <xsl:if test=
"$fulltext_a">
267 <pz:metadata type=
"fulltext">
268 <xsl:value-of select=
"$fulltext_a"/>
272 <xsl:if test=
"$fulltext_b">
273 <pz:metadata type=
"fulltext">
274 <xsl:value-of select=
"$fulltext_b"/>
278 <xsl:if test=
"$open_url_resolver">
279 <pz:metadata type=
"open-url">
280 <xsl:call-template name=
"insert-md-openurl" />