1 <?xml version="1.0" encoding="UTF-8"?>
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
6 xmlns:marc="http://www.loc.gov/MARC21/slim">
9 <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
11 <!-- Extract metadata from MARC21/USMARC
12 http://www.loc.gov/marc/bibliographic/ecbdhome.html
14 <xsl:include href="pz2-ourl-marc21.xsl" />
16 <xsl:template match="/marc:record">
17 <xsl:variable name="title_medium" select="marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
18 <xsl:variable name="journal_title" select="marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
19 <xsl:variable name="electronic_location_url" select="marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
20 <xsl:variable name="fulltext_a" select="marc:datafield[@tag='900']/marc:subfield[@code='a']"/>
21 <xsl:variable name="fulltext_b" select="marc:datafield[@tag='900']/marc:subfield[@code='b']"/>
22 <xsl:variable name="medium">
24 <xsl:when test="$title_medium">
25 <xsl:value-of select="substring-after(substring-before($title_medium,']'),'[')"/>
27 <xsl:when test="$fulltext_a">
28 <xsl:text>electronic resource</xsl:text>
30 <xsl:when test="$fulltext_b">
31 <xsl:text>electronic resource</xsl:text>
33 <xsl:when test="$electronic_location_url">
34 <xsl:text>electronic resource</xsl:text>
36 <xsl:when test="$journal_title">
37 <xsl:text>article</xsl:text>
40 <xsl:text>book</xsl:text>
46 <xsl:attribute name="mergekey">
47 <xsl:text>title </xsl:text>
48 <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
49 <xsl:text> author </xsl:text>
50 <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
51 <xsl:text> medium </xsl:text>
52 <xsl:value-of select="$medium"/>
56 <xsl:for-each select="marc:controlfield[@tag='001']">
57 <pz:metadata type="id">
58 <xsl:value-of select="."/>
62 <xsl:for-each select="marc:datafield[@tag='010']">
63 <pz:metadata type="lccn">
64 <xsl:value-of select="marc:subfield[@code='a']"/>
68 <xsl:for-each select="marc:datafield[@tag='020']">
69 <pz:metadata type="isbn">
70 <xsl:value-of select="marc:subfield[@code='a']"/>
74 <xsl:for-each select="marc:datafield[@tag='022']">
75 <pz:metadata type="issn">
76 <xsl:value-of select="marc:subfield[@code='a']"/>
80 <xsl:for-each select="marc:datafield[@tag='027']">
81 <pz:metadata type="tech-rep-nr">
82 <xsl:value-of select="marc:subfield[@code='a']"/>
86 <xsl:for-each select="marc:datafield[@tag='100']">
87 <pz:metadata type="author">
88 <xsl:value-of select="marc:subfield[@code='a']"/>
90 <pz:metadata type="author-title">
91 <xsl:value-of select="marc:subfield[@code='c']"/>
93 <pz:metadata type="author-date">
94 <xsl:value-of select="marc:subfield[@code='d']"/>
98 <xsl:for-each select="marc:datafield[@tag='110']">
99 <pz:metadata type="corporate-name">
100 <xsl:value-of select="marc:subfield[@code='a']"/>
102 <pz:metadata type="corporate-location">
103 <xsl:value-of select="marc:subfield[@code='c']"/>
105 <pz:metadata type="corporate-date">
106 <xsl:value-of select="marc:subfield[@code='d']"/>
110 <xsl:for-each select="marc:datafield[@tag='111']">
111 <pz:metadata type="meeting-name">
112 <xsl:value-of select="marc:subfield[@code='a']"/>
114 <pz:metadata type="meeting-location">
115 <xsl:value-of select="marc:subfield[@code='c']"/>
117 <pz:metadata type="meeting-date">
118 <xsl:value-of select="marc:subfield[@code='d']"/>
122 <xsl:for-each select="marc:datafield[@tag='260']">
123 <pz:metadata type="date">
124 <xsl:value-of select="marc:subfield[@code='c']"/>
128 <xsl:for-each select="marc:datafield[@tag='245']">
129 <pz:metadata type="title">
130 <xsl:value-of select="marc:subfield[@code='a']"/>
132 <pz:metadata type="title-remainder">
133 <xsl:value-of select="marc:subfield[@code='b']"/>
135 <pz:metadata type="title-responsibility">
136 <xsl:value-of select="marc:subfield[@code='c']"/>
138 <pz:metadata type="title-dates">
139 <xsl:value-of select="marc:subfield[@code='f']"/>
141 <pz:metadata type="title-medium">
142 <xsl:value-of select="marc:subfield[@code='h']"/>
144 <pz:metadata type="title-number-section">
145 <xsl:value-of select="marc:subfield[@code='n']"/>
149 <xsl:for-each select="marc:datafield[@tag='250']">
150 <pz:metadata type="edition">
151 <xsl:value-of select="marc:subfield[@code='a']"/>
155 <xsl:for-each select="marc:datafield[@tag='260']">
156 <pz:metadata type="publication-place">
157 <xsl:value-of select="marc:subfield[@code='a']"/>
159 <pz:metadata type="publication-name">
160 <xsl:value-of select="marc:subfield[@code='b']"/>
162 <pz:metadata type="publication-date">
163 <xsl:value-of select="marc:subfield[@code='c']"/>
167 <xsl:for-each select="marc:datafield[@tag='300']">
168 <pz:metadata type="physical-extent">
169 <xsl:value-of select="marc:subfield[@code='a']"/>
171 <pz:metadata type="physical-format">
172 <xsl:value-of select="marc:subfield[@code='b']"/>
174 <pz:metadata type="physical-dimensions">
175 <xsl:value-of select="marc:subfield[@code='c']"/>
177 <pz:metadata type="physical-accomp">
178 <xsl:value-of select="marc:subfield[@code='e']"/>
180 <pz:metadata type="physical-unittype">
181 <xsl:value-of select="marc:subfield[@code='f']"/>
183 <pz:metadata type="physical-unitsize">
184 <xsl:value-of select="marc:subfield[@code='g']"/>
186 <pz:metadata type="physical-specified">
187 <xsl:value-of select="marc:subfield[@code='3']"/>
191 <xsl:for-each select="marc:datafield[@tag='440']">
192 <pz:metadata type="series-title">
193 <xsl:value-of select="marc:subfield[@code='a']"/>
197 <xsl:for-each select="marc:datafield[@tag >= 500 and @tag <= 599]
198 [@tag != '506' and @tag != '530' and
199 @tag != '540' and @tag != '546'
201 <pz:metadata type="description">
202 <xsl:value-of select="*/text()"/>
206 <xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
207 <pz:metadata type="subject">
208 <xsl:value-of select="marc:subfield[@code='a']"/>
210 <pz:metadata type="subject-long">
211 <xsl:for-each select="marc:subfield">
212 <xsl:if test="position() > 1">
213 <xsl:text>, </xsl:text>
215 <xsl:value-of select="."/>
220 <xsl:for-each select="marc:datafield[@tag='856']">
221 <pz:metadata type="electronic-url">
222 <xsl:value-of select="marc:subfield[@code='u']"/>
224 <pz:metadata type="electronic-text">
225 <xsl:value-of select="marc:subfield[@code='y']"/>
227 <pz:metadata type="electronic-note">
228 <xsl:value-of select="marc:subfield[@code='z']"/>
232 <xsl:for-each select="marc:datafield[@tag='773']">
233 <pz:metadata type="citation">
234 <xsl:for-each select="*">
235 <xsl:value-of select="normalize-space(.)"/>
236 <xsl:text> </xsl:text>
241 <pz:metadata type="medium">
242 <xsl:value-of select="$medium"/>
245 <xsl:if test="$fulltext_a">
246 <pz:metadata type="fulltext">
247 <xsl:value-of select="$fulltext_a"/>
251 <xsl:if test="$fulltext_b">
252 <pz:metadata type="fulltext">
253 <xsl:value-of select="$fulltext_b"/>
257 <xsl:if test="$open_url_resolver">
258 <pz:metadata type="open-url">
259 <xsl:call-template name="insert-md-openurl" />