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=
"MARC21slimUtils.xsl" />
16 <xsl:include href=
"pz2-ourl-marc21.xsl" />
18 <xsl:template match=
"/marc:record">
19 <xsl:variable name=
"title_medium" select=
"marc:datafield[@tag='245']/marc:subfield[@code='h']"/>
20 <xsl:variable name=
"journal_title" select=
"marc:datafield[@tag='773']/marc:subfield[@code='t']"/>
21 <xsl:variable name=
"electronic_location_url" select=
"marc:datafield[@tag='856']/marc:subfield[@code='u']"/>
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=
"$electronic_location_url">
28 <xsl:text>electronic resource
</xsl:text>
30 <xsl:when test=
"$journal_title">
31 <xsl:text>article
</xsl:text>
34 <xsl:text>book
</xsl:text>
39 <xsl:variable name=
"uniform_title_key">
41 <xsl:when test=
"marc:datafield[@tag='130']">
42 <xsl:for-each select=
"marc:datafield[@tag='130']">
43 <xsl:call-template name=
"subfieldSelect">
44 <xsl:with-param name=
"codes">adgknmpr
</xsl:with-param>
48 <xsl:when test=
"marc:datafield[@tag='240']">
49 <xsl:for-each select=
"marc:datafield[@tag='240']">
50 <xsl:call-template name=
"subfieldSelect">
51 <xsl:with-param name=
"codes">adgknmpr
</xsl:with-param>
55 <xsl:when test=
"marc:datafield[@tag='243']">
56 <xsl:for-each select=
"marc:datafield[@tag='243']">
57 <xsl:call-template name=
"subfieldSelect">
58 <xsl:with-param name=
"codes">adgknmpr
</xsl:with-param>
65 <xsl:variable name=
"title_key">
66 <xsl:for-each select=
"marc:datafield[@tag='245']">
67 <xsl:call-template name=
"subfieldSelect">
68 <xsl:with-param name=
"codes">abnp
</xsl:with-param>
73 <xsl:variable name=
"work_title">
75 <xsl:when test=
"$uniform_title_key != ''">
76 <xsl:value-of select=
"$uniform_title_key" />
79 <xsl:value-of select=
"$title_key" />
84 <xsl:variable name=
"non_ut_main_entry_key">
86 <xsl:when test=
"marc:datafield[@tag='100']">
87 <xsl:for-each select=
"marc:datafield[@tag='100']">
88 <xsl:call-template name=
"subfieldSelect">
89 <xsl:with-param name=
"codes">abcd
</xsl:with-param>
93 <xsl:when test=
"marc:datafield[@tag='110']">
94 <xsl:for-each select=
"marc:datafield[@tag='110']">
95 <xsl:call-template name=
"subfieldSelect">
96 <xsl:with-param name=
"codes">abcd
</xsl:with-param>
100 <xsl:when test=
"marc:datafield[@tag='111']">
101 <xsl:for-each select=
"marc:datafield[@tag='111']">
102 <xsl:call-template name=
"subfieldSelect">
103 <xsl:with-param name=
"codes">abcdnq
</xsl:with-param>
110 <xsl:variable name=
"mergekey">
111 <xsl:text>titlekey
</xsl:text>
112 <xsl:value-of select=
"$work_title" />
113 <xsl:if test=
"$non_ut_main_entry_key != ''">
114 <xsl:text> namemainentry
</xsl:text>
115 <xsl:value-of select=
"$non_ut_main_entry_key" />
120 <xsl:attribute name=
"mergekey">
121 <xsl:value-of select=
"$mergekey"/>
124 <xsl:for-each select=
"marc:datafield[@tag='999']">
125 <pz:metadata type=
"kohaid">
126 <xsl:value-of select=
"marc:subfield[@code='c']"/>
131 <xsl:for-each select="marc:datafield[@tag='020']">
132 <pz:metadata type="isbn">
133 <xsl:value-of select="marc:subfield[@code='a']"/>
138 <xsl:for-each select=
"marc:datafield[@tag='245']">
139 <pz:metadata type=
"work-title">
140 <xsl:value-of select=
"$work_title" />
144 <xsl:if test=
"$non_ut_main_entry_key != ''">
145 <pz:metadata type=
"work-author">
146 <xsl:value-of select=
"$non_ut_main_entry_key" />
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']"/>
170 <xsl:for-each select="marc:datafield[@tag='300']">
171 <pz:metadata type="physical-extent">
172 <xsl:value-of select="marc:subfield[@code='a']"/>
174 <pz:metadata type="physical-format">
175 <xsl:value-of select="marc:subfield[@code='b']"/>
177 <pz:metadata type="physical-dimensions">
178 <xsl:value-of select="marc:subfield[@code='c']"/>
180 <pz:metadata type="physical-accomp">
181 <xsl:value-of select="marc:subfield[@code='e']"/>
183 <pz:metadata type="physical-unittype">
184 <xsl:value-of select="marc:subfield[@code='f']"/>
186 <pz:metadata type="physical-unitsize">
187 <xsl:value-of select="marc:subfield[@code='g']"/>
189 <pz:metadata type="physical-specified">
190 <xsl:value-of select="marc:subfield[@code='3']"/>