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">
8 <xsl:param name="test"/>
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
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"/>
55 <pz:metadata type="test_usersetting_2">
57 <xsl:value-of select="$test"/>
60 <xsl:for-each select="marc:controlfield[@tag='001']">
61 <pz:metadata type="id">
62 <xsl:value-of select="."/>
66 <xsl:for-each select="marc:datafield[@tag='010']">
67 <pz:metadata type="lccn">
68 <xsl:value-of select="marc:subfield[@code='a']"/>
72 <xsl:for-each select="marc:datafield[@tag='020']">
73 <pz:metadata type="isbn">
74 <xsl:value-of select="marc:subfield[@code='a']"/>
78 <xsl:for-each select="marc:datafield[@tag='022']">
79 <pz:metadata type="issn">
80 <xsl:value-of select="marc:subfield[@code='a']"/>
84 <xsl:for-each select="marc:datafield[@tag='027']">
85 <pz:metadata type="tech-rep-nr">
86 <xsl:value-of select="marc:subfield[@code='a']"/>
90 <xsl:for-each select="marc:datafield[@tag='100']">
91 <pz:metadata type="author">
92 <xsl:value-of select="marc:subfield[@code='a']"/>
94 <pz:metadata type="author-title">
95 <xsl:value-of select="marc:subfield[@code='c']"/>
97 <pz:metadata type="author-date">
98 <xsl:value-of select="marc:subfield[@code='d']"/>
102 <xsl:for-each select="marc:datafield[@tag='110']">
103 <pz:metadata type="corporate-name">
104 <xsl:value-of select="marc:subfield[@code='a']"/>
106 <pz:metadata type="corporate-location">
107 <xsl:value-of select="marc:subfield[@code='c']"/>
109 <pz:metadata type="corporate-date">
110 <xsl:value-of select="marc:subfield[@code='d']"/>
114 <xsl:for-each select="marc:datafield[@tag='111']">
115 <pz:metadata type="meeting-name">
116 <xsl:value-of select="marc:subfield[@code='a']"/>
118 <pz:metadata type="meeting-location">
119 <xsl:value-of select="marc:subfield[@code='c']"/>
121 <pz:metadata type="meeting-date">
122 <xsl:value-of select="marc:subfield[@code='d']"/>
126 <xsl:for-each select="marc:datafield[@tag='260']">
127 <pz:metadata type="date">
128 <xsl:value-of select="marc:subfield[@code='c']"/>
132 <xsl:for-each select="marc:datafield[@tag='245']">
133 <pz:metadata type="title">
134 <xsl:value-of select="marc:subfield[@code='a']"/>
136 <pz:metadata type="title-remainder">
137 <xsl:value-of select="marc:subfield[@code='b']"/>
139 <pz:metadata type="title-responsibility">
140 <xsl:value-of select="marc:subfield[@code='c']"/>
142 <pz:metadata type="title-dates">
143 <xsl:value-of select="marc:subfield[@code='f']"/>
145 <pz:metadata type="title-medium">
146 <xsl:value-of select="marc:subfield[@code='h']"/>
150 <xsl:for-each select="marc:datafield[@tag='250']">
151 <pz:metadata type="edition">
152 <xsl:value-of select="marc:subfield[@code='a']"/>
156 <xsl:for-each select="marc:datafield[@tag='260']">
157 <pz:metadata type="publication-place">
158 <xsl:value-of select="marc:subfield[@code='a']"/>
160 <pz:metadata type="publication-name">
161 <xsl:value-of select="marc:subfield[@code='b']"/>
163 <pz:metadata type="publication-date">
164 <xsl:value-of select="marc:subfield[@code='c']"/>
168 <xsl:for-each select="marc:datafield[@tag='300']">
169 <pz:metadata type="physical-extent">
170 <xsl:value-of select="marc:subfield[@code='a']"/>
172 <pz:metadata type="physical-format">
173 <xsl:value-of select="marc:subfield[@code='b']"/>
175 <pz:metadata type="physical-dimensions">
176 <xsl:value-of select="marc:subfield[@code='c']"/>
178 <pz:metadata type="physical-accomp">
179 <xsl:value-of select="marc:subfield[@code='e']"/>
181 <pz:metadata type="physical-unittype">
182 <xsl:value-of select="marc:subfield[@code='f']"/>
184 <pz:metadata type="physical-unitsize">
185 <xsl:value-of select="marc:subfield[@code='g']"/>
187 <pz:metadata type="physical-specified">
188 <xsl:value-of select="marc:subfield[@code='3']"/>
192 <xsl:for-each select="marc:datafield[@tag='440']">
193 <pz:metadata type="series-title">
194 <xsl:value-of select="marc:subfield[@code='a']"/>
198 <xsl:for-each select="marc:datafield[@tag >= 500 and @tag <= 599]
199 [@tag != '506' and @tag != '530' and
200 @tag != '540' and @tag != '546'
202 <pz:metadata type="description">
203 <xsl:value-of select="*/text()"/>
207 <xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
208 <pz:metadata type="subject">
209 <xsl:value-of select="marc:subfield[@code='a']"/>
213 <xsl:for-each select="marc:datafield[@tag='856']">
214 <pz:metadata type="electronic-url">
215 <xsl:value-of select="marc:subfield[@code='u']"/>
217 <pz:metadata type="electronic-text">
218 <xsl:value-of select="marc:subfield[@code='y']"/>
220 <pz:metadata type="electronic-note">
221 <xsl:value-of select="marc:subfield[@code='z']"/>
225 <xsl:for-each select="marc:datafield[@tag='773']">
226 <pz:metadata type="citation">
227 <xsl:for-each select="*">
228 <xsl:value-of select="normalize-space(.)"/>
229 <xsl:text> </xsl:text>
234 <pz:metadata type="medium">
235 <xsl:value-of select="$medium"/>
238 <xsl:if test="$fulltext_a">
239 <pz:metadata type="fulltext">
240 <xsl:value-of select="$fulltext_a"/>
244 <xsl:if test="$fulltext_b">
245 <pz:metadata type="fulltext">
246 <xsl:value-of select="$fulltext_b"/>