Bug 8620: (follow-up) apply to NORMARC and MARC21 authorities
[koha.git] / etc / zebradb / marc_defs / marc21 / authorities / authority-zebra-indexdefs.xsl
blob58eceedcc09cfdc11f6ee7aefc80e50b98d5ba00
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 This file has been automatically generated from a Koha index definition file
4 with the stylesheet koha-indexdefs-to-zebra.xsl. Do not manually edit this file,
5 as it may be overwritten. To regenerate, edit the appropriate Koha index
6 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) and run:
7 `xsltproc koha-indexdefs-to-zebra.xsl {biblio,authority}-koha-indexdefs.xml >
8 {biblio,authority}-zebra-indexdefs.xsl` (substituting the appropriate file names).
9 -->
10 <xslo:stylesheet xmlns:xslo="http://www.w3.org/1999/XSL/Transform" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:z="http://indexdata.com/zebra-2.0" xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs" version="1.0">
11 <xslo:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
12 <xslo:template match="text()"/>
13 <xslo:template match="text()" mode="index_subfields"/>
14 <xslo:template match="text()" mode="index_data_field"/>
15 <xslo:template match="text()" mode="index_heading"/>
16 <xslo:template match="text()" mode="index_heading_conditional"/>
17 <xslo:template match="text()" mode="index_match_heading"/>
18 <xslo:template match="text()" mode="index_subject_thesaurus"/>
19 <xslo:template match="/">
20 <xslo:if test="marc:collection">
21 <collection>
22 <xslo:apply-templates select="marc:collection/marc:record"/>
23 </collection>
24 </xslo:if>
25 <xslo:if test="marc:record">
26 <xslo:apply-templates select="marc:record"/>
27 </xslo:if>
28 </xslo:template>
29 <xslo:template match="marc:record">
30 <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
31 <z:record type="update">
32 <xslo:attribute name="z:id">
33 <xslo:value-of select="$idfield"/>
34 </xslo:attribute>
35 <xslo:apply-templates/>
36 <xslo:apply-templates mode="index_subfields"/>
37 <xslo:apply-templates mode="index_data_field"/>
38 <xslo:apply-templates mode="index_heading"/>
39 <xslo:apply-templates mode="index_heading_conditional"/>
40 <xslo:apply-templates mode="index_match_heading"/>
41 <xslo:apply-templates mode="index_subject_thesaurus"/>
42 <xslo:apply-templates mode="index_all"/>
43 </z:record>
44 </xslo:template>
45 <xslo:template match="marc:leader">
46 <z:index name="Record-status:w">
47 <xslo:value-of select="substring(., 6, 1)"/>
48 </z:index>
49 <z:index name="Encoding-level:w">
50 <xslo:value-of select="substring(., 18, 1)"/>
51 </z:index>
52 </xslo:template>
53 <xslo:template match="marc:controlfield[@tag='001']">
54 <z:index name="Local-Number:w Local-Number:n Local-Number:s">
55 <xslo:value-of select="."/>
56 </z:index>
57 </xslo:template>
58 <xslo:template match="marc:controlfield[@tag='008']">
59 <z:index name="Kind-of-record:w">
60 <xslo:value-of select="substring(., 10, 1)"/>
61 </z:index>
62 <z:index name="Descriptive-cataloging-rules:w">
63 <xslo:value-of select="substring(., 11, 1)"/>
64 </z:index>
65 <z:index name="Heading-use-main-or-added-entry:w">
66 <xslo:value-of select="substring(., 15, 1)"/>
67 </z:index>
68 <z:index name="Heading-use-subject-added-entry:w">
69 <xslo:value-of select="substring(., 16, 1)"/>
70 </z:index>
71 <z:index name="Heading-use-series-added-entry:w">
72 <xslo:value-of select="substring(., 17, 1)"/>
73 </z:index>
74 </xslo:template>
75 <xslo:template mode="index_subfields" match="marc:datafield[@tag='010']">
76 <xslo:for-each select="marc:subfield">
77 <xslo:if test="contains('az', @code)">
78 <z:index name="LC-card-number:w LC-card-number:p">
79 <xslo:value-of select="."/>
80 </z:index>
81 </xslo:if>
82 </xslo:for-each>
83 </xslo:template>
84 <xslo:template mode="index_subfields" match="marc:datafield[@tag='040']">
85 <xslo:for-each select="marc:subfield">
86 <xslo:if test="contains('acd', @code)">
87 <z:index name="Record-source:w Record-source:p">
88 <xslo:value-of select="."/>
89 </z:index>
90 </xslo:if>
91 </xslo:for-each>
92 </xslo:template>
93 <xslo:template mode="index_subfields" match="marc:datafield[@tag='100']">
94 <xslo:for-each select="marc:subfield">
95 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)">
96 <z:index name="Personal-name:w Personal-name:p Personal-name:s">
97 <xslo:value-of select="."/>
98 </z:index>
99 </xslo:if>
100 </xslo:for-each>
101 </xslo:template>
102 <xslo:template mode="index_subfields" match="marc:datafield[@tag='110']">
103 <xslo:for-each select="marc:subfield">
104 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)">
105 <z:index name="Corporate-name:w Corporate-name:p">
106 <xslo:value-of select="."/>
107 </z:index>
108 </xslo:if>
109 </xslo:for-each>
110 </xslo:template>
111 <xslo:template mode="index_subfields" match="marc:datafield[@tag='111']">
112 <xslo:for-each select="marc:subfield">
113 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)">
114 <z:index name="Meeting-name:w Meeting-name:p">
115 <xslo:value-of select="."/>
116 </z:index>
117 </xslo:if>
118 </xslo:for-each>
119 </xslo:template>
120 <xslo:template mode="index_subfields" match="marc:datafield[@tag='130']">
121 <xslo:for-each select="marc:subfield">
122 <xslo:if test="contains('adfghklmnoprstvxyz', @code)">
123 <z:index name="Title-uniform:w Title-uniform:p">
124 <xslo:value-of select="."/>
125 </z:index>
126 </xslo:if>
127 </xslo:for-each>
128 </xslo:template>
129 <xslo:template mode="index_subfields" match="marc:datafield[@tag='148']">
130 <xslo:for-each select="marc:subfield">
131 <xslo:if test="contains('avxyz', @code)">
132 <z:index name="Chronological-term:w Chronological-term:p">
133 <xslo:value-of select="."/>
134 </z:index>
135 </xslo:if>
136 </xslo:for-each>
137 </xslo:template>
138 <xslo:template mode="index_subfields" match="marc:datafield[@tag='150']">
139 <xslo:for-each select="marc:subfield">
140 <xslo:if test="contains('abvxyz', @code)">
141 <z:index name="Subject-topical:w Subject-topical:p">
142 <xslo:value-of select="."/>
143 </z:index>
144 </xslo:if>
145 </xslo:for-each>
146 </xslo:template>
147 <xslo:template mode="index_subfields" match="marc:datafield[@tag='151']">
148 <xslo:for-each select="marc:subfield">
149 <xslo:if test="contains('avxyz', @code)">
150 <z:index name="Name-geographic:w Name-geographic:p">
151 <xslo:value-of select="."/>
152 </z:index>
153 </xslo:if>
154 </xslo:for-each>
155 </xslo:template>
156 <xslo:template mode="index_subfields" match="marc:datafield[@tag='155']">
157 <xslo:for-each select="marc:subfield">
158 <xslo:if test="contains('avxyz', @code)">
159 <z:index name="Term-genre-form:w Term-genre-form:p">
160 <xslo:value-of select="."/>
161 </z:index>
162 </xslo:if>
163 </xslo:for-each>
164 </xslo:template>
165 <xslo:template mode="index_subfields" match="marc:datafield[@tag='942']">
166 <xslo:for-each select="marc:subfield">
167 <xslo:if test="contains('a', @code)">
168 <z:index name="authtype:w">
169 <xslo:value-of select="."/>
170 </z:index>
171 </xslo:if>
172 </xslo:for-each>
173 </xslo:template>
174 <xslo:template mode="index_heading" match="marc:datafield[@tag='100']">
175 <z:index name="Personal-name-heading:w Personal-name-heading:p Personal-name-heading:s Heading:w Heading:p Heading:s">
176 <xslo:variable name="raw_heading">
177 <xslo:for-each select="marc:subfield">
178 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Personal-name-heading:w Personal-name-heading:p Personal-name-heading:s Heading:w Heading:p Heading:s">
179 <xslo:if test="position() &gt; 1">
180 <xslo:choose>
181 <xslo:when test="contains('vxyz', @code)">
182 <xslo:text>--</xslo:text>
183 </xslo:when>
184 <xslo:otherwise>
185 <xslo:value-of select="substring(' ', 1, 1)"/>
186 </xslo:otherwise>
187 </xslo:choose>
188 </xslo:if>
189 <xslo:value-of select="."/>
190 </xslo:if>
191 </xslo:for-each>
192 </xslo:variable>
193 <xslo:value-of select="normalize-space($raw_heading)"/>
194 </z:index>
195 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
196 <xslo:variable name="raw_heading">
197 <xslo:for-each select="marc:subfield">
198 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
199 <xslo:if test="position() &gt; 1">
200 <xslo:choose>
201 <xslo:when test="contains('', @code)">
202 <xslo:text>--</xslo:text>
203 </xslo:when>
204 <xslo:otherwise>
205 <xslo:value-of select="substring(' ', 1, 1)"/>
206 </xslo:otherwise>
207 </xslo:choose>
208 </xslo:if>
209 <xslo:value-of select="."/>
210 </xslo:if>
211 </xslo:for-each>
212 </xslo:variable>
213 <xslo:value-of select="normalize-space($raw_heading)"/>
214 </z:index>
215 </xslo:template>
216 <xslo:template mode="index_heading" match="marc:datafield[@tag='400']">
217 <z:index name="Personal-name-see-from:w Personal-name-see-from:p Personal-name-see-from:s See-from:w See-from:p See-from:s">
218 <xslo:variable name="raw_heading">
219 <xslo:for-each select="marc:subfield">
220 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Personal-name-see-from:w Personal-name-see-from:p Personal-name-see-from:s See-from:w See-from:p See-from:s">
221 <xslo:if test="position() &gt; 1">
222 <xslo:choose>
223 <xslo:when test="contains('vxyz', @code)">
224 <xslo:text>--</xslo:text>
225 </xslo:when>
226 <xslo:otherwise>
227 <xslo:value-of select="substring(' ', 1, 1)"/>
228 </xslo:otherwise>
229 </xslo:choose>
230 </xslo:if>
231 <xslo:value-of select="."/>
232 </xslo:if>
233 </xslo:for-each>
234 </xslo:variable>
235 <xslo:value-of select="normalize-space($raw_heading)"/>
236 </z:index>
237 </xslo:template>
238 <xslo:template mode="index_heading" match="marc:datafield[@tag='500']">
239 <z:index name="Personal-name-see-also-from:w Personal-name-see-also-from:p Personal-name-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
240 <xslo:variable name="raw_heading">
241 <xslo:for-each select="marc:subfield">
242 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Personal-name-see-also-from:w Personal-name-see-also-from:p Personal-name-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
243 <xslo:if test="position() &gt; 1">
244 <xslo:choose>
245 <xslo:when test="contains('vxyz', @code)">
246 <xslo:text>--</xslo:text>
247 </xslo:when>
248 <xslo:otherwise>
249 <xslo:value-of select="substring(' ', 1, 1)"/>
250 </xslo:otherwise>
251 </xslo:choose>
252 </xslo:if>
253 <xslo:value-of select="."/>
254 </xslo:if>
255 </xslo:for-each>
256 </xslo:variable>
257 <xslo:value-of select="normalize-space($raw_heading)"/>
258 </z:index>
259 </xslo:template>
260 <xslo:template mode="index_heading" match="marc:datafield[@tag='110']">
261 <z:index name="Corporate-name-heading:w Corporate-name-heading:p Corporate-name-heading:s Heading:w Heading:p Heading:s">
262 <xslo:variable name="raw_heading">
263 <xslo:for-each select="marc:subfield">
264 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Corporate-name-heading:w Corporate-name-heading:p Corporate-name-heading:s Heading:w Heading:p Heading:s">
265 <xslo:if test="position() &gt; 1">
266 <xslo:choose>
267 <xslo:when test="contains('vxyz', @code)">
268 <xslo:text>--</xslo:text>
269 </xslo:when>
270 <xslo:otherwise>
271 <xslo:value-of select="substring(' ', 1, 1)"/>
272 </xslo:otherwise>
273 </xslo:choose>
274 </xslo:if>
275 <xslo:value-of select="."/>
276 </xslo:if>
277 </xslo:for-each>
278 </xslo:variable>
279 <xslo:value-of select="normalize-space($raw_heading)"/>
280 </z:index>
281 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
282 <xslo:variable name="raw_heading">
283 <xslo:for-each select="marc:subfield">
284 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
285 <xslo:if test="position() &gt; 1">
286 <xslo:choose>
287 <xslo:when test="contains('', @code)">
288 <xslo:text>--</xslo:text>
289 </xslo:when>
290 <xslo:otherwise>
291 <xslo:value-of select="substring(' ', 1, 1)"/>
292 </xslo:otherwise>
293 </xslo:choose>
294 </xslo:if>
295 <xslo:value-of select="."/>
296 </xslo:if>
297 </xslo:for-each>
298 </xslo:variable>
299 <xslo:value-of select="normalize-space($raw_heading)"/>
300 </z:index>
301 </xslo:template>
302 <xslo:template mode="index_heading" match="marc:datafield[@tag='410']">
303 <z:index name="Corporate-name-see-from:w Corporate-name-see-from:p Corporate-name-see-from:s See-from:w See-from:p See-from:s">
304 <xslo:variable name="raw_heading">
305 <xslo:for-each select="marc:subfield">
306 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Corporate-name-see-from:w Corporate-name-see-from:p Corporate-name-see-from:s See-from:w See-from:p See-from:s">
307 <xslo:if test="position() &gt; 1">
308 <xslo:choose>
309 <xslo:when test="contains('vxyz', @code)">
310 <xslo:text>--</xslo:text>
311 </xslo:when>
312 <xslo:otherwise>
313 <xslo:value-of select="substring(' ', 1, 1)"/>
314 </xslo:otherwise>
315 </xslo:choose>
316 </xslo:if>
317 <xslo:value-of select="."/>
318 </xslo:if>
319 </xslo:for-each>
320 </xslo:variable>
321 <xslo:value-of select="normalize-space($raw_heading)"/>
322 </z:index>
323 </xslo:template>
324 <xslo:template mode="index_heading" match="marc:datafield[@tag='510']">
325 <z:index name="Corporate-name-see-also-from:w Corporate-name-see-also-from:p Corporate-name-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
326 <xslo:variable name="raw_heading">
327 <xslo:for-each select="marc:subfield">
328 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Corporate-name-see-also-from:w Corporate-name-see-also-from:p Corporate-name-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
329 <xslo:if test="position() &gt; 1">
330 <xslo:choose>
331 <xslo:when test="contains('vxyz', @code)">
332 <xslo:text>--</xslo:text>
333 </xslo:when>
334 <xslo:otherwise>
335 <xslo:value-of select="substring(' ', 1, 1)"/>
336 </xslo:otherwise>
337 </xslo:choose>
338 </xslo:if>
339 <xslo:value-of select="."/>
340 </xslo:if>
341 </xslo:for-each>
342 </xslo:variable>
343 <xslo:value-of select="normalize-space($raw_heading)"/>
344 </z:index>
345 </xslo:template>
346 <xslo:template mode="index_heading" match="marc:datafield[@tag='111']">
347 <z:index name="Meeting-name-heading:w Meeting-name-heading:p Meeting-name-heading:s Heading:w Heading:p Heading:s">
348 <xslo:variable name="raw_heading">
349 <xslo:for-each select="marc:subfield">
350 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Meeting-name-heading:w Meeting-name-heading:p Meeting-name-heading:s Heading:w Heading:p Heading:s">
351 <xslo:if test="position() &gt; 1">
352 <xslo:choose>
353 <xslo:when test="contains('vxyz', @code)">
354 <xslo:text>--</xslo:text>
355 </xslo:when>
356 <xslo:otherwise>
357 <xslo:value-of select="substring(' ', 1, 1)"/>
358 </xslo:otherwise>
359 </xslo:choose>
360 </xslo:if>
361 <xslo:value-of select="."/>
362 </xslo:if>
363 </xslo:for-each>
364 </xslo:variable>
365 <xslo:value-of select="normalize-space($raw_heading)"/>
366 </z:index>
367 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
368 <xslo:variable name="raw_heading">
369 <xslo:for-each select="marc:subfield">
370 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
371 <xslo:if test="position() &gt; 1">
372 <xslo:choose>
373 <xslo:when test="contains('', @code)">
374 <xslo:text>--</xslo:text>
375 </xslo:when>
376 <xslo:otherwise>
377 <xslo:value-of select="substring(' ', 1, 1)"/>
378 </xslo:otherwise>
379 </xslo:choose>
380 </xslo:if>
381 <xslo:value-of select="."/>
382 </xslo:if>
383 </xslo:for-each>
384 </xslo:variable>
385 <xslo:value-of select="normalize-space($raw_heading)"/>
386 </z:index>
387 </xslo:template>
388 <xslo:template mode="index_heading" match="marc:datafield[@tag='411']">
389 <z:index name="Meeting-name-see-from:w Meeting-name-see-from:p Meeting-name-see-from:s See-from:w See-from:p See-from:s">
390 <xslo:variable name="raw_heading">
391 <xslo:for-each select="marc:subfield">
392 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Meeting-name-see-from:w Meeting-name-see-from:p Meeting-name-see-from:s See-from:w See-from:p See-from:s">
393 <xslo:if test="position() &gt; 1">
394 <xslo:choose>
395 <xslo:when test="contains('vxyz', @code)">
396 <xslo:text>--</xslo:text>
397 </xslo:when>
398 <xslo:otherwise>
399 <xslo:value-of select="substring(' ', 1, 1)"/>
400 </xslo:otherwise>
401 </xslo:choose>
402 </xslo:if>
403 <xslo:value-of select="."/>
404 </xslo:if>
405 </xslo:for-each>
406 </xslo:variable>
407 <xslo:value-of select="normalize-space($raw_heading)"/>
408 </z:index>
409 </xslo:template>
410 <xslo:template mode="index_heading" match="marc:datafield[@tag='511']">
411 <z:index name="Meeting-name-see-also-from:w Meeting-name-see-also-from:p Meeting-name-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
412 <xslo:variable name="raw_heading">
413 <xslo:for-each select="marc:subfield">
414 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Meeting-name-see-also-from:w Meeting-name-see-also-from:p Meeting-name-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
415 <xslo:if test="position() &gt; 1">
416 <xslo:choose>
417 <xslo:when test="contains('vxyz', @code)">
418 <xslo:text>--</xslo:text>
419 </xslo:when>
420 <xslo:otherwise>
421 <xslo:value-of select="substring(' ', 1, 1)"/>
422 </xslo:otherwise>
423 </xslo:choose>
424 </xslo:if>
425 <xslo:value-of select="."/>
426 </xslo:if>
427 </xslo:for-each>
428 </xslo:variable>
429 <xslo:value-of select="normalize-space($raw_heading)"/>
430 </z:index>
431 </xslo:template>
432 <xslo:template mode="index_heading" match="marc:datafield[@tag='130']">
433 <z:index name="Title-uniform-heading:w Title-uniform-heading:p Title-uniform-heading:s Heading:w Heading:p Heading:s">
434 <xslo:variable name="raw_heading">
435 <xslo:for-each select="marc:subfield">
436 <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Title-uniform-heading:w Title-uniform-heading:p Title-uniform-heading:s Heading:w Heading:p Heading:s">
437 <xslo:if test="position() &gt; 1">
438 <xslo:choose>
439 <xslo:when test="contains('vxyz', @code)">
440 <xslo:text>--</xslo:text>
441 </xslo:when>
442 <xslo:otherwise>
443 <xslo:value-of select="substring(' ', 1, 1)"/>
444 </xslo:otherwise>
445 </xslo:choose>
446 </xslo:if>
447 <xslo:value-of select="."/>
448 </xslo:if>
449 </xslo:for-each>
450 </xslo:variable>
451 <xslo:value-of select="normalize-space($raw_heading)"/>
452 </z:index>
453 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
454 <xslo:variable name="raw_heading">
455 <xslo:for-each select="marc:subfield">
456 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
457 <xslo:if test="position() &gt; 1">
458 <xslo:choose>
459 <xslo:when test="contains('', @code)">
460 <xslo:text>--</xslo:text>
461 </xslo:when>
462 <xslo:otherwise>
463 <xslo:value-of select="substring(' ', 1, 1)"/>
464 </xslo:otherwise>
465 </xslo:choose>
466 </xslo:if>
467 <xslo:value-of select="."/>
468 </xslo:if>
469 </xslo:for-each>
470 </xslo:variable>
471 <xslo:value-of select="normalize-space($raw_heading)"/>
472 </z:index>
473 </xslo:template>
474 <xslo:template mode="index_heading" match="marc:datafield[@tag='430']">
475 <z:index name="Title-uniform-see-from:w Title-uniform-see-from:p Title-uniform-see-from:s See-from:w See-from:p See-from:s">
476 <xslo:variable name="raw_heading">
477 <xslo:for-each select="marc:subfield">
478 <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Title-uniform-see-from:w Title-uniform-see-from:p Title-uniform-see-from:s See-from:w See-from:p See-from:s">
479 <xslo:if test="position() &gt; 1">
480 <xslo:choose>
481 <xslo:when test="contains('vxyz', @code)">
482 <xslo:text>--</xslo:text>
483 </xslo:when>
484 <xslo:otherwise>
485 <xslo:value-of select="substring(' ', 1, 1)"/>
486 </xslo:otherwise>
487 </xslo:choose>
488 </xslo:if>
489 <xslo:value-of select="."/>
490 </xslo:if>
491 </xslo:for-each>
492 </xslo:variable>
493 <xslo:value-of select="normalize-space($raw_heading)"/>
494 </z:index>
495 </xslo:template>
496 <xslo:template mode="index_heading" match="marc:datafield[@tag='530']">
497 <z:index name="Title-uniform-see-also-from:w Title-uniform-see-also-from:p Title-uniform-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
498 <xslo:variable name="raw_heading">
499 <xslo:for-each select="marc:subfield">
500 <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Title-uniform-see-also-from:w Title-uniform-see-also-from:p Title-uniform-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
501 <xslo:if test="position() &gt; 1">
502 <xslo:choose>
503 <xslo:when test="contains('vxyz', @code)">
504 <xslo:text>--</xslo:text>
505 </xslo:when>
506 <xslo:otherwise>
507 <xslo:value-of select="substring(' ', 1, 1)"/>
508 </xslo:otherwise>
509 </xslo:choose>
510 </xslo:if>
511 <xslo:value-of select="."/>
512 </xslo:if>
513 </xslo:for-each>
514 </xslo:variable>
515 <xslo:value-of select="normalize-space($raw_heading)"/>
516 </z:index>
517 </xslo:template>
518 <xslo:template mode="index_heading" match="marc:datafield[@tag='148']">
519 <z:index name="Chronological-term-heading:w Chronological-term-heading:p Chronological-term-heading:s Heading:w Heading:p Heading:s">
520 <xslo:variable name="raw_heading">
521 <xslo:for-each select="marc:subfield">
522 <xslo:if test="contains('avxyz', @code)" name="Chronological-term-heading:w Chronological-term-heading:p Chronological-term-heading:s Heading:w Heading:p Heading:s">
523 <xslo:if test="position() &gt; 1">
524 <xslo:choose>
525 <xslo:when test="contains('vxyz', @code)">
526 <xslo:text>--</xslo:text>
527 </xslo:when>
528 <xslo:otherwise>
529 <xslo:value-of select="substring(' ', 1, 1)"/>
530 </xslo:otherwise>
531 </xslo:choose>
532 </xslo:if>
533 <xslo:value-of select="."/>
534 </xslo:if>
535 </xslo:for-each>
536 </xslo:variable>
537 <xslo:value-of select="normalize-space($raw_heading)"/>
538 </z:index>
539 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
540 <xslo:variable name="raw_heading">
541 <xslo:for-each select="marc:subfield">
542 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
543 <xslo:if test="position() &gt; 1">
544 <xslo:choose>
545 <xslo:when test="contains('', @code)">
546 <xslo:text>--</xslo:text>
547 </xslo:when>
548 <xslo:otherwise>
549 <xslo:value-of select="substring(' ', 1, 1)"/>
550 </xslo:otherwise>
551 </xslo:choose>
552 </xslo:if>
553 <xslo:value-of select="."/>
554 </xslo:if>
555 </xslo:for-each>
556 </xslo:variable>
557 <xslo:value-of select="normalize-space($raw_heading)"/>
558 </z:index>
559 </xslo:template>
560 <xslo:template mode="index_heading" match="marc:datafield[@tag='448']">
561 <z:index name="Chronological-term-see-from:w Chronological-term-see-from:p Chronological-term-see-from:s See-from:w See-from:p See-from:s">
562 <xslo:variable name="raw_heading">
563 <xslo:for-each select="marc:subfield">
564 <xslo:if test="contains('avxyz', @code)" name="Chronological-term-see-from:w Chronological-term-see-from:p Chronological-term-see-from:s See-from:w See-from:p See-from:s">
565 <xslo:if test="position() &gt; 1">
566 <xslo:choose>
567 <xslo:when test="contains('vxyz', @code)">
568 <xslo:text>--</xslo:text>
569 </xslo:when>
570 <xslo:otherwise>
571 <xslo:value-of select="substring(' ', 1, 1)"/>
572 </xslo:otherwise>
573 </xslo:choose>
574 </xslo:if>
575 <xslo:value-of select="."/>
576 </xslo:if>
577 </xslo:for-each>
578 </xslo:variable>
579 <xslo:value-of select="normalize-space($raw_heading)"/>
580 </z:index>
581 </xslo:template>
582 <xslo:template mode="index_heading" match="marc:datafield[@tag='548']">
583 <z:index name="Chronological-term-see-also-from:w Chronological-term-see-also-from:p Chronological-term-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
584 <xslo:variable name="raw_heading">
585 <xslo:for-each select="marc:subfield">
586 <xslo:if test="contains('avxyz', @code)" name="Chronological-term-see-also-from:w Chronological-term-see-also-from:p Chronological-term-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
587 <xslo:if test="position() &gt; 1">
588 <xslo:choose>
589 <xslo:when test="contains('vxyz', @code)">
590 <xslo:text>--</xslo:text>
591 </xslo:when>
592 <xslo:otherwise>
593 <xslo:value-of select="substring(' ', 1, 1)"/>
594 </xslo:otherwise>
595 </xslo:choose>
596 </xslo:if>
597 <xslo:value-of select="."/>
598 </xslo:if>
599 </xslo:for-each>
600 </xslo:variable>
601 <xslo:value-of select="normalize-space($raw_heading)"/>
602 </z:index>
603 </xslo:template>
604 <xslo:template mode="index_heading" match="marc:datafield[@tag='150']">
605 <z:index name="Subject-topical-heading:w Subject-topical-heading:p Subject-topical-heading:s Heading:w Heading:p Heading:s">
606 <xslo:variable name="raw_heading">
607 <xslo:for-each select="marc:subfield">
608 <xslo:if test="contains('abvxyz', @code)" name="Subject-topical-heading:w Subject-topical-heading:p Subject-topical-heading:s Heading:w Heading:p Heading:s">
609 <xslo:if test="position() &gt; 1">
610 <xslo:choose>
611 <xslo:when test="contains('vxyz', @code)">
612 <xslo:text>--</xslo:text>
613 </xslo:when>
614 <xslo:otherwise>
615 <xslo:value-of select="substring(' ', 1, 1)"/>
616 </xslo:otherwise>
617 </xslo:choose>
618 </xslo:if>
619 <xslo:value-of select="."/>
620 </xslo:if>
621 </xslo:for-each>
622 </xslo:variable>
623 <xslo:value-of select="normalize-space($raw_heading)"/>
624 </z:index>
625 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
626 <xslo:variable name="raw_heading">
627 <xslo:for-each select="marc:subfield">
628 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
629 <xslo:if test="position() &gt; 1">
630 <xslo:choose>
631 <xslo:when test="contains('', @code)">
632 <xslo:text>--</xslo:text>
633 </xslo:when>
634 <xslo:otherwise>
635 <xslo:value-of select="substring(' ', 1, 1)"/>
636 </xslo:otherwise>
637 </xslo:choose>
638 </xslo:if>
639 <xslo:value-of select="."/>
640 </xslo:if>
641 </xslo:for-each>
642 </xslo:variable>
643 <xslo:value-of select="normalize-space($raw_heading)"/>
644 </z:index>
645 </xslo:template>
646 <xslo:template mode="index_heading" match="marc:datafield[@tag='450']">
647 <z:index name="Subject-topical-see-from:w Subject-topical-see-from:p Subject-topical-see-from:s See-from:w See-from:p See-from:s">
648 <xslo:variable name="raw_heading">
649 <xslo:for-each select="marc:subfield">
650 <xslo:if test="contains('abvxyz', @code)" name="Subject-topical-see-from:w Subject-topical-see-from:p Subject-topical-see-from:s See-from:w See-from:p See-from:s">
651 <xslo:if test="position() &gt; 1">
652 <xslo:choose>
653 <xslo:when test="contains('vxyz', @code)">
654 <xslo:text>--</xslo:text>
655 </xslo:when>
656 <xslo:otherwise>
657 <xslo:value-of select="substring(' ', 1, 1)"/>
658 </xslo:otherwise>
659 </xslo:choose>
660 </xslo:if>
661 <xslo:value-of select="."/>
662 </xslo:if>
663 </xslo:for-each>
664 </xslo:variable>
665 <xslo:value-of select="normalize-space($raw_heading)"/>
666 </z:index>
667 </xslo:template>
668 <xslo:template mode="index_heading" match="marc:datafield[@tag='550']">
669 <z:index name="Subject-topical-see-also-from:w Subject-topical-see-also-from:p Subject-topical-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
670 <xslo:variable name="raw_heading">
671 <xslo:for-each select="marc:subfield">
672 <xslo:if test="contains('abvxyz', @code)" name="Subject-topical-see-also-from:w Subject-topical-see-also-from:p Subject-topical-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
673 <xslo:if test="position() &gt; 1">
674 <xslo:choose>
675 <xslo:when test="contains('vxyz', @code)">
676 <xslo:text>--</xslo:text>
677 </xslo:when>
678 <xslo:otherwise>
679 <xslo:value-of select="substring(' ', 1, 1)"/>
680 </xslo:otherwise>
681 </xslo:choose>
682 </xslo:if>
683 <xslo:value-of select="."/>
684 </xslo:if>
685 </xslo:for-each>
686 </xslo:variable>
687 <xslo:value-of select="normalize-space($raw_heading)"/>
688 </z:index>
689 </xslo:template>
690 <xslo:template mode="index_heading" match="marc:datafield[@tag='151']">
691 <z:index name="Name-geographic-heading:w Name-geographic-heading:p Name-geographic-heading:s Heading:w Heading:p Heading:s">
692 <xslo:variable name="raw_heading">
693 <xslo:for-each select="marc:subfield">
694 <xslo:if test="contains('avxyz', @code)" name="Name-geographic-heading:w Name-geographic-heading:p Name-geographic-heading:s Heading:w Heading:p Heading:s">
695 <xslo:if test="position() &gt; 1">
696 <xslo:choose>
697 <xslo:when test="contains('vxyz', @code)">
698 <xslo:text>--</xslo:text>
699 </xslo:when>
700 <xslo:otherwise>
701 <xslo:value-of select="substring(' ', 1, 1)"/>
702 </xslo:otherwise>
703 </xslo:choose>
704 </xslo:if>
705 <xslo:value-of select="."/>
706 </xslo:if>
707 </xslo:for-each>
708 </xslo:variable>
709 <xslo:value-of select="normalize-space($raw_heading)"/>
710 </z:index>
711 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
712 <xslo:variable name="raw_heading">
713 <xslo:for-each select="marc:subfield">
714 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
715 <xslo:if test="position() &gt; 1">
716 <xslo:choose>
717 <xslo:when test="contains('', @code)">
718 <xslo:text>--</xslo:text>
719 </xslo:when>
720 <xslo:otherwise>
721 <xslo:value-of select="substring(' ', 1, 1)"/>
722 </xslo:otherwise>
723 </xslo:choose>
724 </xslo:if>
725 <xslo:value-of select="."/>
726 </xslo:if>
727 </xslo:for-each>
728 </xslo:variable>
729 <xslo:value-of select="normalize-space($raw_heading)"/>
730 </z:index>
731 </xslo:template>
732 <xslo:template mode="index_heading" match="marc:datafield[@tag='451']">
733 <z:index name="Name-geographic-see-from:w Name-geographic-see-from:p Name-geographic-see-from:s See-from:w See-from:p See-from:s">
734 <xslo:variable name="raw_heading">
735 <xslo:for-each select="marc:subfield">
736 <xslo:if test="contains('avxyz', @code)" name="Name-geographic-see-from:w Name-geographic-see-from:p Name-geographic-see-from:s See-from:w See-from:p See-from:s">
737 <xslo:if test="position() &gt; 1">
738 <xslo:choose>
739 <xslo:when test="contains('vxyz', @code)">
740 <xslo:text>--</xslo:text>
741 </xslo:when>
742 <xslo:otherwise>
743 <xslo:value-of select="substring(' ', 1, 1)"/>
744 </xslo:otherwise>
745 </xslo:choose>
746 </xslo:if>
747 <xslo:value-of select="."/>
748 </xslo:if>
749 </xslo:for-each>
750 </xslo:variable>
751 <xslo:value-of select="normalize-space($raw_heading)"/>
752 </z:index>
753 </xslo:template>
754 <xslo:template mode="index_heading" match="marc:datafield[@tag='551']">
755 <z:index name="Name-geographic-see-also-from:w Name-geographic-see-also-from:p Name-geographic-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
756 <xslo:variable name="raw_heading">
757 <xslo:for-each select="marc:subfield">
758 <xslo:if test="contains('avxyz', @code)" name="Name-geographic-see-also-from:w Name-geographic-see-also-from:p Name-geographic-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
759 <xslo:if test="position() &gt; 1">
760 <xslo:choose>
761 <xslo:when test="contains('vxyz', @code)">
762 <xslo:text>--</xslo:text>
763 </xslo:when>
764 <xslo:otherwise>
765 <xslo:value-of select="substring(' ', 1, 1)"/>
766 </xslo:otherwise>
767 </xslo:choose>
768 </xslo:if>
769 <xslo:value-of select="."/>
770 </xslo:if>
771 </xslo:for-each>
772 </xslo:variable>
773 <xslo:value-of select="normalize-space($raw_heading)"/>
774 </z:index>
775 </xslo:template>
776 <xslo:template mode="index_heading" match="marc:datafield[@tag='155']">
777 <z:index name="Term-genre-form-heading:w Term-genre-form-heading:p Term-genre-form-heading:s Heading:w Heading:p Heading:s">
778 <xslo:variable name="raw_heading">
779 <xslo:for-each select="marc:subfield">
780 <xslo:if test="contains('avxyz', @code)" name="Term-genre-form-heading:w Term-genre-form-heading:p Term-genre-form-heading:s Heading:w Heading:p Heading:s">
781 <xslo:if test="position() &gt; 1">
782 <xslo:choose>
783 <xslo:when test="contains('vxyz', @code)">
784 <xslo:text>--</xslo:text>
785 </xslo:when>
786 <xslo:otherwise>
787 <xslo:value-of select="substring(' ', 1, 1)"/>
788 </xslo:otherwise>
789 </xslo:choose>
790 </xslo:if>
791 <xslo:value-of select="."/>
792 </xslo:if>
793 </xslo:for-each>
794 </xslo:variable>
795 <xslo:value-of select="normalize-space($raw_heading)"/>
796 </z:index>
797 <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s">
798 <xslo:variable name="raw_heading">
799 <xslo:for-each select="marc:subfield">
800 <xslo:if test="contains('a', @code)" name="Heading-Main:w Heading-Main:p Heading-Main:s">
801 <xslo:if test="position() &gt; 1">
802 <xslo:choose>
803 <xslo:when test="contains('', @code)">
804 <xslo:text>--</xslo:text>
805 </xslo:when>
806 <xslo:otherwise>
807 <xslo:value-of select="substring(' ', 1, 1)"/>
808 </xslo:otherwise>
809 </xslo:choose>
810 </xslo:if>
811 <xslo:value-of select="."/>
812 </xslo:if>
813 </xslo:for-each>
814 </xslo:variable>
815 <xslo:value-of select="normalize-space($raw_heading)"/>
816 </z:index>
817 </xslo:template>
818 <xslo:template mode="index_heading" match="marc:datafield[@tag='455']">
819 <z:index name="Term-genre-form-see-from:w Term-genre-form-see-from:p Term-genre-form-see-from:s See-from:w See-from:p See-from:s">
820 <xslo:variable name="raw_heading">
821 <xslo:for-each select="marc:subfield">
822 <xslo:if test="contains('avxyz', @code)" name="Term-genre-form-see-from:w Term-genre-form-see-from:p Term-genre-form-see-from:s See-from:w See-from:p See-from:s">
823 <xslo:if test="position() &gt; 1">
824 <xslo:choose>
825 <xslo:when test="contains('vxyz', @code)">
826 <xslo:text>--</xslo:text>
827 </xslo:when>
828 <xslo:otherwise>
829 <xslo:value-of select="substring(' ', 1, 1)"/>
830 </xslo:otherwise>
831 </xslo:choose>
832 </xslo:if>
833 <xslo:value-of select="."/>
834 </xslo:if>
835 </xslo:for-each>
836 </xslo:variable>
837 <xslo:value-of select="normalize-space($raw_heading)"/>
838 </z:index>
839 </xslo:template>
840 <xslo:template mode="index_heading" match="marc:datafield[@tag='555']">
841 <z:index name="Term-genre-form-see-also-from:w Term-genre-form-see-also-from:p Term-genre-form-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
842 <xslo:variable name="raw_heading">
843 <xslo:for-each select="marc:subfield">
844 <xslo:if test="contains('avxyz', @code)" name="Term-genre-form-see-also-from:w Term-genre-form-see-also-from:p Term-genre-form-see-also-from:s See-also-from:w See-also-from:p See-also-from:s">
845 <xslo:if test="position() &gt; 1">
846 <xslo:choose>
847 <xslo:when test="contains('vxyz', @code)">
848 <xslo:text>--</xslo:text>
849 </xslo:when>
850 <xslo:otherwise>
851 <xslo:value-of select="substring(' ', 1, 1)"/>
852 </xslo:otherwise>
853 </xslo:choose>
854 </xslo:if>
855 <xslo:value-of select="."/>
856 </xslo:if>
857 </xslo:for-each>
858 </xslo:variable>
859 <xslo:value-of select="normalize-space($raw_heading)"/>
860 </z:index>
861 </xslo:template>
862 <xslo:template mode="index_heading" match="marc:datafield[@tag='180']">
863 <z:index name="General-subdivision:w General-subdivision:p General-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
864 <xslo:variable name="raw_heading">
865 <xslo:for-each select="marc:subfield">
866 <xslo:if test="contains('vxyz', @code)" name="General-subdivision:w General-subdivision:p General-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
867 <xslo:if test="position() &gt; 1">
868 <xslo:choose>
869 <xslo:when test="contains('vxyz', @code)">
870 <xslo:text>--</xslo:text>
871 </xslo:when>
872 <xslo:otherwise>
873 <xslo:value-of select="substring(' ', 1, 1)"/>
874 </xslo:otherwise>
875 </xslo:choose>
876 </xslo:if>
877 <xslo:value-of select="."/>
878 </xslo:if>
879 </xslo:for-each>
880 </xslo:variable>
881 <xslo:value-of select="normalize-space($raw_heading)"/>
882 </z:index>
883 </xslo:template>
884 <xslo:template mode="index_heading" match="marc:datafield[@tag='480']">
885 <z:index name="General-subdivision-see-from:w General-subdivision-see-from:p General-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
886 <xslo:variable name="raw_heading">
887 <xslo:for-each select="marc:subfield">
888 <xslo:if test="contains('vxyz', @code)" name="General-subdivision-see-from:w General-subdivision-see-from:p General-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
889 <xslo:if test="position() &gt; 1">
890 <xslo:choose>
891 <xslo:when test="contains('vxyz', @code)">
892 <xslo:text>--</xslo:text>
893 </xslo:when>
894 <xslo:otherwise>
895 <xslo:value-of select="substring(' ', 1, 1)"/>
896 </xslo:otherwise>
897 </xslo:choose>
898 </xslo:if>
899 <xslo:value-of select="."/>
900 </xslo:if>
901 </xslo:for-each>
902 </xslo:variable>
903 <xslo:value-of select="normalize-space($raw_heading)"/>
904 </z:index>
905 </xslo:template>
906 <xslo:template mode="index_heading" match="marc:datafield[@tag='580']">
907 <z:index name="General-subdivision-see-also-from:w General-subdivision-see-also-from:p General-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
908 <xslo:variable name="raw_heading">
909 <xslo:for-each select="marc:subfield">
910 <xslo:if test="contains('vxyz', @code)" name="General-subdivision-see-also-from:w General-subdivision-see-also-from:p General-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
911 <xslo:if test="position() &gt; 1">
912 <xslo:choose>
913 <xslo:when test="contains('vxyz', @code)">
914 <xslo:text>--</xslo:text>
915 </xslo:when>
916 <xslo:otherwise>
917 <xslo:value-of select="substring(' ', 1, 1)"/>
918 </xslo:otherwise>
919 </xslo:choose>
920 </xslo:if>
921 <xslo:value-of select="."/>
922 </xslo:if>
923 </xslo:for-each>
924 </xslo:variable>
925 <xslo:value-of select="normalize-space($raw_heading)"/>
926 </z:index>
927 </xslo:template>
928 <xslo:template mode="index_heading" match="marc:datafield[@tag='181']">
929 <z:index name="Geographic-subdivision:w Geographic-subdivision:p Geographic-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
930 <xslo:variable name="raw_heading">
931 <xslo:for-each select="marc:subfield">
932 <xslo:if test="contains('vxyz', @code)" name="Geographic-subdivision:w Geographic-subdivision:p Geographic-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
933 <xslo:if test="position() &gt; 1">
934 <xslo:choose>
935 <xslo:when test="contains('vxyz', @code)">
936 <xslo:text>--</xslo:text>
937 </xslo:when>
938 <xslo:otherwise>
939 <xslo:value-of select="substring(' ', 1, 1)"/>
940 </xslo:otherwise>
941 </xslo:choose>
942 </xslo:if>
943 <xslo:value-of select="."/>
944 </xslo:if>
945 </xslo:for-each>
946 </xslo:variable>
947 <xslo:value-of select="normalize-space($raw_heading)"/>
948 </z:index>
949 </xslo:template>
950 <xslo:template mode="index_heading" match="marc:datafield[@tag='481']">
951 <z:index name="Geographic-subdivision-see-from:w Geographic-subdivision-see-from:p Geographic-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
952 <xslo:variable name="raw_heading">
953 <xslo:for-each select="marc:subfield">
954 <xslo:if test="contains('vxyz', @code)" name="Geographic-subdivision-see-from:w Geographic-subdivision-see-from:p Geographic-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
955 <xslo:if test="position() &gt; 1">
956 <xslo:choose>
957 <xslo:when test="contains('vxyz', @code)">
958 <xslo:text>--</xslo:text>
959 </xslo:when>
960 <xslo:otherwise>
961 <xslo:value-of select="substring(' ', 1, 1)"/>
962 </xslo:otherwise>
963 </xslo:choose>
964 </xslo:if>
965 <xslo:value-of select="."/>
966 </xslo:if>
967 </xslo:for-each>
968 </xslo:variable>
969 <xslo:value-of select="normalize-space($raw_heading)"/>
970 </z:index>
971 </xslo:template>
972 <xslo:template mode="index_heading" match="marc:datafield[@tag='581']">
973 <z:index name="Geographic-subdivision-see-also-from:w Geographic-subdivision-see-also-from:p Geographic-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
974 <xslo:variable name="raw_heading">
975 <xslo:for-each select="marc:subfield">
976 <xslo:if test="contains('vxyz', @code)" name="Geographic-subdivision-see-also-from:w Geographic-subdivision-see-also-from:p Geographic-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
977 <xslo:if test="position() &gt; 1">
978 <xslo:choose>
979 <xslo:when test="contains('vxyz', @code)">
980 <xslo:text>--</xslo:text>
981 </xslo:when>
982 <xslo:otherwise>
983 <xslo:value-of select="substring(' ', 1, 1)"/>
984 </xslo:otherwise>
985 </xslo:choose>
986 </xslo:if>
987 <xslo:value-of select="."/>
988 </xslo:if>
989 </xslo:for-each>
990 </xslo:variable>
991 <xslo:value-of select="normalize-space($raw_heading)"/>
992 </z:index>
993 </xslo:template>
994 <xslo:template mode="index_heading" match="marc:datafield[@tag='182']">
995 <z:index name="Chronological-subdivision:w Chronological-subdivision:p Chronological-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
996 <xslo:variable name="raw_heading">
997 <xslo:for-each select="marc:subfield">
998 <xslo:if test="contains('vxyz', @code)" name="Chronological-subdivision:w Chronological-subdivision:p Chronological-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
999 <xslo:if test="position() &gt; 1">
1000 <xslo:choose>
1001 <xslo:when test="contains('vxyz', @code)">
1002 <xslo:text>--</xslo:text>
1003 </xslo:when>
1004 <xslo:otherwise>
1005 <xslo:value-of select="substring(' ', 1, 1)"/>
1006 </xslo:otherwise>
1007 </xslo:choose>
1008 </xslo:if>
1009 <xslo:value-of select="."/>
1010 </xslo:if>
1011 </xslo:for-each>
1012 </xslo:variable>
1013 <xslo:value-of select="normalize-space($raw_heading)"/>
1014 </z:index>
1015 </xslo:template>
1016 <xslo:template mode="index_heading" match="marc:datafield[@tag='482']">
1017 <z:index name="Chronological-subdivision-see-from:w Chronological-subdivision-see-from:p Chronological-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
1018 <xslo:variable name="raw_heading">
1019 <xslo:for-each select="marc:subfield">
1020 <xslo:if test="contains('vxyz', @code)" name="Chronological-subdivision-see-from:w Chronological-subdivision-see-from:p Chronological-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
1021 <xslo:if test="position() &gt; 1">
1022 <xslo:choose>
1023 <xslo:when test="contains('vxyz', @code)">
1024 <xslo:text>--</xslo:text>
1025 </xslo:when>
1026 <xslo:otherwise>
1027 <xslo:value-of select="substring(' ', 1, 1)"/>
1028 </xslo:otherwise>
1029 </xslo:choose>
1030 </xslo:if>
1031 <xslo:value-of select="."/>
1032 </xslo:if>
1033 </xslo:for-each>
1034 </xslo:variable>
1035 <xslo:value-of select="normalize-space($raw_heading)"/>
1036 </z:index>
1037 </xslo:template>
1038 <xslo:template mode="index_heading" match="marc:datafield[@tag='582']">
1039 <z:index name="Chronological-subdivision-see-also-from:w Chronological-subdivision-see-also-from:p Chronological-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
1040 <xslo:variable name="raw_heading">
1041 <xslo:for-each select="marc:subfield">
1042 <xslo:if test="contains('vxyz', @code)" name="Chronological-subdivision-see-also-from:w Chronological-subdivision-see-also-from:p Chronological-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
1043 <xslo:if test="position() &gt; 1">
1044 <xslo:choose>
1045 <xslo:when test="contains('vxyz', @code)">
1046 <xslo:text>--</xslo:text>
1047 </xslo:when>
1048 <xslo:otherwise>
1049 <xslo:value-of select="substring(' ', 1, 1)"/>
1050 </xslo:otherwise>
1051 </xslo:choose>
1052 </xslo:if>
1053 <xslo:value-of select="."/>
1054 </xslo:if>
1055 </xslo:for-each>
1056 </xslo:variable>
1057 <xslo:value-of select="normalize-space($raw_heading)"/>
1058 </z:index>
1059 </xslo:template>
1060 <xslo:template mode="index_heading" match="marc:datafield[@tag='185']">
1061 <z:index name="Form-subdivision:w Form-subdivision:p Form-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
1062 <xslo:variable name="raw_heading">
1063 <xslo:for-each select="marc:subfield">
1064 <xslo:if test="contains('vxyz', @code)" name="Form-subdivision:w Form-subdivision:p Form-subdivision:s Subdivision:w Subdivision:p Subdivision:s">
1065 <xslo:if test="position() &gt; 1">
1066 <xslo:choose>
1067 <xslo:when test="contains('vxyz', @code)">
1068 <xslo:text>--</xslo:text>
1069 </xslo:when>
1070 <xslo:otherwise>
1071 <xslo:value-of select="substring(' ', 1, 1)"/>
1072 </xslo:otherwise>
1073 </xslo:choose>
1074 </xslo:if>
1075 <xslo:value-of select="."/>
1076 </xslo:if>
1077 </xslo:for-each>
1078 </xslo:variable>
1079 <xslo:value-of select="normalize-space($raw_heading)"/>
1080 </z:index>
1081 </xslo:template>
1082 <xslo:template mode="index_heading" match="marc:datafield[@tag='485']">
1083 <z:index name="Form-subdivision-see-from:w Form-subdivision-see-from:p Form-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
1084 <xslo:variable name="raw_heading">
1085 <xslo:for-each select="marc:subfield">
1086 <xslo:if test="contains('vxyz', @code)" name="Form-subdivision-see-from:w Form-subdivision-see-from:p Form-subdivision-see-from:s Subdivision-see-from:w Subdivision-see-from:p Subdivision-see-from:s">
1087 <xslo:if test="position() &gt; 1">
1088 <xslo:choose>
1089 <xslo:when test="contains('vxyz', @code)">
1090 <xslo:text>--</xslo:text>
1091 </xslo:when>
1092 <xslo:otherwise>
1093 <xslo:value-of select="substring(' ', 1, 1)"/>
1094 </xslo:otherwise>
1095 </xslo:choose>
1096 </xslo:if>
1097 <xslo:value-of select="."/>
1098 </xslo:if>
1099 </xslo:for-each>
1100 </xslo:variable>
1101 <xslo:value-of select="normalize-space($raw_heading)"/>
1102 </z:index>
1103 </xslo:template>
1104 <xslo:template mode="index_heading" match="marc:datafield[@tag='585']">
1105 <z:index name="Form-subdivision-see-also-from:w Form-subdivision-see-also-from:p Form-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
1106 <xslo:variable name="raw_heading">
1107 <xslo:for-each select="marc:subfield">
1108 <xslo:if test="contains('vxyz', @code)" name="Form-subdivision-see-also-from:w Form-subdivision-see-also-from:p Form-subdivision-see-also-from:s Subdivision-see-also-from:w Subdivision-see-also-from:p Subdivision-see-also-from:s">
1109 <xslo:if test="position() &gt; 1">
1110 <xslo:choose>
1111 <xslo:when test="contains('vxyz', @code)">
1112 <xslo:text>--</xslo:text>
1113 </xslo:when>
1114 <xslo:otherwise>
1115 <xslo:value-of select="substring(' ', 1, 1)"/>
1116 </xslo:otherwise>
1117 </xslo:choose>
1118 </xslo:if>
1119 <xslo:value-of select="."/>
1120 </xslo:if>
1121 </xslo:for-each>
1122 </xslo:variable>
1123 <xslo:value-of select="normalize-space($raw_heading)"/>
1124 </z:index>
1125 </xslo:template>
1126 <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
1127 <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)">
1128 <z:index name="Previous-heading-see-from:p">
1129 <xslo:variable name="raw_heading">
1130 <xslo:for-each select="marc:subfield">
1131 <xslo:if test="contains('abvxyz', @code)" name="Previous-heading-see-from:p">
1132 <xslo:if test="position() &gt; 1">
1133 <xslo:choose>
1134 <xslo:when test="contains('vxyz', @code)">
1135 <xslo:text>--</xslo:text>
1136 </xslo:when>
1137 <xslo:otherwise>
1138 <xslo:value-of select="substring(' ', 1, 1)"/>
1139 </xslo:otherwise>
1140 </xslo:choose>
1141 </xslo:if>
1142 <xslo:value-of select="."/>
1143 </xslo:if>
1144 </xslo:for-each>
1145 </xslo:variable>
1146 <xslo:value-of select="normalize-space($raw_heading)"/>
1147 </z:index>
1148 </xslo:if>
1149 </xslo:template>
1150 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
1151 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1152 <xslo:variable name="raw_heading">
1153 <xslo:for-each select="marc:subfield">
1154 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1155 <xslo:if test="position() &gt; 1">
1156 <xslo:choose>
1157 <xslo:when test="contains('vxyz', @code)">
1158 <xslo:choose>
1159 <xslo:when test="@code = $general_subdivision_subfield">
1160 <xslo:text> generalsubdiv </xslo:text>
1161 </xslo:when>
1162 <xslo:when test="@code = $form_subdivision_subfield">
1163 <xslo:text> formsubdiv </xslo:text>
1164 </xslo:when>
1165 <xslo:when test="@code = $chronological_subdivision_subfield">
1166 <xslo:text> chronologicalsubdiv </xslo:text>
1167 </xslo:when>
1168 <xslo:when test="@code = $geographic_subdivision_subfield">
1169 <xslo:text> geographicsubdiv </xslo:text>
1170 </xslo:when>
1171 </xslo:choose>
1172 </xslo:when>
1173 <xslo:otherwise>
1174 <xslo:value-of select="substring(' ', 1, 1)"/>
1175 </xslo:otherwise>
1176 </xslo:choose>
1177 </xslo:if>
1178 <xslo:call-template name="chopPunctuation">
1179 <xslo:with-param name="chopString">
1180 <xslo:value-of select="."/>
1181 </xslo:with-param>
1182 </xslo:call-template>
1183 </xslo:if>
1184 </xslo:for-each>
1185 </xslo:variable>
1186 <xslo:value-of select="normalize-space($raw_heading)"/>
1187 </z:index>
1188 </xslo:template>
1189 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='400']">
1190 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1191 <xslo:variable name="raw_heading">
1192 <xslo:for-each select="marc:subfield">
1193 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1194 <xslo:if test="position() &gt; 1">
1195 <xslo:choose>
1196 <xslo:when test="contains('vxyz', @code)">
1197 <xslo:choose>
1198 <xslo:when test="@code = $general_subdivision_subfield">
1199 <xslo:text> generalsubdiv </xslo:text>
1200 </xslo:when>
1201 <xslo:when test="@code = $form_subdivision_subfield">
1202 <xslo:text> formsubdiv </xslo:text>
1203 </xslo:when>
1204 <xslo:when test="@code = $chronological_subdivision_subfield">
1205 <xslo:text> chronologicalsubdiv </xslo:text>
1206 </xslo:when>
1207 <xslo:when test="@code = $geographic_subdivision_subfield">
1208 <xslo:text> geographicsubdiv </xslo:text>
1209 </xslo:when>
1210 </xslo:choose>
1211 </xslo:when>
1212 <xslo:otherwise>
1213 <xslo:value-of select="substring(' ', 1, 1)"/>
1214 </xslo:otherwise>
1215 </xslo:choose>
1216 </xslo:if>
1217 <xslo:call-template name="chopPunctuation">
1218 <xslo:with-param name="chopString">
1219 <xslo:value-of select="."/>
1220 </xslo:with-param>
1221 </xslo:call-template>
1222 </xslo:if>
1223 </xslo:for-each>
1224 </xslo:variable>
1225 <xslo:value-of select="normalize-space($raw_heading)"/>
1226 </z:index>
1227 </xslo:template>
1228 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='500']">
1229 <z:index name="Match:w Match:p">
1230 <xslo:variable name="raw_heading">
1231 <xslo:for-each select="marc:subfield">
1232 <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Match:w Match:p">
1233 <xslo:if test="position() &gt; 1">
1234 <xslo:choose>
1235 <xslo:when test="contains('vxyz', @code)">
1236 <xslo:choose>
1237 <xslo:when test="@code = $general_subdivision_subfield">
1238 <xslo:text> generalsubdiv </xslo:text>
1239 </xslo:when>
1240 <xslo:when test="@code = $form_subdivision_subfield">
1241 <xslo:text> formsubdiv </xslo:text>
1242 </xslo:when>
1243 <xslo:when test="@code = $chronological_subdivision_subfield">
1244 <xslo:text> chronologicalsubdiv </xslo:text>
1245 </xslo:when>
1246 <xslo:when test="@code = $geographic_subdivision_subfield">
1247 <xslo:text> geographicsubdiv </xslo:text>
1248 </xslo:when>
1249 </xslo:choose>
1250 </xslo:when>
1251 <xslo:otherwise>
1252 <xslo:value-of select="substring(' ', 1, 1)"/>
1253 </xslo:otherwise>
1254 </xslo:choose>
1255 </xslo:if>
1256 <xslo:call-template name="chopPunctuation">
1257 <xslo:with-param name="chopString">
1258 <xslo:value-of select="."/>
1259 </xslo:with-param>
1260 </xslo:call-template>
1261 </xslo:if>
1262 </xslo:for-each>
1263 </xslo:variable>
1264 <xslo:value-of select="normalize-space($raw_heading)"/>
1265 </z:index>
1266 </xslo:template>
1267 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='110']">
1268 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1269 <xslo:variable name="raw_heading">
1270 <xslo:for-each select="marc:subfield">
1271 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1272 <xslo:if test="position() &gt; 1">
1273 <xslo:choose>
1274 <xslo:when test="contains('vxyz', @code)">
1275 <xslo:choose>
1276 <xslo:when test="@code = $general_subdivision_subfield">
1277 <xslo:text> generalsubdiv </xslo:text>
1278 </xslo:when>
1279 <xslo:when test="@code = $form_subdivision_subfield">
1280 <xslo:text> formsubdiv </xslo:text>
1281 </xslo:when>
1282 <xslo:when test="@code = $chronological_subdivision_subfield">
1283 <xslo:text> chronologicalsubdiv </xslo:text>
1284 </xslo:when>
1285 <xslo:when test="@code = $geographic_subdivision_subfield">
1286 <xslo:text> geographicsubdiv </xslo:text>
1287 </xslo:when>
1288 </xslo:choose>
1289 </xslo:when>
1290 <xslo:otherwise>
1291 <xslo:value-of select="substring(' ', 1, 1)"/>
1292 </xslo:otherwise>
1293 </xslo:choose>
1294 </xslo:if>
1295 <xslo:call-template name="chopPunctuation">
1296 <xslo:with-param name="chopString">
1297 <xslo:value-of select="."/>
1298 </xslo:with-param>
1299 </xslo:call-template>
1300 </xslo:if>
1301 </xslo:for-each>
1302 </xslo:variable>
1303 <xslo:value-of select="normalize-space($raw_heading)"/>
1304 </z:index>
1305 </xslo:template>
1306 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='410']">
1307 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1308 <xslo:variable name="raw_heading">
1309 <xslo:for-each select="marc:subfield">
1310 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1311 <xslo:if test="position() &gt; 1">
1312 <xslo:choose>
1313 <xslo:when test="contains('vxyz', @code)">
1314 <xslo:choose>
1315 <xslo:when test="@code = $general_subdivision_subfield">
1316 <xslo:text> generalsubdiv </xslo:text>
1317 </xslo:when>
1318 <xslo:when test="@code = $form_subdivision_subfield">
1319 <xslo:text> formsubdiv </xslo:text>
1320 </xslo:when>
1321 <xslo:when test="@code = $chronological_subdivision_subfield">
1322 <xslo:text> chronologicalsubdiv </xslo:text>
1323 </xslo:when>
1324 <xslo:when test="@code = $geographic_subdivision_subfield">
1325 <xslo:text> geographicsubdiv </xslo:text>
1326 </xslo:when>
1327 </xslo:choose>
1328 </xslo:when>
1329 <xslo:otherwise>
1330 <xslo:value-of select="substring(' ', 1, 1)"/>
1331 </xslo:otherwise>
1332 </xslo:choose>
1333 </xslo:if>
1334 <xslo:call-template name="chopPunctuation">
1335 <xslo:with-param name="chopString">
1336 <xslo:value-of select="."/>
1337 </xslo:with-param>
1338 </xslo:call-template>
1339 </xslo:if>
1340 </xslo:for-each>
1341 </xslo:variable>
1342 <xslo:value-of select="normalize-space($raw_heading)"/>
1343 </z:index>
1344 </xslo:template>
1345 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='510']">
1346 <z:index name="Match:w Match:p">
1347 <xslo:variable name="raw_heading">
1348 <xslo:for-each select="marc:subfield">
1349 <xslo:if test="contains('abcdefghklmnoprstvxyz', @code)" name="Match:w Match:p">
1350 <xslo:if test="position() &gt; 1">
1351 <xslo:choose>
1352 <xslo:when test="contains('vxyz', @code)">
1353 <xslo:choose>
1354 <xslo:when test="@code = $general_subdivision_subfield">
1355 <xslo:text> generalsubdiv </xslo:text>
1356 </xslo:when>
1357 <xslo:when test="@code = $form_subdivision_subfield">
1358 <xslo:text> formsubdiv </xslo:text>
1359 </xslo:when>
1360 <xslo:when test="@code = $chronological_subdivision_subfield">
1361 <xslo:text> chronologicalsubdiv </xslo:text>
1362 </xslo:when>
1363 <xslo:when test="@code = $geographic_subdivision_subfield">
1364 <xslo:text> geographicsubdiv </xslo:text>
1365 </xslo:when>
1366 </xslo:choose>
1367 </xslo:when>
1368 <xslo:otherwise>
1369 <xslo:value-of select="substring(' ', 1, 1)"/>
1370 </xslo:otherwise>
1371 </xslo:choose>
1372 </xslo:if>
1373 <xslo:call-template name="chopPunctuation">
1374 <xslo:with-param name="chopString">
1375 <xslo:value-of select="."/>
1376 </xslo:with-param>
1377 </xslo:call-template>
1378 </xslo:if>
1379 </xslo:for-each>
1380 </xslo:variable>
1381 <xslo:value-of select="normalize-space($raw_heading)"/>
1382 </z:index>
1383 </xslo:template>
1384 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='111']">
1385 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1386 <xslo:variable name="raw_heading">
1387 <xslo:for-each select="marc:subfield">
1388 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1389 <xslo:if test="position() &gt; 1">
1390 <xslo:choose>
1391 <xslo:when test="contains('vxyz', @code)">
1392 <xslo:choose>
1393 <xslo:when test="@code = $general_subdivision_subfield">
1394 <xslo:text> generalsubdiv </xslo:text>
1395 </xslo:when>
1396 <xslo:when test="@code = $form_subdivision_subfield">
1397 <xslo:text> formsubdiv </xslo:text>
1398 </xslo:when>
1399 <xslo:when test="@code = $chronological_subdivision_subfield">
1400 <xslo:text> chronologicalsubdiv </xslo:text>
1401 </xslo:when>
1402 <xslo:when test="@code = $geographic_subdivision_subfield">
1403 <xslo:text> geographicsubdiv </xslo:text>
1404 </xslo:when>
1405 </xslo:choose>
1406 </xslo:when>
1407 <xslo:otherwise>
1408 <xslo:value-of select="substring(' ', 1, 1)"/>
1409 </xslo:otherwise>
1410 </xslo:choose>
1411 </xslo:if>
1412 <xslo:call-template name="chopPunctuation">
1413 <xslo:with-param name="chopString">
1414 <xslo:value-of select="."/>
1415 </xslo:with-param>
1416 </xslo:call-template>
1417 </xslo:if>
1418 </xslo:for-each>
1419 </xslo:variable>
1420 <xslo:value-of select="normalize-space($raw_heading)"/>
1421 </z:index>
1422 </xslo:template>
1423 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='411']">
1424 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1425 <xslo:variable name="raw_heading">
1426 <xslo:for-each select="marc:subfield">
1427 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1428 <xslo:if test="position() &gt; 1">
1429 <xslo:choose>
1430 <xslo:when test="contains('vxyz', @code)">
1431 <xslo:choose>
1432 <xslo:when test="@code = $general_subdivision_subfield">
1433 <xslo:text> generalsubdiv </xslo:text>
1434 </xslo:when>
1435 <xslo:when test="@code = $form_subdivision_subfield">
1436 <xslo:text> formsubdiv </xslo:text>
1437 </xslo:when>
1438 <xslo:when test="@code = $chronological_subdivision_subfield">
1439 <xslo:text> chronologicalsubdiv </xslo:text>
1440 </xslo:when>
1441 <xslo:when test="@code = $geographic_subdivision_subfield">
1442 <xslo:text> geographicsubdiv </xslo:text>
1443 </xslo:when>
1444 </xslo:choose>
1445 </xslo:when>
1446 <xslo:otherwise>
1447 <xslo:value-of select="substring(' ', 1, 1)"/>
1448 </xslo:otherwise>
1449 </xslo:choose>
1450 </xslo:if>
1451 <xslo:call-template name="chopPunctuation">
1452 <xslo:with-param name="chopString">
1453 <xslo:value-of select="."/>
1454 </xslo:with-param>
1455 </xslo:call-template>
1456 </xslo:if>
1457 </xslo:for-each>
1458 </xslo:variable>
1459 <xslo:value-of select="normalize-space($raw_heading)"/>
1460 </z:index>
1461 </xslo:template>
1462 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='511']">
1463 <z:index name="Match:w Match:p">
1464 <xslo:variable name="raw_heading">
1465 <xslo:for-each select="marc:subfield">
1466 <xslo:if test="contains('acdefghjklnpqstvxyz', @code)" name="Match:w Match:p">
1467 <xslo:if test="position() &gt; 1">
1468 <xslo:choose>
1469 <xslo:when test="contains('vxyz', @code)">
1470 <xslo:choose>
1471 <xslo:when test="@code = $general_subdivision_subfield">
1472 <xslo:text> generalsubdiv </xslo:text>
1473 </xslo:when>
1474 <xslo:when test="@code = $form_subdivision_subfield">
1475 <xslo:text> formsubdiv </xslo:text>
1476 </xslo:when>
1477 <xslo:when test="@code = $chronological_subdivision_subfield">
1478 <xslo:text> chronologicalsubdiv </xslo:text>
1479 </xslo:when>
1480 <xslo:when test="@code = $geographic_subdivision_subfield">
1481 <xslo:text> geographicsubdiv </xslo:text>
1482 </xslo:when>
1483 </xslo:choose>
1484 </xslo:when>
1485 <xslo:otherwise>
1486 <xslo:value-of select="substring(' ', 1, 1)"/>
1487 </xslo:otherwise>
1488 </xslo:choose>
1489 </xslo:if>
1490 <xslo:call-template name="chopPunctuation">
1491 <xslo:with-param name="chopString">
1492 <xslo:value-of select="."/>
1493 </xslo:with-param>
1494 </xslo:call-template>
1495 </xslo:if>
1496 </xslo:for-each>
1497 </xslo:variable>
1498 <xslo:value-of select="normalize-space($raw_heading)"/>
1499 </z:index>
1500 </xslo:template>
1501 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='130']">
1502 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1503 <xslo:variable name="raw_heading">
1504 <xslo:for-each select="marc:subfield">
1505 <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1506 <xslo:if test="position() &gt; 1">
1507 <xslo:choose>
1508 <xslo:when test="contains('vxyz', @code)">
1509 <xslo:choose>
1510 <xslo:when test="@code = $general_subdivision_subfield">
1511 <xslo:text> generalsubdiv </xslo:text>
1512 </xslo:when>
1513 <xslo:when test="@code = $form_subdivision_subfield">
1514 <xslo:text> formsubdiv </xslo:text>
1515 </xslo:when>
1516 <xslo:when test="@code = $chronological_subdivision_subfield">
1517 <xslo:text> chronologicalsubdiv </xslo:text>
1518 </xslo:when>
1519 <xslo:when test="@code = $geographic_subdivision_subfield">
1520 <xslo:text> geographicsubdiv </xslo:text>
1521 </xslo:when>
1522 </xslo:choose>
1523 </xslo:when>
1524 <xslo:otherwise>
1525 <xslo:value-of select="substring(' ', 1, 1)"/>
1526 </xslo:otherwise>
1527 </xslo:choose>
1528 </xslo:if>
1529 <xslo:call-template name="chopPunctuation">
1530 <xslo:with-param name="chopString">
1531 <xslo:value-of select="."/>
1532 </xslo:with-param>
1533 </xslo:call-template>
1534 </xslo:if>
1535 </xslo:for-each>
1536 </xslo:variable>
1537 <xslo:value-of select="normalize-space($raw_heading)"/>
1538 </z:index>
1539 </xslo:template>
1540 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='430']">
1541 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1542 <xslo:variable name="raw_heading">
1543 <xslo:for-each select="marc:subfield">
1544 <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1545 <xslo:if test="position() &gt; 1">
1546 <xslo:choose>
1547 <xslo:when test="contains('vxyz', @code)">
1548 <xslo:choose>
1549 <xslo:when test="@code = $general_subdivision_subfield">
1550 <xslo:text> generalsubdiv </xslo:text>
1551 </xslo:when>
1552 <xslo:when test="@code = $form_subdivision_subfield">
1553 <xslo:text> formsubdiv </xslo:text>
1554 </xslo:when>
1555 <xslo:when test="@code = $chronological_subdivision_subfield">
1556 <xslo:text> chronologicalsubdiv </xslo:text>
1557 </xslo:when>
1558 <xslo:when test="@code = $geographic_subdivision_subfield">
1559 <xslo:text> geographicsubdiv </xslo:text>
1560 </xslo:when>
1561 </xslo:choose>
1562 </xslo:when>
1563 <xslo:otherwise>
1564 <xslo:value-of select="substring(' ', 1, 1)"/>
1565 </xslo:otherwise>
1566 </xslo:choose>
1567 </xslo:if>
1568 <xslo:call-template name="chopPunctuation">
1569 <xslo:with-param name="chopString">
1570 <xslo:value-of select="."/>
1571 </xslo:with-param>
1572 </xslo:call-template>
1573 </xslo:if>
1574 </xslo:for-each>
1575 </xslo:variable>
1576 <xslo:value-of select="normalize-space($raw_heading)"/>
1577 </z:index>
1578 </xslo:template>
1579 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='530']">
1580 <z:index name="Match:w Match:p">
1581 <xslo:variable name="raw_heading">
1582 <xslo:for-each select="marc:subfield">
1583 <xslo:if test="contains('adfghklmnoprstvxyz', @code)" name="Match:w Match:p">
1584 <xslo:if test="position() &gt; 1">
1585 <xslo:choose>
1586 <xslo:when test="contains('vxyz', @code)">
1587 <xslo:choose>
1588 <xslo:when test="@code = $general_subdivision_subfield">
1589 <xslo:text> generalsubdiv </xslo:text>
1590 </xslo:when>
1591 <xslo:when test="@code = $form_subdivision_subfield">
1592 <xslo:text> formsubdiv </xslo:text>
1593 </xslo:when>
1594 <xslo:when test="@code = $chronological_subdivision_subfield">
1595 <xslo:text> chronologicalsubdiv </xslo:text>
1596 </xslo:when>
1597 <xslo:when test="@code = $geographic_subdivision_subfield">
1598 <xslo:text> geographicsubdiv </xslo:text>
1599 </xslo:when>
1600 </xslo:choose>
1601 </xslo:when>
1602 <xslo:otherwise>
1603 <xslo:value-of select="substring(' ', 1, 1)"/>
1604 </xslo:otherwise>
1605 </xslo:choose>
1606 </xslo:if>
1607 <xslo:call-template name="chopPunctuation">
1608 <xslo:with-param name="chopString">
1609 <xslo:value-of select="."/>
1610 </xslo:with-param>
1611 </xslo:call-template>
1612 </xslo:if>
1613 </xslo:for-each>
1614 </xslo:variable>
1615 <xslo:value-of select="normalize-space($raw_heading)"/>
1616 </z:index>
1617 </xslo:template>
1618 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='148']">
1619 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1620 <xslo:variable name="raw_heading">
1621 <xslo:for-each select="marc:subfield">
1622 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1623 <xslo:if test="position() &gt; 1">
1624 <xslo:choose>
1625 <xslo:when test="contains('vxyz', @code)">
1626 <xslo:choose>
1627 <xslo:when test="@code = $general_subdivision_subfield">
1628 <xslo:text> generalsubdiv </xslo:text>
1629 </xslo:when>
1630 <xslo:when test="@code = $form_subdivision_subfield">
1631 <xslo:text> formsubdiv </xslo:text>
1632 </xslo:when>
1633 <xslo:when test="@code = $chronological_subdivision_subfield">
1634 <xslo:text> chronologicalsubdiv </xslo:text>
1635 </xslo:when>
1636 <xslo:when test="@code = $geographic_subdivision_subfield">
1637 <xslo:text> geographicsubdiv </xslo:text>
1638 </xslo:when>
1639 </xslo:choose>
1640 </xslo:when>
1641 <xslo:otherwise>
1642 <xslo:value-of select="substring(' ', 1, 1)"/>
1643 </xslo:otherwise>
1644 </xslo:choose>
1645 </xslo:if>
1646 <xslo:call-template name="chopPunctuation">
1647 <xslo:with-param name="chopString">
1648 <xslo:value-of select="."/>
1649 </xslo:with-param>
1650 </xslo:call-template>
1651 </xslo:if>
1652 </xslo:for-each>
1653 </xslo:variable>
1654 <xslo:value-of select="normalize-space($raw_heading)"/>
1655 </z:index>
1656 </xslo:template>
1657 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='448']">
1658 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1659 <xslo:variable name="raw_heading">
1660 <xslo:for-each select="marc:subfield">
1661 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1662 <xslo:if test="position() &gt; 1">
1663 <xslo:choose>
1664 <xslo:when test="contains('vxyz', @code)">
1665 <xslo:choose>
1666 <xslo:when test="@code = $general_subdivision_subfield">
1667 <xslo:text> generalsubdiv </xslo:text>
1668 </xslo:when>
1669 <xslo:when test="@code = $form_subdivision_subfield">
1670 <xslo:text> formsubdiv </xslo:text>
1671 </xslo:when>
1672 <xslo:when test="@code = $chronological_subdivision_subfield">
1673 <xslo:text> chronologicalsubdiv </xslo:text>
1674 </xslo:when>
1675 <xslo:when test="@code = $geographic_subdivision_subfield">
1676 <xslo:text> geographicsubdiv </xslo:text>
1677 </xslo:when>
1678 </xslo:choose>
1679 </xslo:when>
1680 <xslo:otherwise>
1681 <xslo:value-of select="substring(' ', 1, 1)"/>
1682 </xslo:otherwise>
1683 </xslo:choose>
1684 </xslo:if>
1685 <xslo:call-template name="chopPunctuation">
1686 <xslo:with-param name="chopString">
1687 <xslo:value-of select="."/>
1688 </xslo:with-param>
1689 </xslo:call-template>
1690 </xslo:if>
1691 </xslo:for-each>
1692 </xslo:variable>
1693 <xslo:value-of select="normalize-space($raw_heading)"/>
1694 </z:index>
1695 </xslo:template>
1696 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='548']">
1697 <z:index name="Match:w Match:p">
1698 <xslo:variable name="raw_heading">
1699 <xslo:for-each select="marc:subfield">
1700 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p">
1701 <xslo:if test="position() &gt; 1">
1702 <xslo:choose>
1703 <xslo:when test="contains('vxyz', @code)">
1704 <xslo:choose>
1705 <xslo:when test="@code = $general_subdivision_subfield">
1706 <xslo:text> generalsubdiv </xslo:text>
1707 </xslo:when>
1708 <xslo:when test="@code = $form_subdivision_subfield">
1709 <xslo:text> formsubdiv </xslo:text>
1710 </xslo:when>
1711 <xslo:when test="@code = $chronological_subdivision_subfield">
1712 <xslo:text> chronologicalsubdiv </xslo:text>
1713 </xslo:when>
1714 <xslo:when test="@code = $geographic_subdivision_subfield">
1715 <xslo:text> geographicsubdiv </xslo:text>
1716 </xslo:when>
1717 </xslo:choose>
1718 </xslo:when>
1719 <xslo:otherwise>
1720 <xslo:value-of select="substring(' ', 1, 1)"/>
1721 </xslo:otherwise>
1722 </xslo:choose>
1723 </xslo:if>
1724 <xslo:call-template name="chopPunctuation">
1725 <xslo:with-param name="chopString">
1726 <xslo:value-of select="."/>
1727 </xslo:with-param>
1728 </xslo:call-template>
1729 </xslo:if>
1730 </xslo:for-each>
1731 </xslo:variable>
1732 <xslo:value-of select="normalize-space($raw_heading)"/>
1733 </z:index>
1734 </xslo:template>
1735 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='150']">
1736 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1737 <xslo:variable name="raw_heading">
1738 <xslo:for-each select="marc:subfield">
1739 <xslo:if test="contains('abvxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1740 <xslo:if test="position() &gt; 1">
1741 <xslo:choose>
1742 <xslo:when test="contains('vxyz', @code)">
1743 <xslo:choose>
1744 <xslo:when test="@code = $general_subdivision_subfield">
1745 <xslo:text> generalsubdiv </xslo:text>
1746 </xslo:when>
1747 <xslo:when test="@code = $form_subdivision_subfield">
1748 <xslo:text> formsubdiv </xslo:text>
1749 </xslo:when>
1750 <xslo:when test="@code = $chronological_subdivision_subfield">
1751 <xslo:text> chronologicalsubdiv </xslo:text>
1752 </xslo:when>
1753 <xslo:when test="@code = $geographic_subdivision_subfield">
1754 <xslo:text> geographicsubdiv </xslo:text>
1755 </xslo:when>
1756 </xslo:choose>
1757 </xslo:when>
1758 <xslo:otherwise>
1759 <xslo:value-of select="substring(' ', 1, 1)"/>
1760 </xslo:otherwise>
1761 </xslo:choose>
1762 </xslo:if>
1763 <xslo:call-template name="chopPunctuation">
1764 <xslo:with-param name="chopString">
1765 <xslo:value-of select="."/>
1766 </xslo:with-param>
1767 </xslo:call-template>
1768 </xslo:if>
1769 </xslo:for-each>
1770 </xslo:variable>
1771 <xslo:value-of select="normalize-space($raw_heading)"/>
1772 </z:index>
1773 </xslo:template>
1774 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='450']">
1775 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1776 <xslo:variable name="raw_heading">
1777 <xslo:for-each select="marc:subfield">
1778 <xslo:if test="contains('abvxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1779 <xslo:if test="position() &gt; 1">
1780 <xslo:choose>
1781 <xslo:when test="contains('vxyz', @code)">
1782 <xslo:choose>
1783 <xslo:when test="@code = $general_subdivision_subfield">
1784 <xslo:text> generalsubdiv </xslo:text>
1785 </xslo:when>
1786 <xslo:when test="@code = $form_subdivision_subfield">
1787 <xslo:text> formsubdiv </xslo:text>
1788 </xslo:when>
1789 <xslo:when test="@code = $chronological_subdivision_subfield">
1790 <xslo:text> chronologicalsubdiv </xslo:text>
1791 </xslo:when>
1792 <xslo:when test="@code = $geographic_subdivision_subfield">
1793 <xslo:text> geographicsubdiv </xslo:text>
1794 </xslo:when>
1795 </xslo:choose>
1796 </xslo:when>
1797 <xslo:otherwise>
1798 <xslo:value-of select="substring(' ', 1, 1)"/>
1799 </xslo:otherwise>
1800 </xslo:choose>
1801 </xslo:if>
1802 <xslo:call-template name="chopPunctuation">
1803 <xslo:with-param name="chopString">
1804 <xslo:value-of select="."/>
1805 </xslo:with-param>
1806 </xslo:call-template>
1807 </xslo:if>
1808 </xslo:for-each>
1809 </xslo:variable>
1810 <xslo:value-of select="normalize-space($raw_heading)"/>
1811 </z:index>
1812 </xslo:template>
1813 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='550']">
1814 <z:index name="Match:w Match:p">
1815 <xslo:variable name="raw_heading">
1816 <xslo:for-each select="marc:subfield">
1817 <xslo:if test="contains('abvxyz', @code)" name="Match:w Match:p">
1818 <xslo:if test="position() &gt; 1">
1819 <xslo:choose>
1820 <xslo:when test="contains('vxyz', @code)">
1821 <xslo:choose>
1822 <xslo:when test="@code = $general_subdivision_subfield">
1823 <xslo:text> generalsubdiv </xslo:text>
1824 </xslo:when>
1825 <xslo:when test="@code = $form_subdivision_subfield">
1826 <xslo:text> formsubdiv </xslo:text>
1827 </xslo:when>
1828 <xslo:when test="@code = $chronological_subdivision_subfield">
1829 <xslo:text> chronologicalsubdiv </xslo:text>
1830 </xslo:when>
1831 <xslo:when test="@code = $geographic_subdivision_subfield">
1832 <xslo:text> geographicsubdiv </xslo:text>
1833 </xslo:when>
1834 </xslo:choose>
1835 </xslo:when>
1836 <xslo:otherwise>
1837 <xslo:value-of select="substring(' ', 1, 1)"/>
1838 </xslo:otherwise>
1839 </xslo:choose>
1840 </xslo:if>
1841 <xslo:call-template name="chopPunctuation">
1842 <xslo:with-param name="chopString">
1843 <xslo:value-of select="."/>
1844 </xslo:with-param>
1845 </xslo:call-template>
1846 </xslo:if>
1847 </xslo:for-each>
1848 </xslo:variable>
1849 <xslo:value-of select="normalize-space($raw_heading)"/>
1850 </z:index>
1851 </xslo:template>
1852 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='151']">
1853 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1854 <xslo:variable name="raw_heading">
1855 <xslo:for-each select="marc:subfield">
1856 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1857 <xslo:if test="position() &gt; 1">
1858 <xslo:choose>
1859 <xslo:when test="contains('vxyz', @code)">
1860 <xslo:choose>
1861 <xslo:when test="@code = $general_subdivision_subfield">
1862 <xslo:text> generalsubdiv </xslo:text>
1863 </xslo:when>
1864 <xslo:when test="@code = $form_subdivision_subfield">
1865 <xslo:text> formsubdiv </xslo:text>
1866 </xslo:when>
1867 <xslo:when test="@code = $chronological_subdivision_subfield">
1868 <xslo:text> chronologicalsubdiv </xslo:text>
1869 </xslo:when>
1870 <xslo:when test="@code = $geographic_subdivision_subfield">
1871 <xslo:text> geographicsubdiv </xslo:text>
1872 </xslo:when>
1873 </xslo:choose>
1874 </xslo:when>
1875 <xslo:otherwise>
1876 <xslo:value-of select="substring(' ', 1, 1)"/>
1877 </xslo:otherwise>
1878 </xslo:choose>
1879 </xslo:if>
1880 <xslo:call-template name="chopPunctuation">
1881 <xslo:with-param name="chopString">
1882 <xslo:value-of select="."/>
1883 </xslo:with-param>
1884 </xslo:call-template>
1885 </xslo:if>
1886 </xslo:for-each>
1887 </xslo:variable>
1888 <xslo:value-of select="normalize-space($raw_heading)"/>
1889 </z:index>
1890 </xslo:template>
1891 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='451']">
1892 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1893 <xslo:variable name="raw_heading">
1894 <xslo:for-each select="marc:subfield">
1895 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
1896 <xslo:if test="position() &gt; 1">
1897 <xslo:choose>
1898 <xslo:when test="contains('vxyz', @code)">
1899 <xslo:choose>
1900 <xslo:when test="@code = $general_subdivision_subfield">
1901 <xslo:text> generalsubdiv </xslo:text>
1902 </xslo:when>
1903 <xslo:when test="@code = $form_subdivision_subfield">
1904 <xslo:text> formsubdiv </xslo:text>
1905 </xslo:when>
1906 <xslo:when test="@code = $chronological_subdivision_subfield">
1907 <xslo:text> chronologicalsubdiv </xslo:text>
1908 </xslo:when>
1909 <xslo:when test="@code = $geographic_subdivision_subfield">
1910 <xslo:text> geographicsubdiv </xslo:text>
1911 </xslo:when>
1912 </xslo:choose>
1913 </xslo:when>
1914 <xslo:otherwise>
1915 <xslo:value-of select="substring(' ', 1, 1)"/>
1916 </xslo:otherwise>
1917 </xslo:choose>
1918 </xslo:if>
1919 <xslo:call-template name="chopPunctuation">
1920 <xslo:with-param name="chopString">
1921 <xslo:value-of select="."/>
1922 </xslo:with-param>
1923 </xslo:call-template>
1924 </xslo:if>
1925 </xslo:for-each>
1926 </xslo:variable>
1927 <xslo:value-of select="normalize-space($raw_heading)"/>
1928 </z:index>
1929 </xslo:template>
1930 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='551']">
1931 <z:index name="Match:w Match:p">
1932 <xslo:variable name="raw_heading">
1933 <xslo:for-each select="marc:subfield">
1934 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p">
1935 <xslo:if test="position() &gt; 1">
1936 <xslo:choose>
1937 <xslo:when test="contains('vxyz', @code)">
1938 <xslo:choose>
1939 <xslo:when test="@code = $general_subdivision_subfield">
1940 <xslo:text> generalsubdiv </xslo:text>
1941 </xslo:when>
1942 <xslo:when test="@code = $form_subdivision_subfield">
1943 <xslo:text> formsubdiv </xslo:text>
1944 </xslo:when>
1945 <xslo:when test="@code = $chronological_subdivision_subfield">
1946 <xslo:text> chronologicalsubdiv </xslo:text>
1947 </xslo:when>
1948 <xslo:when test="@code = $geographic_subdivision_subfield">
1949 <xslo:text> geographicsubdiv </xslo:text>
1950 </xslo:when>
1951 </xslo:choose>
1952 </xslo:when>
1953 <xslo:otherwise>
1954 <xslo:value-of select="substring(' ', 1, 1)"/>
1955 </xslo:otherwise>
1956 </xslo:choose>
1957 </xslo:if>
1958 <xslo:call-template name="chopPunctuation">
1959 <xslo:with-param name="chopString">
1960 <xslo:value-of select="."/>
1961 </xslo:with-param>
1962 </xslo:call-template>
1963 </xslo:if>
1964 </xslo:for-each>
1965 </xslo:variable>
1966 <xslo:value-of select="normalize-space($raw_heading)"/>
1967 </z:index>
1968 </xslo:template>
1969 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='155']">
1970 <z:index name="Match:w Match:p Match-heading:p Match-heading:s">
1971 <xslo:variable name="raw_heading">
1972 <xslo:for-each select="marc:subfield">
1973 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p Match-heading:p Match-heading:s">
1974 <xslo:if test="position() &gt; 1">
1975 <xslo:choose>
1976 <xslo:when test="contains('vxyz', @code)">
1977 <xslo:choose>
1978 <xslo:when test="@code = $general_subdivision_subfield">
1979 <xslo:text> generalsubdiv </xslo:text>
1980 </xslo:when>
1981 <xslo:when test="@code = $form_subdivision_subfield">
1982 <xslo:text> formsubdiv </xslo:text>
1983 </xslo:when>
1984 <xslo:when test="@code = $chronological_subdivision_subfield">
1985 <xslo:text> chronologicalsubdiv </xslo:text>
1986 </xslo:when>
1987 <xslo:when test="@code = $geographic_subdivision_subfield">
1988 <xslo:text> geographicsubdiv </xslo:text>
1989 </xslo:when>
1990 </xslo:choose>
1991 </xslo:when>
1992 <xslo:otherwise>
1993 <xslo:value-of select="substring(' ', 1, 1)"/>
1994 </xslo:otherwise>
1995 </xslo:choose>
1996 </xslo:if>
1997 <xslo:call-template name="chopPunctuation">
1998 <xslo:with-param name="chopString">
1999 <xslo:value-of select="."/>
2000 </xslo:with-param>
2001 </xslo:call-template>
2002 </xslo:if>
2003 </xslo:for-each>
2004 </xslo:variable>
2005 <xslo:value-of select="normalize-space($raw_heading)"/>
2006 </z:index>
2007 </xslo:template>
2008 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='455']">
2009 <z:index name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
2010 <xslo:variable name="raw_heading">
2011 <xslo:for-each select="marc:subfield">
2012 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p Match-heading-see-from:p Match-heading-see-from:s">
2013 <xslo:if test="position() &gt; 1">
2014 <xslo:choose>
2015 <xslo:when test="contains('vxyz', @code)">
2016 <xslo:choose>
2017 <xslo:when test="@code = $general_subdivision_subfield">
2018 <xslo:text> generalsubdiv </xslo:text>
2019 </xslo:when>
2020 <xslo:when test="@code = $form_subdivision_subfield">
2021 <xslo:text> formsubdiv </xslo:text>
2022 </xslo:when>
2023 <xslo:when test="@code = $chronological_subdivision_subfield">
2024 <xslo:text> chronologicalsubdiv </xslo:text>
2025 </xslo:when>
2026 <xslo:when test="@code = $geographic_subdivision_subfield">
2027 <xslo:text> geographicsubdiv </xslo:text>
2028 </xslo:when>
2029 </xslo:choose>
2030 </xslo:when>
2031 <xslo:otherwise>
2032 <xslo:value-of select="substring(' ', 1, 1)"/>
2033 </xslo:otherwise>
2034 </xslo:choose>
2035 </xslo:if>
2036 <xslo:call-template name="chopPunctuation">
2037 <xslo:with-param name="chopString">
2038 <xslo:value-of select="."/>
2039 </xslo:with-param>
2040 </xslo:call-template>
2041 </xslo:if>
2042 </xslo:for-each>
2043 </xslo:variable>
2044 <xslo:value-of select="normalize-space($raw_heading)"/>
2045 </z:index>
2046 </xslo:template>
2047 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='555']">
2048 <z:index name="Match:w Match:p">
2049 <xslo:variable name="raw_heading">
2050 <xslo:for-each select="marc:subfield">
2051 <xslo:if test="contains('avxyz', @code)" name="Match:w Match:p">
2052 <xslo:if test="position() &gt; 1">
2053 <xslo:choose>
2054 <xslo:when test="contains('vxyz', @code)">
2055 <xslo:choose>
2056 <xslo:when test="@code = $general_subdivision_subfield">
2057 <xslo:text> generalsubdiv </xslo:text>
2058 </xslo:when>
2059 <xslo:when test="@code = $form_subdivision_subfield">
2060 <xslo:text> formsubdiv </xslo:text>
2061 </xslo:when>
2062 <xslo:when test="@code = $chronological_subdivision_subfield">
2063 <xslo:text> chronologicalsubdiv </xslo:text>
2064 </xslo:when>
2065 <xslo:when test="@code = $geographic_subdivision_subfield">
2066 <xslo:text> geographicsubdiv </xslo:text>
2067 </xslo:when>
2068 </xslo:choose>
2069 </xslo:when>
2070 <xslo:otherwise>
2071 <xslo:value-of select="substring(' ', 1, 1)"/>
2072 </xslo:otherwise>
2073 </xslo:choose>
2074 </xslo:if>
2075 <xslo:call-template name="chopPunctuation">
2076 <xslo:with-param name="chopString">
2077 <xslo:value-of select="."/>
2078 </xslo:with-param>
2079 </xslo:call-template>
2080 </xslo:if>
2081 </xslo:for-each>
2082 </xslo:variable>
2083 <xslo:value-of select="normalize-space($raw_heading)"/>
2084 </z:index>
2085 </xslo:template>
2086 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='180']">
2087 <z:index name="Match-subdivision:p Match-subdivision:s">
2088 <xslo:variable name="raw_heading">
2089 <xslo:for-each select="marc:subfield">
2090 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision:p Match-subdivision:s">
2091 <xslo:if test="position() &gt; 1">
2092 <xslo:choose>
2093 <xslo:when test="contains('vxyz', @code)">
2094 <xslo:choose>
2095 <xslo:when test="@code = $general_subdivision_subfield">
2096 <xslo:text> generalsubdiv </xslo:text>
2097 </xslo:when>
2098 <xslo:when test="@code = $form_subdivision_subfield">
2099 <xslo:text> formsubdiv </xslo:text>
2100 </xslo:when>
2101 <xslo:when test="@code = $chronological_subdivision_subfield">
2102 <xslo:text> chronologicalsubdiv </xslo:text>
2103 </xslo:when>
2104 <xslo:when test="@code = $geographic_subdivision_subfield">
2105 <xslo:text> geographicsubdiv </xslo:text>
2106 </xslo:when>
2107 </xslo:choose>
2108 </xslo:when>
2109 <xslo:otherwise>
2110 <xslo:value-of select="substring(' ', 1, 1)"/>
2111 </xslo:otherwise>
2112 </xslo:choose>
2113 </xslo:if>
2114 <xslo:call-template name="chopPunctuation">
2115 <xslo:with-param name="chopString">
2116 <xslo:value-of select="."/>
2117 </xslo:with-param>
2118 </xslo:call-template>
2119 </xslo:if>
2120 </xslo:for-each>
2121 </xslo:variable>
2122 <xslo:value-of select="normalize-space($raw_heading)"/>
2123 </z:index>
2124 </xslo:template>
2125 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='480']">
2126 <z:index name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2127 <xslo:variable name="raw_heading">
2128 <xslo:for-each select="marc:subfield">
2129 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2130 <xslo:if test="position() &gt; 1">
2131 <xslo:choose>
2132 <xslo:when test="contains('vxyz', @code)">
2133 <xslo:choose>
2134 <xslo:when test="@code = $general_subdivision_subfield">
2135 <xslo:text> generalsubdiv </xslo:text>
2136 </xslo:when>
2137 <xslo:when test="@code = $form_subdivision_subfield">
2138 <xslo:text> formsubdiv </xslo:text>
2139 </xslo:when>
2140 <xslo:when test="@code = $chronological_subdivision_subfield">
2141 <xslo:text> chronologicalsubdiv </xslo:text>
2142 </xslo:when>
2143 <xslo:when test="@code = $geographic_subdivision_subfield">
2144 <xslo:text> geographicsubdiv </xslo:text>
2145 </xslo:when>
2146 </xslo:choose>
2147 </xslo:when>
2148 <xslo:otherwise>
2149 <xslo:value-of select="substring(' ', 1, 1)"/>
2150 </xslo:otherwise>
2151 </xslo:choose>
2152 </xslo:if>
2153 <xslo:call-template name="chopPunctuation">
2154 <xslo:with-param name="chopString">
2155 <xslo:value-of select="."/>
2156 </xslo:with-param>
2157 </xslo:call-template>
2158 </xslo:if>
2159 </xslo:for-each>
2160 </xslo:variable>
2161 <xslo:value-of select="normalize-space($raw_heading)"/>
2162 </z:index>
2163 </xslo:template>
2164 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='181']">
2165 <z:index name="Match-subdivision:p Match-subdivision:s">
2166 <xslo:variable name="raw_heading">
2167 <xslo:for-each select="marc:subfield">
2168 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision:p Match-subdivision:s">
2169 <xslo:if test="position() &gt; 1">
2170 <xslo:choose>
2171 <xslo:when test="contains('vxyz', @code)">
2172 <xslo:choose>
2173 <xslo:when test="@code = $general_subdivision_subfield">
2174 <xslo:text> generalsubdiv </xslo:text>
2175 </xslo:when>
2176 <xslo:when test="@code = $form_subdivision_subfield">
2177 <xslo:text> formsubdiv </xslo:text>
2178 </xslo:when>
2179 <xslo:when test="@code = $chronological_subdivision_subfield">
2180 <xslo:text> chronologicalsubdiv </xslo:text>
2181 </xslo:when>
2182 <xslo:when test="@code = $geographic_subdivision_subfield">
2183 <xslo:text> geographicsubdiv </xslo:text>
2184 </xslo:when>
2185 </xslo:choose>
2186 </xslo:when>
2187 <xslo:otherwise>
2188 <xslo:value-of select="substring(' ', 1, 1)"/>
2189 </xslo:otherwise>
2190 </xslo:choose>
2191 </xslo:if>
2192 <xslo:call-template name="chopPunctuation">
2193 <xslo:with-param name="chopString">
2194 <xslo:value-of select="."/>
2195 </xslo:with-param>
2196 </xslo:call-template>
2197 </xslo:if>
2198 </xslo:for-each>
2199 </xslo:variable>
2200 <xslo:value-of select="normalize-space($raw_heading)"/>
2201 </z:index>
2202 </xslo:template>
2203 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='481']">
2204 <z:index name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2205 <xslo:variable name="raw_heading">
2206 <xslo:for-each select="marc:subfield">
2207 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2208 <xslo:if test="position() &gt; 1">
2209 <xslo:choose>
2210 <xslo:when test="contains('vxyz', @code)">
2211 <xslo:choose>
2212 <xslo:when test="@code = $general_subdivision_subfield">
2213 <xslo:text> generalsubdiv </xslo:text>
2214 </xslo:when>
2215 <xslo:when test="@code = $form_subdivision_subfield">
2216 <xslo:text> formsubdiv </xslo:text>
2217 </xslo:when>
2218 <xslo:when test="@code = $chronological_subdivision_subfield">
2219 <xslo:text> chronologicalsubdiv </xslo:text>
2220 </xslo:when>
2221 <xslo:when test="@code = $geographic_subdivision_subfield">
2222 <xslo:text> geographicsubdiv </xslo:text>
2223 </xslo:when>
2224 </xslo:choose>
2225 </xslo:when>
2226 <xslo:otherwise>
2227 <xslo:value-of select="substring(' ', 1, 1)"/>
2228 </xslo:otherwise>
2229 </xslo:choose>
2230 </xslo:if>
2231 <xslo:call-template name="chopPunctuation">
2232 <xslo:with-param name="chopString">
2233 <xslo:value-of select="."/>
2234 </xslo:with-param>
2235 </xslo:call-template>
2236 </xslo:if>
2237 </xslo:for-each>
2238 </xslo:variable>
2239 <xslo:value-of select="normalize-space($raw_heading)"/>
2240 </z:index>
2241 </xslo:template>
2242 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='182']">
2243 <z:index name="Match-subdivision:p Match-subdivision:s">
2244 <xslo:variable name="raw_heading">
2245 <xslo:for-each select="marc:subfield">
2246 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision:p Match-subdivision:s">
2247 <xslo:if test="position() &gt; 1">
2248 <xslo:choose>
2249 <xslo:when test="contains('vxyz', @code)">
2250 <xslo:choose>
2251 <xslo:when test="@code = $general_subdivision_subfield">
2252 <xslo:text> generalsubdiv </xslo:text>
2253 </xslo:when>
2254 <xslo:when test="@code = $form_subdivision_subfield">
2255 <xslo:text> formsubdiv </xslo:text>
2256 </xslo:when>
2257 <xslo:when test="@code = $chronological_subdivision_subfield">
2258 <xslo:text> chronologicalsubdiv </xslo:text>
2259 </xslo:when>
2260 <xslo:when test="@code = $geographic_subdivision_subfield">
2261 <xslo:text> geographicsubdiv </xslo:text>
2262 </xslo:when>
2263 </xslo:choose>
2264 </xslo:when>
2265 <xslo:otherwise>
2266 <xslo:value-of select="substring(' ', 1, 1)"/>
2267 </xslo:otherwise>
2268 </xslo:choose>
2269 </xslo:if>
2270 <xslo:call-template name="chopPunctuation">
2271 <xslo:with-param name="chopString">
2272 <xslo:value-of select="."/>
2273 </xslo:with-param>
2274 </xslo:call-template>
2275 </xslo:if>
2276 </xslo:for-each>
2277 </xslo:variable>
2278 <xslo:value-of select="normalize-space($raw_heading)"/>
2279 </z:index>
2280 </xslo:template>
2281 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='482']">
2282 <z:index name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2283 <xslo:variable name="raw_heading">
2284 <xslo:for-each select="marc:subfield">
2285 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2286 <xslo:if test="position() &gt; 1">
2287 <xslo:choose>
2288 <xslo:when test="contains('vxyz', @code)">
2289 <xslo:choose>
2290 <xslo:when test="@code = $general_subdivision_subfield">
2291 <xslo:text> generalsubdiv </xslo:text>
2292 </xslo:when>
2293 <xslo:when test="@code = $form_subdivision_subfield">
2294 <xslo:text> formsubdiv </xslo:text>
2295 </xslo:when>
2296 <xslo:when test="@code = $chronological_subdivision_subfield">
2297 <xslo:text> chronologicalsubdiv </xslo:text>
2298 </xslo:when>
2299 <xslo:when test="@code = $geographic_subdivision_subfield">
2300 <xslo:text> geographicsubdiv </xslo:text>
2301 </xslo:when>
2302 </xslo:choose>
2303 </xslo:when>
2304 <xslo:otherwise>
2305 <xslo:value-of select="substring(' ', 1, 1)"/>
2306 </xslo:otherwise>
2307 </xslo:choose>
2308 </xslo:if>
2309 <xslo:call-template name="chopPunctuation">
2310 <xslo:with-param name="chopString">
2311 <xslo:value-of select="."/>
2312 </xslo:with-param>
2313 </xslo:call-template>
2314 </xslo:if>
2315 </xslo:for-each>
2316 </xslo:variable>
2317 <xslo:value-of select="normalize-space($raw_heading)"/>
2318 </z:index>
2319 </xslo:template>
2320 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='485']">
2321 <z:index name="Match-subdivision:p Match-subdivision:s">
2322 <xslo:variable name="raw_heading">
2323 <xslo:for-each select="marc:subfield">
2324 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision:p Match-subdivision:s">
2325 <xslo:if test="position() &gt; 1">
2326 <xslo:choose>
2327 <xslo:when test="contains('vxyz', @code)">
2328 <xslo:choose>
2329 <xslo:when test="@code = $general_subdivision_subfield">
2330 <xslo:text> generalsubdiv </xslo:text>
2331 </xslo:when>
2332 <xslo:when test="@code = $form_subdivision_subfield">
2333 <xslo:text> formsubdiv </xslo:text>
2334 </xslo:when>
2335 <xslo:when test="@code = $chronological_subdivision_subfield">
2336 <xslo:text> chronologicalsubdiv </xslo:text>
2337 </xslo:when>
2338 <xslo:when test="@code = $geographic_subdivision_subfield">
2339 <xslo:text> geographicsubdiv </xslo:text>
2340 </xslo:when>
2341 </xslo:choose>
2342 </xslo:when>
2343 <xslo:otherwise>
2344 <xslo:value-of select="substring(' ', 1, 1)"/>
2345 </xslo:otherwise>
2346 </xslo:choose>
2347 </xslo:if>
2348 <xslo:call-template name="chopPunctuation">
2349 <xslo:with-param name="chopString">
2350 <xslo:value-of select="."/>
2351 </xslo:with-param>
2352 </xslo:call-template>
2353 </xslo:if>
2354 </xslo:for-each>
2355 </xslo:variable>
2356 <xslo:value-of select="normalize-space($raw_heading)"/>
2357 </z:index>
2358 </xslo:template>
2359 <xslo:template mode="index_match_heading" match="marc:datafield[@tag='185']">
2360 <z:index name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2361 <xslo:variable name="raw_heading">
2362 <xslo:for-each select="marc:subfield">
2363 <xslo:if test="contains('vxyz', @code)" name="Match-subdivision-see-from:p Match-subdivision-see-from:s">
2364 <xslo:if test="position() &gt; 1">
2365 <xslo:choose>
2366 <xslo:when test="contains('vxyz', @code)">
2367 <xslo:choose>
2368 <xslo:when test="@code = $general_subdivision_subfield">
2369 <xslo:text> generalsubdiv </xslo:text>
2370 </xslo:when>
2371 <xslo:when test="@code = $form_subdivision_subfield">
2372 <xslo:text> formsubdiv </xslo:text>
2373 </xslo:when>
2374 <xslo:when test="@code = $chronological_subdivision_subfield">
2375 <xslo:text> chronologicalsubdiv </xslo:text>
2376 </xslo:when>
2377 <xslo:when test="@code = $geographic_subdivision_subfield">
2378 <xslo:text> geographicsubdiv </xslo:text>
2379 </xslo:when>
2380 </xslo:choose>
2381 </xslo:when>
2382 <xslo:otherwise>
2383 <xslo:value-of select="substring(' ', 1, 1)"/>
2384 </xslo:otherwise>
2385 </xslo:choose>
2386 </xslo:if>
2387 <xslo:call-template name="chopPunctuation">
2388 <xslo:with-param name="chopString">
2389 <xslo:value-of select="."/>
2390 </xslo:with-param>
2391 </xslo:call-template>
2392 </xslo:if>
2393 </xslo:for-each>
2394 </xslo:variable>
2395 <xslo:value-of select="normalize-space($raw_heading)"/>
2396 </z:index>
2397 </xslo:template>
2398 <xslo:variable name="form_subdivision_subfield">v</xslo:variable>
2399 <xslo:variable name="general_subdivision_subfield">x</xslo:variable>
2400 <xslo:variable name="chronological_subdivision_subfield">y</xslo:variable>
2401 <xslo:variable name="geographic_subdivision_subfield">z</xslo:variable>
2402 <xslo:template mode="index_subject_thesaurus" match="marc:controlfield[@tag='008']">
2403 <xslo:variable name="thesaurus_code1" select="substring(., 12, 1)"/>
2404 <xslo:variable name="full_thesaurus_code">
2405 <xslo:choose>
2406 <xslo:when test="$thesaurus_code1 = 'a'">
2407 <xslo:text>lcsh</xslo:text>
2408 </xslo:when>
2409 <xslo:when test="$thesaurus_code1 = 'b'">
2410 <xslo:text>lcac</xslo:text>
2411 </xslo:when>
2412 <xslo:when test="$thesaurus_code1 = 'c'">
2413 <xslo:text>mesh</xslo:text>
2414 </xslo:when>
2415 <xslo:when test="$thesaurus_code1 = 'd'">
2416 <xslo:text>nal</xslo:text>
2417 </xslo:when>
2418 <xslo:when test="$thesaurus_code1 = 'k'">
2419 <xslo:text>cash</xslo:text>
2420 </xslo:when>
2421 <xslo:when test="$thesaurus_code1 = 'n'">
2422 <xslo:text>notapplicable</xslo:text>
2423 </xslo:when>
2424 <xslo:when test="$thesaurus_code1 = 'r'">
2425 <xslo:text>aat</xslo:text>
2426 </xslo:when>
2427 <xslo:when test="$thesaurus_code1 = 's'">
2428 <xslo:text>sears</xslo:text>
2429 </xslo:when>
2430 <xslo:when test="$thesaurus_code1 = 'v'">
2431 <xslo:text>rvm</xslo:text>
2432 </xslo:when>
2433 <xslo:when test="$thesaurus_code1 = 'z'">
2434 <xslo:choose>
2435 <xslo:when test="//marc:datafield[@tag='040']/marc:subfield[@code='f']">
2436 <xslo:value-of select="//marc:datafield[@tag='040']/marc:subfield[@code='f']"/>
2437 </xslo:when>
2438 <xslo:otherwise>
2439 <xslo:text>notdefined</xslo:text>
2440 </xslo:otherwise>
2441 </xslo:choose>
2442 </xslo:when>
2443 <xslo:otherwise>
2444 <xslo:text>notdefined</xslo:text>
2445 </xslo:otherwise>
2446 </xslo:choose>
2447 </xslo:variable>
2448 <z:index name="Subject-heading-thesaurus:w">
2449 <xslo:value-of select="$full_thesaurus_code"/>
2450 </z:index>
2451 </xslo:template>
2452 <xslo:template mode="index_all" match="text()">
2453 <z:index name="Any:w Any:p">
2454 <xslo:value-of select="."/>
2455 </z:index>
2456 </xslo:template>
2457 <xslo:template name="chopPunctuation">
2458 <xslo:param name="chopString"/>
2459 <xslo:variable name="length" select="string-length($chopString)"/>
2460 <xslo:choose>
2461 <xslo:when test="$length=0"/>
2462 <xslo:when test="contains('-,.:=;!%/', substring($chopString,$length,1))">
2463 <xslo:call-template name="chopPunctuation">
2464 <xslo:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
2465 </xslo:call-template>
2466 </xslo:when>
2467 <xslo:when test="not($chopString)"/>
2468 <xslo:otherwise>
2469 <xslo:value-of select="$chopString"/>
2470 </xslo:otherwise>
2471 </xslo:choose>
2472 <xslo:text/>
2473 </xslo:template>
2474 </xslo:stylesheet>