Line 0
Link Here
|
0 |
- |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
|
2 |
|
3 |
<!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> |
4 |
|
5 |
<xsl:stylesheet version="1.0" |
6 |
xmlns:marc="http://www.loc.gov/MARC21/slim" |
7 |
xmlns:srw_dc="info:srw/schema/1/dc-schema" |
8 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
9 |
xmlns="http://purl.org/dc/elements/1.1/" |
10 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc"> |
11 |
<xsl:import href="MARC21slimUtils.xsl"/> |
12 |
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> |
13 |
<xsl:template match="/"> |
14 |
<xsl:if test="marc:collection"> |
15 |
<srw_dc:dcCollection xmlns:srw_dc="info:srw/schema/1/dc-schema" xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/z3950/agency/zing/srw/dc-schema.xsd"> |
16 |
<xsl:for-each select="marc:collection"> |
17 |
<xsl:for-each select="marc:record"> |
18 |
<srw_dc:dc> |
19 |
<xsl:apply-templates select="."/> |
20 |
</srw_dc:dc> |
21 |
</xsl:for-each> |
22 |
</xsl:for-each> |
23 |
</srw_dc:dcCollection> |
24 |
</xsl:if> |
25 |
<xsl:if test="marc:record"> |
26 |
<srw_dc:dc xmlns:srw_dc="info:srw/schema/1/dc-schema" xsi:schemaLocation="info:srw/schema/1/dc-schema http://www.loc.gov/z3950/agency/zing/srw/dc-schema.xsd"> |
27 |
<xsl:apply-templates select="marc:record"/> |
28 |
</srw_dc:dc> |
29 |
</xsl:if> |
30 |
</xsl:template> |
31 |
<xsl:template match="marc:record"> |
32 |
<xsl:variable name="leader" select="marc:leader"/> |
33 |
<xsl:variable name="leader6" select="substring($leader,7,1)"/> |
34 |
<xsl:variable name="leader7" select="substring($leader,8,1)"/> |
35 |
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/> |
36 |
<xsl:for-each select="marc:datafield[@tag=245]"> |
37 |
<title> |
38 |
<xsl:call-template name="subfieldSelect"> |
39 |
<xsl:with-param name="codes">abfghk</xsl:with-param> |
40 |
</xsl:call-template> |
41 |
</title> |
42 |
</xsl:for-each> |
43 |
<xsl:for-each select="marc:datafield[@tag=100]|marc:datafield[@tag=110]|marc:datafield[@tag=111]|marc:datafield[@tag=700]|marc:datafield[@tag=710]|marc:datafield[@tag=711]|marc:datafield[@tag=720]"> |
44 |
<creator> |
45 |
<xsl:value-of select="normalize-space(.)"/> |
46 |
</creator> |
47 |
</xsl:for-each> |
48 |
<type> |
49 |
<xsl:if test="$leader7='c'"> |
50 |
<xsl:text>collection</xsl:text> |
51 |
</xsl:if> |
52 |
<xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'"> |
53 |
<xsl:text>manuscript</xsl:text> |
54 |
</xsl:if> |
55 |
<xsl:choose> |
56 |
<xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when> |
57 |
<xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when> |
58 |
<xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when> |
59 |
<xsl:when test="$leader6='i' or $leader6='j'">sound recording</xsl:when> |
60 |
<xsl:when test="$leader6='k'">still image</xsl:when> |
61 |
<xsl:when test="$leader6='g'">moving image</xsl:when> |
62 |
<xsl:when test="$leader6='r'">three dimensional object</xsl:when> |
63 |
<xsl:when test="$leader6='m'">software, multimedia</xsl:when> |
64 |
<xsl:when test="$leader6='p'">mixed material</xsl:when> |
65 |
</xsl:choose> |
66 |
</type> |
67 |
<xsl:for-each select="marc:datafield[@tag=655]"> |
68 |
<type> |
69 |
<xsl:value-of select="normalize-space(.)"/> |
70 |
</type> |
71 |
</xsl:for-each> |
72 |
<xsl:for-each select="marc:datafield[@tag=260]"> |
73 |
<publisher> |
74 |
<xsl:call-template name="subfieldSelect"> |
75 |
<xsl:with-param name="codes">ab</xsl:with-param> |
76 |
</xsl:call-template> |
77 |
</publisher> |
78 |
</xsl:for-each> |
79 |
<xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='c']"> |
80 |
<date> |
81 |
<xsl:value-of select="."/> |
82 |
</date> |
83 |
</xsl:for-each> |
84 |
<xsl:for-each select="marc:datafield[@tag=264]"> |
85 |
<publisher> |
86 |
<xsl:call-template name="subfieldSelect"> |
87 |
<xsl:with-param name="codes">ab</xsl:with-param> |
88 |
</xsl:call-template> |
89 |
</publisher> |
90 |
</xsl:for-each> |
91 |
<xsl:for-each select="marc:datafield[@tag=264]/marc:subfield[@code='c']"> |
92 |
<date> |
93 |
<xsl:value-of select="."/> |
94 |
</date> |
95 |
</xsl:for-each> |
96 |
<xsl:if test="substring($controlField008,36,3)"> |
97 |
<language> |
98 |
<xsl:value-of select="substring($controlField008,36,3)"/> |
99 |
</language> |
100 |
</xsl:if> |
101 |
<xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q']"> |
102 |
<format> |
103 |
<xsl:value-of select="."/> |
104 |
</format> |
105 |
</xsl:for-each> |
106 |
<xsl:for-each select="marc:datafield[@tag=520]"> |
107 |
<description> |
108 |
<xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/> |
109 |
</description> |
110 |
</xsl:for-each> |
111 |
<xsl:for-each select="marc:datafield[@tag=521]"> |
112 |
<description> |
113 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
114 |
</description> |
115 |
</xsl:for-each> |
116 |
<xsl:for-each select="marc:datafield[500<@tag][@tag<=599][not(@tag=506 or @tag=530 or @tag=540 or @tag=546)]"> |
117 |
<description> |
118 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
119 |
</description> |
120 |
</xsl:for-each> |
121 |
<xsl:for-each select="marc:datafield[@tag=600]"> |
122 |
<subject> |
123 |
<xsl:call-template name="subfieldSelect"> |
124 |
<xsl:with-param name="codes">abcdefghjklmnopqrstu4</xsl:with-param> |
125 |
</xsl:call-template> |
126 |
<xsl:if test="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']"> |
127 |
<xsl:text>--</xsl:text> |
128 |
<xsl:call-template name="subfieldSelect"> |
129 |
<xsl:with-param name="codes">vxyz</xsl:with-param> |
130 |
<xsl:with-param name="delimeter">--</xsl:with-param> |
131 |
</xsl:call-template> |
132 |
</xsl:if> |
133 |
</subject> |
134 |
</xsl:for-each> |
135 |
<xsl:for-each select="marc:datafield[@tag=610]"> |
136 |
<subject> |
137 |
<xsl:call-template name="subfieldSelect"> |
138 |
<xsl:with-param name="codes">abcdefghklmnoprstu4</xsl:with-param> |
139 |
</xsl:call-template> |
140 |
<xsl:if test="marc:subfield[@code='v' or @code='x' or @code='y' or |
141 |
@code='z']"> |
142 |
<xsl:text>--</xsl:text> |
143 |
<xsl:call-template name="subfieldSelect"> |
144 |
<xsl:with-param name="codes">vxyz</xsl:with-param> |
145 |
<xsl:with-param name="delimeter">--</xsl:with-param> |
146 |
</xsl:call-template> |
147 |
</xsl:if> |
148 |
</subject> |
149 |
</xsl:for-each> |
150 |
<xsl:for-each select="marc:datafield[@tag=611]"> |
151 |
<subject> |
152 |
<xsl:call-template name="subfieldSelect"> |
153 |
<xsl:with-param name="codes">acdefghklnpqstu4</xsl:with-param> |
154 |
</xsl:call-template> |
155 |
<xsl:if test="marc:subfield[@code='v' or @code='x' or @code='y' or |
156 |
@code='z']"> |
157 |
<xsl:text>--</xsl:text> |
158 |
<xsl:call-template name="subfieldSelect"> |
159 |
<xsl:with-param name="codes">vxyz</xsl:with-param> |
160 |
<xsl:with-param name="delimeter">--</xsl:with-param> |
161 |
</xsl:call-template> |
162 |
</xsl:if> |
163 |
</subject> |
164 |
</xsl:for-each> |
165 |
<xsl:for-each select="marc:datafield[@tag=630]"> |
166 |
<subject> |
167 |
<xsl:call-template name="subfieldSelect"> |
168 |
<xsl:with-param name="codes">adfghklmnoprst</xsl:with-param> |
169 |
</xsl:call-template> |
170 |
<xsl:if test="marc:subfield[@code='v' or @code='x' or @code='y' or |
171 |
@code='z']"> |
172 |
<xsl:text>--</xsl:text> |
173 |
<xsl:call-template name="subfieldSelect"> |
174 |
<xsl:with-param name="codes">vxyz</xsl:with-param> |
175 |
<xsl:with-param name="delimeter">--</xsl:with-param> |
176 |
</xsl:call-template> |
177 |
</xsl:if> |
178 |
</subject> |
179 |
</xsl:for-each> |
180 |
<xsl:for-each select="marc:datafield[@tag=650]"> |
181 |
<subject> |
182 |
<xsl:call-template name="subfieldSelect"> |
183 |
<xsl:with-param name="codes">ae</xsl:with-param></xsl:call-template> |
184 |
<xsl:if test="marc:subfield[@code='v' or @code='x' or @code='y' or |
185 |
@code='z']"> |
186 |
<xsl:text>--</xsl:text> |
187 |
<xsl:call-template name="subfieldSelect"> |
188 |
<xsl:with-param name="codes">vxyz</xsl:with-param> |
189 |
<xsl:with-param name="delimeter">--</xsl:with-param> |
190 |
</xsl:call-template> |
191 |
</xsl:if> |
192 |
</subject> |
193 |
</xsl:for-each> |
194 |
<xsl:for-each select="marc:datafield[@tag=653]"> |
195 |
<subject> |
196 |
<xsl:call-template name="subfieldSelect"> |
197 |
<xsl:with-param name="codes">a</xsl:with-param> |
198 |
</xsl:call-template> |
199 |
</subject> |
200 |
</xsl:for-each> |
201 |
<xsl:for-each select="marc:datafield[@tag=651]"> |
202 |
<coverage> |
203 |
<xsl:call-template name="subfieldSelect"> |
204 |
<xsl:with-param name="codes">a</xsl:with-param> |
205 |
</xsl:call-template> |
206 |
<xsl:if test="marc:subfield[@code='v' or @code='x' or @code='y' or |
207 |
@code='z']"> |
208 |
<xsl:text>--</xsl:text> |
209 |
<xsl:call-template name="subfieldSelect"> |
210 |
<xsl:with-param name="codes">vxyz</xsl:with-param> |
211 |
<xsl:with-param name="delimeter">--</xsl:with-param> |
212 |
</xsl:call-template> |
213 |
</xsl:if> |
214 |
</coverage> |
215 |
</xsl:for-each> |
216 |
<xsl:for-each select="marc:datafield[@tag=752]"> |
217 |
<coverage> |
218 |
<xsl:call-template name="subfieldSelect"> |
219 |
<xsl:with-param name="codes">abcd</xsl:with-param> |
220 |
</xsl:call-template> |
221 |
</coverage> |
222 |
</xsl:for-each> |
223 |
<xsl:for-each select="marc:datafield[@tag=530]"> |
224 |
<relation> |
225 |
<xsl:call-template name="subfieldSelect"> |
226 |
<xsl:with-param name="codes">abcdu</xsl:with-param> |
227 |
</xsl:call-template> |
228 |
</relation> |
229 |
</xsl:for-each> |
230 |
<xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]|marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=770]|marc:datafield[@tag=772]|marc:datafield[@tag=773]|marc:datafield[@tag=774]|marc:datafield[@tag=775]|marc:datafield[@tag=776]|marc:datafield[@tag=777]|marc:datafield[@tag=780]|marc:datafield[@tag=785]|marc:datafield[@tag=786]|marc:datafield[@tag=787]"> |
231 |
<relation> |
232 |
<xsl:call-template name="subfieldSelect"> |
233 |
<xsl:with-param name="codes">ot</xsl:with-param> |
234 |
</xsl:call-template> |
235 |
</relation> |
236 |
</xsl:for-each> |
237 |
<xsl:for-each select="marc:datafield[@tag=856]"> |
238 |
<identifier> |
239 |
<xsl:value-of select="marc:subfield[@code='u']"/> |
240 |
</identifier> |
241 |
</xsl:for-each> |
242 |
<xsl:for-each select="marc:datafield[@tag=020]"> |
243 |
<identifier> |
244 |
<xsl:text>URN:ISBN:</xsl:text> |
245 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
246 |
</identifier> |
247 |
</xsl:for-each> |
248 |
<xsl:for-each select="marc:datafield[@tag=506]"> |
249 |
<rights> |
250 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
251 |
</rights> |
252 |
</xsl:for-each> |
253 |
<xsl:for-each select="marc:datafield[@tag=540]"> |
254 |
<rights> |
255 |
<xsl:value-of select="marc:subfield[@code='a']"/> |
256 |
</rights> |
257 |
</xsl:for-each> |
258 |
</xsl:template> |
259 |
</xsl:stylesheet> |
260 |
<!-- Stylus Studio meta-information - (c)1998-2003 Copyright Sonic Software Corporation. All rights reserved. |
261 |
<metaInformation> |
262 |
<scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/> |
263 |
</metaInformation> |
264 |
--> |