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 <!-- Beginnings of Danmarc2 XSL.
13 This is just USMARC with minor tweaks.. Not complete!
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>
47 <xsl:attribute name="mergekey">
48 <xsl:text>title </xsl:text>
49 <xsl:value-of select="marc:datafield[@tag='245']/marc:subfield[@code='a']"/>
50 <xsl:text> author </xsl:text>
51 <xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
52 <xsl:text> medium </xsl:text>
53 <xsl:value-of select="$medium"/>
57 <xsl:for-each select="marc:datafield[@tag='001']/marc:subfield[@code='a']">
58 <pz:metadata type="id">
59 <xsl:value-of select="."/>
63 <xsl:for-each select="marc:datafield[@tag='010']">
64 <pz:metadata type="lccn">
65 <xsl:value-of select="marc:subfield[@code='a']"/>
69 <xsl:for-each select="marc:datafield[@tag='020']">
70 <pz:metadata type="isbn">
71 <xsl:value-of select="marc:subfield[@code='a']"/>
75 <xsl:for-each select="marc:datafield[@tag='022']">
76 <pz:metadata type="issn">
77 <xsl:value-of select="marc:subfield[@code='a']"/>
81 <xsl:for-each select="marc:datafield[@tag='027']">
82 <pz:metadata type="tech-rep-nr">
83 <xsl:value-of select="marc:subfield[@code='a']"/>
87 <xsl:for-each select="marc:datafield[@tag='100']">
88 <pz:metadata type="author">
89 <xsl:value-of select="marc:subfield[@code='a']"/>
91 <pz:metadata type="author-title">
92 <xsl:value-of select="marc:subfield[@code='c']"/>
94 <pz:metadata type="author-date">
95 <xsl:value-of select="marc:subfield[@code='d']"/>
99 <xsl:for-each select="marc:datafield[@tag='110']">
100 <pz:metadata type="corporate-name">
101 <xsl:value-of select="marc:subfield[@code='a']"/>
103 <pz:metadata type="corporate-location">
104 <xsl:value-of select="marc:subfield[@code='c']"/>
106 <pz:metadata type="corporate-date">
107 <xsl:value-of select="marc:subfield[@code='d']"/>
111 <xsl:for-each select="marc:datafield[@tag='111']">
112 <pz:metadata type="meeting-name">
113 <xsl:value-of select="marc:subfield[@code='a']"/>
115 <pz:metadata type="meeting-location">
116 <xsl:value-of select="marc:subfield[@code='c']"/>
118 <pz:metadata type="meeting-date">
119 <xsl:value-of select="marc:subfield[@code='d']"/>
123 <xsl:for-each select="marc:datafield[@tag='260']">
124 <pz:metadata type="date">
125 <xsl:value-of select="marc:subfield[@code='c']"/>
129 <xsl:for-each select="marc:datafield[@tag='245']">
130 <pz:metadata type="title">
131 <xsl:value-of select="marc:subfield[@code='a']"/>
133 <pz:metadata type="title-remainder">
134 <xsl:value-of select="marc:subfield[@code='b']"/>
136 <pz:metadata type="title-responsibility">
137 <xsl:value-of select="marc:subfield[@code='c']"/>
139 <pz:metadata type="title-dates">
140 <xsl:value-of select="marc:subfield[@code='f']"/>
142 <pz:metadata type="title-medium">
143 <xsl:value-of select="marc:subfield[@code='h']"/>
147 <xsl:for-each select="marc:datafield[@tag='250']">
148 <pz:metadata type="edition">
149 <xsl:value-of select="marc:subfield[@code='a']"/>
153 <xsl:for-each select="marc:datafield[@tag='260']">
154 <pz:metadata type="publication-place">
155 <xsl:value-of select="marc:subfield[@code='a']"/>
157 <pz:metadata type="publication-name">
158 <xsl:value-of select="marc:subfield[@code='b']"/>
160 <pz:metadata type="publication-date">
161 <xsl:value-of select="marc:subfield[@code='c']"/>
165 <xsl:for-each select="marc:datafield[@tag='300']">
166 <pz:metadata type="physical-extent">
167 <xsl:value-of select="marc:subfield[@code='a']"/>
169 <pz:metadata type="physical-format">
170 <xsl:value-of select="marc:subfield[@code='b']"/>
172 <pz:metadata type="physical-dimensions">
173 <xsl:value-of select="marc:subfield[@code='c']"/>
175 <pz:metadata type="physical-accomp">
176 <xsl:value-of select="marc:subfield[@code='e']"/>
178 <pz:metadata type="physical-unittype">
179 <xsl:value-of select="marc:subfield[@code='f']"/>
181 <pz:metadata type="physical-unitsize">
182 <xsl:value-of select="marc:subfield[@code='g']"/>
184 <pz:metadata type="physical-specified">
185 <xsl:value-of select="marc:subfield[@code='3']"/>
189 <xsl:for-each select="marc:datafield[@tag='440']">
190 <pz:metadata type="series-title">
191 <xsl:value-of select="marc:subfield[@code='a']"/>
195 <xsl:for-each select="marc:datafield[@tag >= 500 and @tag <= 599]
196 [@tag != '506' and @tag != '530' and
197 @tag != '540' and @tag != '546'
199 <pz:metadata type="description">
200 <xsl:value-of select="*/text()"/>
204 <xsl:for-each select="marc:datafield[@tag='650' or @tag='653'
205 or @tag='630' or @tag='666']">
207 <xsl:for-each select="marc:subfield">
208 <pz:metadata type="subject">
209 <xsl:value-of select="."/>
214 <xsl:for-each select="marc:datafield[@tag='856']">
215 <pz:metadata type="electronic-url">
216 <xsl:value-of select="marc:subfield[@code='u']"/>
218 <pz:metadata type="electronic-text">
219 <xsl:value-of select="marc:subfield[@code='y']"/>
221 <pz:metadata type="electronic-note">
222 <xsl:value-of select="marc:subfield[@code='z']"/>
226 <xsl:for-each select="marc:datafield[@tag='773']">
227 <pz:metadata type="citation">
228 <xsl:for-each select="*">
229 <xsl:value-of select="normalize-space(.)"/>
230 <xsl:text> </xsl:text>
235 <pz:metadata type="medium">
236 <xsl:value-of select="$medium"/>
239 <xsl:if test="$fulltext_a">
240 <pz:metadata type="fulltext">
241 <xsl:value-of select="$fulltext_a"/>
245 <xsl:if test="$fulltext_b">
246 <pz:metadata type="fulltext">
247 <xsl:value-of select="$fulltext_b"/>
251 <xsl:if test="$open_url_resolver">
252 <pz:metadata type="open-url">
253 <xsl:call-template name="insert-md-openurl" />