Bug 13163: NORMARC DOM config missing <id> entry
[koha.git] / etc / zebradb / marc_defs / normarc / biblios / biblio-zebra-indexdefs.xsl
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_facets"/>
16   <xslo:template match="text()" mode="index_heading"/>
17   <xslo:template match="text()" mode="index_heading_conditional"/>
18   <xslo:template match="text()" mode="index_match_heading"/>
19   <xslo:template match="text()" mode="index_subject_thesaurus"/>
20   <xslo:template match="/">
21     <xslo:if test="marc:collection">
22       <collection>
23         <xslo:apply-templates select="marc:collection/marc:record"/>
24       </collection>
25     </xslo:if>
26     <xslo:if test="marc:record">
27       <xslo:apply-templates select="marc:record"/>
28     </xslo:if>
29   </xslo:template>
30   <xslo:template match="marc:record">
31     <xslo:variable name="idfield" select="normalize-space(marc:datafield[@tag='999']/marc:subfield[@code='c'])"/>
32     <z:record type="update">
33       <xslo:attribute name="z:id">
34         <xslo:value-of select="$idfield"/>
35       </xslo:attribute>
36       <xslo:apply-templates/>
37       <xslo:apply-templates mode="index_subfields"/>
38       <xslo:apply-templates mode="index_data_field"/>
39       <xslo:apply-templates mode="index_facets"/>
40       <xslo:apply-templates mode="index_heading"/>
41       <xslo:apply-templates mode="index_heading_conditional"/>
42       <xslo:apply-templates mode="index_match_heading"/>
43       <xslo:apply-templates mode="index_subject_thesaurus"/>
44       <xslo:apply-templates mode="index_all"/>
45     </z:record>
46   </xslo:template>
47   <xslo:template match="marc:leader">
48     <z:index name="llength:w">
49       <xslo:value-of select="substring(., 1, 5)"/>
50     </z:index>
51     <z:index name="rtype:w">
52       <xslo:value-of select="substring(., 7, 1)"/>
53     </z:index>
54     <z:index name="Bib-level:w">
55       <xslo:value-of select="substring(., 8, 1)"/>
56     </z:index>
57   </xslo:template>
58   <xslo:template match="marc:controlfield[@tag='001']">
59     <z:index name="Control-number:w">
60       <xslo:value-of select="."/>
61     </z:index>
62   </xslo:template>
63   <xslo:template match="marc:controlfield[@tag='007']">
64     <z:index name="Microform-generation:n">
65       <xslo:value-of select="substring(., 12, 1)"/>
66     </z:index>
67     <z:index name="Material-type:w">
68       <xslo:value-of select="."/>
69     </z:index>
70     <z:index name="ff7-00:w">
71       <xslo:value-of select="substring(., 1, 1)"/>
72     </z:index>
73     <z:index name="ff7-01:w">
74       <xslo:value-of select="substring(., 2, 1)"/>
75     </z:index>
76     <z:index name="ff7-02:w">
77       <xslo:value-of select="substring(., 3, 1)"/>
78     </z:index>
79     <z:index name="ff7-01-02:w">
80       <xslo:value-of select="substring(., 1, 2)"/>
81     </z:index>
82   </xslo:template>
83   <xslo:template match="marc:controlfield[@tag='008']">
84     <z:index name="date-entered-on-file:n">
85       <xslo:value-of select="substring(., 1, 5)"/>
86     </z:index>
87     <z:index name="date-entered-on-file:s">
88       <xslo:value-of select="substring(., 1, 5)"/>
89     </z:index>
90     <z:index name="pubdate:w">
91       <xslo:value-of select="substring(., 8, 4)"/>
92     </z:index>
93     <z:index name="pubdate:n">
94       <xslo:value-of select="substring(., 8, 4)"/>
95     </z:index>
96     <z:index name="pubdate:y">
97       <xslo:value-of select="substring(., 8, 4)"/>
98     </z:index>
99     <z:index name="pubdate:s">
100       <xslo:value-of select="substring(., 8, 4)"/>
101     </z:index>
102     <z:index name="pl:w">
103       <xslo:value-of select="substring(., 16, 3)"/>
104     </z:index>
105     <z:index name="ta:w">
106       <xslo:value-of select="substring(., 23, 1)"/>
107     </z:index>
108     <z:index name="ff8-23:w">
109       <xslo:value-of select="substring(., 24, 1)"/>
110     </z:index>
111     <z:index name="ff8-29:w">
112       <xslo:value-of select="substring(., 30, 1)"/>
113     </z:index>
114     <z:index name="lf:w">
115       <xslo:value-of select="substring(., 34, 1)"/>
116     </z:index>
117     <z:index name="bio:w">
118       <xslo:value-of select="substring(., 35, 1)"/>
119     </z:index>
120     <z:index name="ln:n">
121       <xslo:value-of select="substring(., 36, 3)"/>
122     </z:index>
123     <z:index name="ctype:w">
124       <xslo:value-of select="substring(., 25, 4)"/>
125     </z:index>
126     <z:index name="Record-source:w">
127       <xslo:value-of select="substring(., 40, 0)"/>
128     </z:index>
129   </xslo:template>
130   <xslo:template mode="index_subfields" match="marc:datafield[@tag='020']">
131     <xslo:for-each select="marc:subfield">
132       <xslo:if test="contains('a', @code)">
133         <z:index name="ISBN:w Identifier-standard:w">
134           <xslo:value-of select="."/>
135         </z:index>
136       </xslo:if>
137     </xslo:for-each>
138   </xslo:template>
139   <xslo:template mode="index_subfields" match="marc:datafield[@tag='022']">
140     <xslo:for-each select="marc:subfield">
141       <xslo:if test="contains('a', @code)">
142         <z:index name="ISSN:w ISBN:w">
143           <xslo:value-of select="."/>
144         </z:index>
145       </xslo:if>
146     </xslo:for-each>
147   </xslo:template>
148   <xslo:template mode="index_subfields" match="marc:datafield[@tag='100']">
149     <xslo:for-each select="marc:subfield">
150       <xslo:if test="contains('9', @code)">
151         <z:index name="Cross-Reference:w Koha-Auth-Number:w">
152           <xslo:value-of select="."/>
153         </z:index>
154       </xslo:if>
155     </xslo:for-each>
156     <xslo:for-each select="marc:subfield">
157       <xslo:if test="contains('a', @code)">
158         <z:index name="Author:w Author:p Author:s Editor:w Author-personal-bibliography:w Author-personal-bibliography:p Author-personal-bibliography:s">
159           <xslo:value-of select="."/>
160         </z:index>
161       </xslo:if>
162     </xslo:for-each>
163   </xslo:template>
164   <xslo:template mode="index_subfields" match="marc:datafield[@tag='110']">
165     <xslo:for-each select="marc:subfield">
166       <xslo:if test="contains('9', @code)">
167         <z:index name="Koha-Auth-Number:w">
168           <xslo:value-of select="."/>
169         </z:index>
170       </xslo:if>
171     </xslo:for-each>
172   </xslo:template>
173   <xslo:template mode="index_subfields" match="marc:datafield[@tag='111']">
174     <xslo:for-each select="marc:subfield">
175       <xslo:if test="contains('9', @code)">
176         <z:index name="Koha-Auth-Number:w">
177           <xslo:value-of select="."/>
178         </z:index>
179       </xslo:if>
180     </xslo:for-each>
181   </xslo:template>
182   <xslo:template mode="index_subfields" match="marc:datafield[@tag='130']">
183     <xslo:for-each select="marc:subfield">
184       <xslo:if test="contains('i', @code)">
185         <z:index name="Thematic-number:w">
186           <xslo:value-of select="."/>
187         </z:index>
188       </xslo:if>
189     </xslo:for-each>
190     <xslo:for-each select="marc:subfield">
191       <xslo:if test="contains('n', @code)">
192         <z:index name="Thematic-number:w">
193           <xslo:value-of select="."/>
194         </z:index>
195       </xslo:if>
196     </xslo:for-each>
197     <xslo:for-each select="marc:subfield">
198       <xslo:if test="contains('r', @code)">
199         <z:index name="Music-key:w">
200           <xslo:value-of select="."/>
201         </z:index>
202       </xslo:if>
203     </xslo:for-each>
204     <xslo:for-each select="marc:subfield">
205       <xslo:if test="contains('9', @code)">
206         <z:index name="Koha-Auth-Number:w">
207           <xslo:value-of select="."/>
208         </z:index>
209       </xslo:if>
210     </xslo:for-each>
211   </xslo:template>
212   <xslo:template mode="index_subfields" match="marc:datafield[@tag='240']">
213     <xslo:for-each select="marc:subfield">
214       <xslo:if test="contains('i', @code)">
215         <z:index name="Thematic-number:w">
216           <xslo:value-of select="."/>
217         </z:index>
218       </xslo:if>
219     </xslo:for-each>
220     <xslo:for-each select="marc:subfield">
221       <xslo:if test="contains('r', @code)">
222         <z:index name="Music-key:w">
223           <xslo:value-of select="."/>
224         </z:index>
225       </xslo:if>
226     </xslo:for-each>
227     <xslo:for-each select="marc:subfield">
228       <xslo:if test="contains('n', @code)">
229         <z:index name="Thematic-number:w">
230           <xslo:value-of select="."/>
231         </z:index>
232       </xslo:if>
233     </xslo:for-each>
234   </xslo:template>
235   <xslo:template mode="index_subfields" match="marc:datafield[@tag='245']">
236     <xslo:for-each select="marc:subfield">
237       <xslo:if test="contains('a', @code)">
238         <z:index name="Title-cover:w Title-cover:p Title-cover:s Title:w Title:p Title:s">
239           <xslo:value-of select="."/>
240         </z:index>
241       </xslo:if>
242     </xslo:for-each>
243     <xslo:for-each select="marc:subfield">
244       <xslo:if test="contains('c', @code)">
245         <z:index name="Author:w Author-in-order:w Author-in-order:p Author-in-order:s">
246           <xslo:value-of select="."/>
247         </z:index>
248       </xslo:if>
249     </xslo:for-each>
250     <xslo:for-each select="marc:subfield">
251       <xslo:if test="contains('9', @code)">
252         <z:index name="Cross-Reference:w Koha-Auth-Number:w">
253           <xslo:value-of select="."/>
254         </z:index>
255       </xslo:if>
256     </xslo:for-each>
257   </xslo:template>
258   <xslo:template mode="index_subfields" match="marc:datafield[@tag='260']">
259     <xslo:for-each select="marc:subfield">
260       <xslo:if test="contains('a', @code)">
261         <z:index name="pl:w pl:p">
262           <xslo:value-of select="."/>
263         </z:index>
264       </xslo:if>
265     </xslo:for-each>
266     <xslo:for-each select="marc:subfield">
267       <xslo:if test="contains('b', @code)">
268         <z:index name="Publisher:w Publisher:p">
269           <xslo:value-of select="."/>
270         </z:index>
271       </xslo:if>
272     </xslo:for-each>
273     <xslo:for-each select="marc:subfield">
274       <xslo:if test="contains('c', @code)">
275         <z:index name="copydate:w copydate:s">
276           <xslo:value-of select="."/>
277         </z:index>
278       </xslo:if>
279     </xslo:for-each>
280   </xslo:template>
281   <xslo:template mode="index_subfields" match="marc:datafield[@tag='440']">
282     <xslo:for-each select="marc:subfield">
283       <xslo:if test="contains('a', @code)">
284         <z:index name="Title-series:w Title-series:p">
285           <xslo:value-of select="."/>
286         </z:index>
287       </xslo:if>
288     </xslo:for-each>
289     <xslo:for-each select="marc:subfield">
290       <xslo:if test="contains('9', @code)">
291         <z:index name="Koha-Auth-Number:w">
292           <xslo:value-of select="."/>
293         </z:index>
294       </xslo:if>
295     </xslo:for-each>
296   </xslo:template>
297   <xslo:template mode="index_subfields" match="marc:datafield[@tag='490']">
298     <xslo:for-each select="marc:subfield">
299       <xslo:if test="contains('a', @code)">
300         <z:index name="Title-series:w Title-series:p">
301           <xslo:value-of select="."/>
302         </z:index>
303       </xslo:if>
304     </xslo:for-each>
305     <xslo:for-each select="marc:subfield">
306       <xslo:if test="contains('9', @code)">
307         <z:index name="Koha-Auth-Number:w">
308           <xslo:value-of select="."/>
309         </z:index>
310       </xslo:if>
311     </xslo:for-each>
312   </xslo:template>
313   <xslo:template mode="index_subfields" match="marc:datafield[@tag='600']">
314     <xslo:for-each select="marc:subfield">
315       <xslo:if test="contains('a', @code)">
316         <z:index name="Name-and-title:w Name:w Personal-name:w Subject-name-personal:w Subject:w Subject:p">
317           <xslo:value-of select="."/>
318         </z:index>
319       </xslo:if>
320     </xslo:for-each>
321     <xslo:for-each select="marc:subfield">
322       <xslo:if test="contains('t', @code)">
323         <z:index name="Name-and-title:w Title:w Subject:w Subject:p">
324           <xslo:value-of select="."/>
325         </z:index>
326       </xslo:if>
327     </xslo:for-each>
328     <xslo:for-each select="marc:subfield">
329       <xslo:if test="contains('9', @code)">
330         <z:index name="Koha-Auth-Number:w">
331           <xslo:value-of select="."/>
332         </z:index>
333       </xslo:if>
334     </xslo:for-each>
335   </xslo:template>
336   <xslo:template mode="index_subfields" match="marc:datafield[@tag='610']">
337     <xslo:for-each select="marc:subfield">
338       <xslo:if test="contains('a', @code)">
339         <z:index name="Name-and-title:w Subject:w Subject:p">
340           <xslo:value-of select="."/>
341         </z:index>
342       </xslo:if>
343     </xslo:for-each>
344     <xslo:for-each select="marc:subfield">
345       <xslo:if test="contains('t', @code)">
346         <z:index name="Name-and-title:w Title:w Subject:w Subject:p">
347           <xslo:value-of select="."/>
348         </z:index>
349       </xslo:if>
350     </xslo:for-each>
351     <xslo:for-each select="marc:subfield">
352       <xslo:if test="contains('9', @code)">
353         <z:index name="Koha-Auth-Number:w">
354           <xslo:value-of select="."/>
355         </z:index>
356       </xslo:if>
357     </xslo:for-each>
358   </xslo:template>
359   <xslo:template mode="index_subfields" match="marc:datafield[@tag='611']">
360     <xslo:for-each select="marc:subfield">
361       <xslo:if test="contains('a', @code)">
362         <z:index name="Name-and-title:w Subject:w Subject:p">
363           <xslo:value-of select="."/>
364         </z:index>
365       </xslo:if>
366     </xslo:for-each>
367     <xslo:for-each select="marc:subfield">
368       <xslo:if test="contains('t', @code)">
369         <z:index name="Name-and-title:w Title:w Subject:w Subject:p">
370           <xslo:value-of select="."/>
371         </z:index>
372       </xslo:if>
373     </xslo:for-each>
374     <xslo:for-each select="marc:subfield">
375       <xslo:if test="contains('9', @code)">
376         <z:index name="Koha-Auth-Number:w">
377           <xslo:value-of select="."/>
378         </z:index>
379       </xslo:if>
380     </xslo:for-each>
381   </xslo:template>
382   <xslo:template mode="index_subfields" match="marc:datafield[@tag='630']">
383     <xslo:for-each select="marc:subfield">
384       <xslo:if test="contains('i', @code)">
385         <z:index name="Thematic-number:w Subject:w Subject:p">
386           <xslo:value-of select="."/>
387         </z:index>
388       </xslo:if>
389     </xslo:for-each>
390     <xslo:for-each select="marc:subfield">
391       <xslo:if test="contains('n', @code)">
392         <z:index name="Thematic-number:w Subject:w Subject:p">
393           <xslo:value-of select="."/>
394         </z:index>
395       </xslo:if>
396     </xslo:for-each>
397     <xslo:for-each select="marc:subfield">
398       <xslo:if test="contains('r', @code)">
399         <z:index name="Music-key:w Subject:w Subject:p">
400           <xslo:value-of select="."/>
401         </z:index>
402       </xslo:if>
403     </xslo:for-each>
404     <xslo:for-each select="marc:subfield">
405       <xslo:if test="contains('9', @code)">
406         <z:index name="Koha-Auth-Number:w">
407           <xslo:value-of select="."/>
408         </z:index>
409       </xslo:if>
410     </xslo:for-each>
411   </xslo:template>
412   <xslo:template mode="index_subfields" match="marc:datafield[@tag='650']">
413     <xslo:for-each select="marc:subfield">
414       <xslo:if test="contains('9', @code)">
415         <z:index name="Koha-Auth-Number:w">
416           <xslo:value-of select="."/>
417         </z:index>
418       </xslo:if>
419     </xslo:for-each>
420   </xslo:template>
421   <xslo:template mode="index_subfields" match="marc:datafield[@tag='651']">
422     <xslo:for-each select="marc:subfield">
423       <xslo:if test="contains('9', @code)">
424         <z:index name="Koha-Auth-Number:w">
425           <xslo:value-of select="."/>
426         </z:index>
427       </xslo:if>
428     </xslo:for-each>
429   </xslo:template>
430   <xslo:template mode="index_subfields" match="marc:datafield[@tag='652']">
431     <xslo:for-each select="marc:subfield">
432       <xslo:if test="contains('9', @code)">
433         <z:index name="Koha-Auth-Number:w">
434           <xslo:value-of select="."/>
435         </z:index>
436       </xslo:if>
437     </xslo:for-each>
438   </xslo:template>
439   <xslo:template mode="index_subfields" match="marc:datafield[@tag='653']">
440     <xslo:for-each select="marc:subfield">
441       <xslo:if test="contains('9', @code)">
442         <z:index name="Koha-Auth-Number:w">
443           <xslo:value-of select="."/>
444         </z:index>
445       </xslo:if>
446     </xslo:for-each>
447   </xslo:template>
448   <xslo:template mode="index_subfields" match="marc:datafield[@tag='654']">
449     <xslo:for-each select="marc:subfield">
450       <xslo:if test="contains('9', @code)">
451         <z:index name="Koha-Auth-Number:w">
452           <xslo:value-of select="."/>
453         </z:index>
454       </xslo:if>
455     </xslo:for-each>
456   </xslo:template>
457   <xslo:template mode="index_subfields" match="marc:datafield[@tag='655']">
458     <xslo:for-each select="marc:subfield">
459       <xslo:if test="contains('9', @code)">
460         <z:index name="Koha-Auth-Number:w">
461           <xslo:value-of select="."/>
462         </z:index>
463       </xslo:if>
464     </xslo:for-each>
465   </xslo:template>
466   <xslo:template mode="index_subfields" match="marc:datafield[@tag='656']">
467     <xslo:for-each select="marc:subfield">
468       <xslo:if test="contains('9', @code)">
469         <z:index name="Koha-Auth-Number:w">
470           <xslo:value-of select="."/>
471         </z:index>
472       </xslo:if>
473     </xslo:for-each>
474   </xslo:template>
475   <xslo:template mode="index_subfields" match="marc:datafield[@tag='657']">
476     <xslo:for-each select="marc:subfield">
477       <xslo:if test="contains('9', @code)">
478         <z:index name="Koha-Auth-Number:w">
479           <xslo:value-of select="."/>
480         </z:index>
481       </xslo:if>
482     </xslo:for-each>
483   </xslo:template>
484   <xslo:template mode="index_subfields" match="marc:datafield[@tag='690']">
485     <xslo:for-each select="marc:subfield">
486       <xslo:if test="contains('9', @code)">
487         <z:index name="Koha-Auth-Number:w">
488           <xslo:value-of select="."/>
489         </z:index>
490       </xslo:if>
491     </xslo:for-each>
492   </xslo:template>
493   <xslo:template mode="index_subfields" match="marc:datafield[@tag='700']">
494     <xslo:for-each select="marc:subfield">
495       <xslo:if test="contains('9', @code)">
496         <z:index name="Cross-Reference:w Koha-Auth-Number:w">
497           <xslo:value-of select="."/>
498         </z:index>
499       </xslo:if>
500     </xslo:for-each>
501     <xslo:for-each select="marc:subfield">
502       <xslo:if test="contains('a', @code)">
503         <z:index name="Author:w Author:p">
504           <xslo:value-of select="."/>
505         </z:index>
506       </xslo:if>
507     </xslo:for-each>
508     <xslo:for-each select="marc:subfield">
509       <xslo:if test="contains('i', @code)">
510         <z:index name="Thematic-number:w">
511           <xslo:value-of select="."/>
512         </z:index>
513       </xslo:if>
514     </xslo:for-each>
515     <xslo:for-each select="marc:subfield">
516       <xslo:if test="contains('n', @code)">
517         <z:index name="Thematic-number:w">
518           <xslo:value-of select="."/>
519         </z:index>
520       </xslo:if>
521     </xslo:for-each>
522     <xslo:for-each select="marc:subfield">
523       <xslo:if test="contains('r', @code)">
524         <z:index name="Music-key:w">
525           <xslo:value-of select="."/>
526         </z:index>
527       </xslo:if>
528     </xslo:for-each>
529     <xslo:for-each select="marc:subfield">
530       <xslo:if test="contains('t', @code)">
531         <z:index name="Author-title:w Name-and-title:w Title:w Title-uniform:w">
532           <xslo:value-of select="."/>
533         </z:index>
534       </xslo:if>
535     </xslo:for-each>
536   </xslo:template>
537   <xslo:template mode="index_subfields" match="marc:datafield[@tag='710']">
538     <xslo:for-each select="marc:subfield">
539       <xslo:if test="contains('t', @code)">
540         <z:index name="Author-title:w Name-and-title:w Title:w Title-uniform:w">
541           <xslo:value-of select="."/>
542         </z:index>
543       </xslo:if>
544     </xslo:for-each>
545     <xslo:for-each select="marc:subfield">
546       <xslo:if test="contains('a', @code)">
547         <z:index name="Name-and-title:w">
548           <xslo:value-of select="."/>
549         </z:index>
550       </xslo:if>
551     </xslo:for-each>
552     <xslo:for-each select="marc:subfield">
553       <xslo:if test="contains('i', @code)">
554         <z:index name="Thematic-number:w">
555           <xslo:value-of select="."/>
556         </z:index>
557       </xslo:if>
558     </xslo:for-each>
559     <xslo:for-each select="marc:subfield">
560       <xslo:if test="contains('9', @code)">
561         <z:index name="Koha-Auth-Number:w">
562           <xslo:value-of select="."/>
563         </z:index>
564       </xslo:if>
565     </xslo:for-each>
566   </xslo:template>
567   <xslo:template mode="index_subfields" match="marc:datafield[@tag='711']">
568     <xslo:for-each select="marc:subfield">
569       <xslo:if test="contains('a', @code)">
570         <z:index name="Name-and-title:w">
571           <xslo:value-of select="."/>
572         </z:index>
573       </xslo:if>
574     </xslo:for-each>
575     <xslo:for-each select="marc:subfield">
576       <xslo:if test="contains('t', @code)">
577         <z:index name="Author-title:w Title:w Title-uniform:w">
578           <xslo:value-of select="."/>
579         </z:index>
580       </xslo:if>
581     </xslo:for-each>
582     <xslo:for-each select="marc:subfield">
583       <xslo:if test="contains('9', @code)">
584         <z:index name="Koha-Auth-Number:w">
585           <xslo:value-of select="."/>
586         </z:index>
587       </xslo:if>
588     </xslo:for-each>
589   </xslo:template>
590   <xslo:template mode="index_subfields" match="marc:datafield[@tag='730']">
591     <xslo:for-each select="marc:subfield">
592       <xslo:if test="contains('i', @code)">
593         <z:index name="Thematic-number:w">
594           <xslo:value-of select="."/>
595         </z:index>
596       </xslo:if>
597     </xslo:for-each>
598     <xslo:for-each select="marc:subfield">
599       <xslo:if test="contains('n', @code)">
600         <z:index name="Thematic-number:w">
601           <xslo:value-of select="."/>
602         </z:index>
603       </xslo:if>
604     </xslo:for-each>
605     <xslo:for-each select="marc:subfield">
606       <xslo:if test="contains('r', @code)">
607         <z:index name="Music-key:w">
608           <xslo:value-of select="."/>
609         </z:index>
610       </xslo:if>
611     </xslo:for-each>
612     <xslo:for-each select="marc:subfield">
613       <xslo:if test="contains('9', @code)">
614         <z:index name="Koha-Auth-Number:w">
615           <xslo:value-of select="."/>
616         </z:index>
617       </xslo:if>
618     </xslo:for-each>
619   </xslo:template>
620   <xslo:template mode="index_subfields" match="marc:datafield[@tag='773']">
621     <xslo:for-each select="marc:subfield">
622       <xslo:if test="contains('a', @code)">
623         <z:index name="Host-item:w">
624           <xslo:value-of select="."/>
625         </z:index>
626       </xslo:if>
627     </xslo:for-each>
628     <xslo:for-each select="marc:subfield">
629       <xslo:if test="contains('9', @code)">
630         <z:index name="Host-Item-Number:w">
631           <xslo:value-of select="."/>
632         </z:index>
633       </xslo:if>
634     </xslo:for-each>
635     <xslo:for-each select="marc:subfield">
636       <xslo:if test="contains('t', @code)">
637         <z:index name="Host-item:w">
638           <xslo:value-of select="."/>
639         </z:index>
640       </xslo:if>
641     </xslo:for-each>
642     <xslo:for-each select="marc:subfield">
643       <xslo:if test="contains('w', @code)">
644         <z:index name="Record-control-number:w">
645           <xslo:value-of select="."/>
646         </z:index>
647       </xslo:if>
648     </xslo:for-each>
649   </xslo:template>
650   <xslo:template mode="index_subfields" match="marc:datafield[@tag='780']">
651     <xslo:for-each select="marc:subfield">
652       <xslo:if test="contains('t', @code)">
653         <z:index name="Title:w">
654           <xslo:value-of select="."/>
655         </z:index>
656       </xslo:if>
657     </xslo:for-each>
658   </xslo:template>
659   <xslo:template mode="index_subfields" match="marc:datafield[@tag='800']">
660     <xslo:for-each select="marc:subfield">
661       <xslo:if test="contains('a', @code)">
662         <z:index name="Name-and-title:w">
663           <xslo:value-of select="."/>
664         </z:index>
665       </xslo:if>
666     </xslo:for-each>
667     <xslo:for-each select="marc:subfield">
668       <xslo:if test="contains('t', @code)">
669         <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w">
670           <xslo:value-of select="."/>
671         </z:index>
672       </xslo:if>
673     </xslo:for-each>
674     <xslo:for-each select="marc:subfield">
675       <xslo:if test="contains('9', @code)">
676         <z:index name="Koha-Auth-Number:w">
677           <xslo:value-of select="."/>
678         </z:index>
679       </xslo:if>
680     </xslo:for-each>
681   </xslo:template>
682   <xslo:template mode="index_subfields" match="marc:datafield[@tag='810']">
683     <xslo:for-each select="marc:subfield">
684       <xslo:if test="contains('a', @code)">
685         <z:index name="Name-and-title:w">
686           <xslo:value-of select="."/>
687         </z:index>
688       </xslo:if>
689     </xslo:for-each>
690     <xslo:for-each select="marc:subfield">
691       <xslo:if test="contains('t', @code)">
692         <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w">
693           <xslo:value-of select="."/>
694         </z:index>
695       </xslo:if>
696     </xslo:for-each>
697     <xslo:for-each select="marc:subfield">
698       <xslo:if test="contains('9', @code)">
699         <z:index name="Koha-Auth-Number:w">
700           <xslo:value-of select="."/>
701         </z:index>
702       </xslo:if>
703     </xslo:for-each>
704   </xslo:template>
705   <xslo:template mode="index_subfields" match="marc:datafield[@tag='811']">
706     <xslo:for-each select="marc:subfield">
707       <xslo:if test="contains('a', @code)">
708         <z:index name="Name-and-title:w">
709           <xslo:value-of select="."/>
710         </z:index>
711       </xslo:if>
712     </xslo:for-each>
713     <xslo:for-each select="marc:subfield">
714       <xslo:if test="contains('9', @code)">
715         <z:index name="Koha-Auth-Number:w">
716           <xslo:value-of select="."/>
717         </z:index>
718       </xslo:if>
719     </xslo:for-each>
720     <xslo:for-each select="marc:subfield">
721       <xslo:if test="contains('t', @code)">
722         <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w">
723           <xslo:value-of select="."/>
724         </z:index>
725       </xslo:if>
726     </xslo:for-each>
727   </xslo:template>
728   <xslo:template mode="index_subfields" match="marc:datafield[@tag='830']">
729     <xslo:for-each select="marc:subfield">
730       <xslo:if test="contains('9', @code)">
731         <z:index name="Koha-Auth-Number:w">
732           <xslo:value-of select="."/>
733         </z:index>
734       </xslo:if>
735     </xslo:for-each>
736   </xslo:template>
737   <xslo:template mode="index_subfields" match="marc:datafield[@tag='999']">
738     <xslo:for-each select="marc:subfield">
739       <xslo:if test="contains('c', @code)">
740         <z:index name="Local-Number:n Local-Number:w Local-Number:s">
741           <xslo:value-of select="."/>
742         </z:index>
743       </xslo:if>
744     </xslo:for-each>
745     <xslo:for-each select="marc:subfield">
746       <xslo:if test="contains('d', @code)">
747         <z:index name="biblioitemnumber:n biblioitemnumber:w biblioitemnumber:s">
748           <xslo:value-of select="."/>
749         </z:index>
750       </xslo:if>
751     </xslo:for-each>
752   </xslo:template>
753   <xslo:template mode="index_subfields" match="marc:datafield[@tag='942']">
754     <xslo:for-each select="marc:subfield">
755       <xslo:if test="contains('0', @code)">
756         <z:index name="totalissues:n totalissues:s">
757           <xslo:value-of select="."/>
758         </z:index>
759       </xslo:if>
760     </xslo:for-each>
761     <xslo:for-each select="marc:subfield">
762       <xslo:if test="contains('2', @code)">
763         <z:index name="cn-bib-source:w">
764           <xslo:value-of select="."/>
765         </z:index>
766       </xslo:if>
767     </xslo:for-each>
768     <xslo:for-each select="marc:subfield">
769       <xslo:if test="contains('6', @code)">
770         <z:index name="cn-bib-sort:n cn-bib-sort:s">
771           <xslo:value-of select="."/>
772         </z:index>
773       </xslo:if>
774     </xslo:for-each>
775     <xslo:for-each select="marc:subfield">
776       <xslo:if test="contains('c', @code)">
777         <z:index name="itemtype:w">
778           <xslo:value-of select="."/>
779         </z:index>
780       </xslo:if>
781     </xslo:for-each>
782     <xslo:for-each select="marc:subfield">
783       <xslo:if test="contains('n', @code)">
784         <z:index name="Suppress:w Suppress:n">
785           <xslo:value-of select="."/>
786         </z:index>
787       </xslo:if>
788     </xslo:for-each>
789     <xslo:for-each select="marc:subfield">
790       <xslo:if test="contains('h', @code)">
791         <z:index name="cn-class:w">
792           <xslo:value-of select="."/>
793         </z:index>
794       </xslo:if>
795     </xslo:for-each>
796     <xslo:for-each select="marc:subfield">
797       <xslo:if test="contains('i', @code)">
798         <z:index name="cn-item:w">
799           <xslo:value-of select="."/>
800         </z:index>
801       </xslo:if>
802     </xslo:for-each>
803     <xslo:for-each select="marc:subfield">
804       <xslo:if test="contains('k', @code)">
805         <z:index name="cn-prefix:w">
806           <xslo:value-of select="."/>
807         </z:index>
808       </xslo:if>
809     </xslo:for-each>
810     <xslo:for-each select="marc:subfield">
811       <xslo:if test="contains('m', @code)">
812         <z:index name="cn-suffix:w">
813           <xslo:value-of select="."/>
814         </z:index>
815       </xslo:if>
816     </xslo:for-each>
817   </xslo:template>
818   <xslo:template mode="index_subfields" match="marc:datafield[@tag='952']">
819     <xslo:for-each select="marc:subfield">
820       <xslo:if test="contains('0', @code)">
821         <z:index name="withdrawn:n withdrawn:w">
822           <xslo:value-of select="."/>
823         </z:index>
824       </xslo:if>
825     </xslo:for-each>
826     <xslo:for-each select="marc:subfield">
827       <xslo:if test="contains('1', @code)">
828         <z:index name="lost:w lost:n">
829           <xslo:value-of select="."/>
830         </z:index>
831       </xslo:if>
832     </xslo:for-each>
833     <xslo:for-each select="marc:subfield">
834       <xslo:if test="contains('2', @code)">
835         <z:index name="classification-source:w">
836           <xslo:value-of select="."/>
837         </z:index>
838       </xslo:if>
839     </xslo:for-each>
840     <xslo:for-each select="marc:subfield">
841       <xslo:if test="contains('3', @code)">
842         <z:index name="materials-specified:w">
843           <xslo:value-of select="."/>
844         </z:index>
845       </xslo:if>
846     </xslo:for-each>
847     <xslo:for-each select="marc:subfield">
848       <xslo:if test="contains('4', @code)">
849         <z:index name="damaged:n damaged:w">
850           <xslo:value-of select="."/>
851         </z:index>
852       </xslo:if>
853     </xslo:for-each>
854     <xslo:for-each select="marc:subfield">
855       <xslo:if test="contains('5', @code)">
856         <z:index name="restricted:n restricted:w">
857           <xslo:value-of select="."/>
858         </z:index>
859       </xslo:if>
860     </xslo:for-each>
861     <xslo:for-each select="marc:subfield">
862       <xslo:if test="contains('6', @code)">
863         <z:index name="cn-sort:n cn-sort:s">
864           <xslo:value-of select="."/>
865         </z:index>
866       </xslo:if>
867     </xslo:for-each>
868     <xslo:for-each select="marc:subfield">
869       <xslo:if test="contains('7', @code)">
870         <z:index name="notforloan:n notforloan:w">
871           <xslo:value-of select="."/>
872         </z:index>
873       </xslo:if>
874     </xslo:for-each>
875     <xslo:for-each select="marc:subfield">
876       <xslo:if test="contains('8', @code)">
877         <z:index name="ccode:w">
878           <xslo:value-of select="."/>
879         </z:index>
880       </xslo:if>
881     </xslo:for-each>
882     <xslo:for-each select="marc:subfield">
883       <xslo:if test="contains('9', @code)">
884         <z:index name="itemnumber:n itemnumber:s">
885           <xslo:value-of select="."/>
886         </z:index>
887       </xslo:if>
888     </xslo:for-each>
889     <xslo:for-each select="marc:subfield">
890       <xslo:if test="contains('a', @code)">
891         <z:index name="homebranch:w">
892           <xslo:value-of select="."/>
893         </z:index>
894       </xslo:if>
895     </xslo:for-each>
896     <xslo:for-each select="marc:subfield">
897       <xslo:if test="contains('b', @code)">
898         <z:index name="holdingbranch:w">
899           <xslo:value-of select="."/>
900         </z:index>
901       </xslo:if>
902     </xslo:for-each>
903     <xslo:for-each select="marc:subfield">
904       <xslo:if test="contains('c', @code)">
905         <z:index name="location:w">
906           <xslo:value-of select="."/>
907         </z:index>
908       </xslo:if>
909     </xslo:for-each>
910     <xslo:for-each select="marc:subfield">
911       <xslo:if test="contains('d', @code)">
912         <z:index name="Date-of-acquisition:w Date-of-acquisition:d Date-of-acquisition:s">
913           <xslo:value-of select="."/>
914         </z:index>
915       </xslo:if>
916     </xslo:for-each>
917     <xslo:for-each select="marc:subfield">
918       <xslo:if test="contains('e', @code)">
919         <z:index name="acqsource:w">
920           <xslo:value-of select="."/>
921         </z:index>
922       </xslo:if>
923     </xslo:for-each>
924     <xslo:for-each select="marc:subfield">
925       <xslo:if test="contains('f', @code)">
926         <z:index name="coded-location-qualifier:w">
927           <xslo:value-of select="."/>
928         </z:index>
929       </xslo:if>
930     </xslo:for-each>
931     <xslo:for-each select="marc:subfield">
932       <xslo:if test="contains('g', @code)">
933         <z:index name="price:w">
934           <xslo:value-of select="."/>
935         </z:index>
936       </xslo:if>
937     </xslo:for-each>
938     <xslo:for-each select="marc:subfield">
939       <xslo:if test="contains('j', @code)">
940         <z:index name="stack:n stack:w">
941           <xslo:value-of select="."/>
942         </z:index>
943       </xslo:if>
944     </xslo:for-each>
945     <xslo:for-each select="marc:subfield">
946       <xslo:if test="contains('l', @code)">
947         <z:index name="issues:n issues:w issues:s">
948           <xslo:value-of select="."/>
949         </z:index>
950       </xslo:if>
951     </xslo:for-each>
952     <xslo:for-each select="marc:subfield">
953       <xslo:if test="contains('m', @code)">
954         <z:index name="renewals:n renewals:w">
955           <xslo:value-of select="."/>
956         </z:index>
957       </xslo:if>
958     </xslo:for-each>
959     <xslo:for-each select="marc:subfield">
960       <xslo:if test="contains('n', @code)">
961         <z:index name="reserves:n reserves:w">
962           <xslo:value-of select="."/>
963         </z:index>
964       </xslo:if>
965     </xslo:for-each>
966     <xslo:for-each select="marc:subfield">
967       <xslo:if test="contains('o', @code)">
968         <z:index name="Local-classification:w Local-classification:p Local-classification:s">
969           <xslo:value-of select="."/>
970         </z:index>
971       </xslo:if>
972     </xslo:for-each>
973     <xslo:for-each select="marc:subfield">
974       <xslo:if test="contains('p', @code)">
975         <z:index name="barcode:w barcode:n">
976           <xslo:value-of select="."/>
977         </z:index>
978       </xslo:if>
979     </xslo:for-each>
980     <xslo:for-each select="marc:subfield">
981       <xslo:if test="contains('q', @code)">
982         <z:index name="onloan:n onloan:w">
983           <xslo:value-of select="."/>
984         </z:index>
985       </xslo:if>
986     </xslo:for-each>
987     <xslo:for-each select="marc:subfield">
988       <xslo:if test="contains('r', @code)">
989         <z:index name="datelastseen:w">
990           <xslo:value-of select="."/>
991         </z:index>
992       </xslo:if>
993     </xslo:for-each>
994     <xslo:for-each select="marc:subfield">
995       <xslo:if test="contains('s', @code)">
996         <z:index name="datelastborrowed:w">
997           <xslo:value-of select="."/>
998         </z:index>
999       </xslo:if>
1000     </xslo:for-each>
1001     <xslo:for-each select="marc:subfield">
1002       <xslo:if test="contains('t', @code)">
1003         <z:index name="copynumber:w">
1004           <xslo:value-of select="."/>
1005         </z:index>
1006       </xslo:if>
1007     </xslo:for-each>
1008     <xslo:for-each select="marc:subfield">
1009       <xslo:if test="contains('u', @code)">
1010         <z:index name="uri:u">
1011           <xslo:value-of select="."/>
1012         </z:index>
1013       </xslo:if>
1014     </xslo:for-each>
1015     <xslo:for-each select="marc:subfield">
1016       <xslo:if test="contains('v', @code)">
1017         <z:index name="replacementprice:w">
1018           <xslo:value-of select="."/>
1019         </z:index>
1020       </xslo:if>
1021     </xslo:for-each>
1022     <xslo:for-each select="marc:subfield">
1023       <xslo:if test="contains('w', @code)">
1024         <z:index name="replacementpricedate:w">
1025           <xslo:value-of select="."/>
1026         </z:index>
1027       </xslo:if>
1028     </xslo:for-each>
1029     <xslo:for-each select="marc:subfield">
1030       <xslo:if test="contains('y', @code)">
1031         <z:index name="itype:w">
1032           <xslo:value-of select="."/>
1033         </z:index>
1034       </xslo:if>
1035     </xslo:for-each>
1036   </xslo:template>
1037   <xslo:template mode="index_data_field" match="marc:datafield[@tag='010']">
1038     <z:index name="LC-card-number:w Identifier-standard:w">
1039       <xslo:variable name="raw_heading">
1040         <xslo:for-each select="marc:subfield">
1041           <xslo:if test="position() &gt; 1">
1042             <xslo:value-of select="substring(' ', 1, 1)"/>
1043           </xslo:if>
1044           <xslo:value-of select="."/>
1045         </xslo:for-each>
1046       </xslo:variable>
1047       <xslo:value-of select="normalize-space($raw_heading)"/>
1048     </z:index>
1049   </xslo:template>
1050   <xslo:template mode="index_data_field" match="marc:datafield[@tag='015']">
1051     <z:index name="BNB-card-number:w BGF-number:w Number-db:w Number-natl-biblio:w Identifier-standard:w">
1052       <xslo:variable name="raw_heading">
1053         <xslo:for-each select="marc:subfield">
1054           <xslo:if test="position() &gt; 1">
1055             <xslo:value-of select="substring(' ', 1, 1)"/>
1056           </xslo:if>
1057           <xslo:value-of select="."/>
1058         </xslo:for-each>
1059       </xslo:variable>
1060       <xslo:value-of select="normalize-space($raw_heading)"/>
1061     </z:index>
1062   </xslo:template>
1063   <xslo:template mode="index_data_field" match="marc:datafield[@tag='020']">
1064     <z:index name="ISBN:w Identifier-standard:w">
1065       <xslo:variable name="raw_heading">
1066         <xslo:for-each select="marc:subfield">
1067           <xslo:if test="position() &gt; 1">
1068             <xslo:value-of select="substring(' ', 1, 1)"/>
1069           </xslo:if>
1070           <xslo:value-of select="."/>
1071         </xslo:for-each>
1072       </xslo:variable>
1073       <xslo:value-of select="normalize-space($raw_heading)"/>
1074     </z:index>
1075   </xslo:template>
1076   <xslo:template mode="index_data_field" match="marc:datafield[@tag='022']">
1077     <z:index name="ISSN:w Identifier-standard:w">
1078       <xslo:variable name="raw_heading">
1079         <xslo:for-each select="marc:subfield">
1080           <xslo:if test="position() &gt; 1">
1081             <xslo:value-of select="substring(' ', 1, 1)"/>
1082           </xslo:if>
1083           <xslo:value-of select="."/>
1084         </xslo:for-each>
1085       </xslo:variable>
1086       <xslo:value-of select="normalize-space($raw_heading)"/>
1087     </z:index>
1088   </xslo:template>
1089   <xslo:template mode="index_data_field" match="marc:datafield[@tag='024']">
1090     <z:index name="Identifier-standard:w">
1091       <xslo:variable name="raw_heading">
1092         <xslo:for-each select="marc:subfield">
1093           <xslo:if test="position() &gt; 1">
1094             <xslo:value-of select="substring(' ', 1, 1)"/>
1095           </xslo:if>
1096           <xslo:value-of select="."/>
1097         </xslo:for-each>
1098       </xslo:variable>
1099       <xslo:value-of select="normalize-space($raw_heading)"/>
1100     </z:index>
1101   </xslo:template>
1102   <xslo:template mode="index_data_field" match="marc:datafield[@tag='025']">
1103     <z:index name="Identifier-standard:w">
1104       <xslo:variable name="raw_heading">
1105         <xslo:for-each select="marc:subfield">
1106           <xslo:if test="position() &gt; 1">
1107             <xslo:value-of select="substring(' ', 1, 1)"/>
1108           </xslo:if>
1109           <xslo:value-of select="."/>
1110         </xslo:for-each>
1111       </xslo:variable>
1112       <xslo:value-of select="normalize-space($raw_heading)"/>
1113     </z:index>
1114   </xslo:template>
1115   <xslo:template mode="index_data_field" match="marc:datafield[@tag='027']">
1116     <z:index name="Report-number:w Identifier-standard:w">
1117       <xslo:variable name="raw_heading">
1118         <xslo:for-each select="marc:subfield">
1119           <xslo:if test="position() &gt; 1">
1120             <xslo:value-of select="substring(' ', 1, 1)"/>
1121           </xslo:if>
1122           <xslo:value-of select="."/>
1123         </xslo:for-each>
1124       </xslo:variable>
1125       <xslo:value-of select="normalize-space($raw_heading)"/>
1126     </z:index>
1127   </xslo:template>
1128   <xslo:template mode="index_data_field" match="marc:datafield[@tag='028']">
1129     <z:index name="Identifier-publisher-for-music:w Identifier-standard:w">
1130       <xslo:variable name="raw_heading">
1131         <xslo:for-each select="marc:subfield">
1132           <xslo:if test="position() &gt; 1">
1133             <xslo:value-of select="substring(' ', 1, 1)"/>
1134           </xslo:if>
1135           <xslo:value-of select="."/>
1136         </xslo:for-each>
1137       </xslo:variable>
1138       <xslo:value-of select="normalize-space($raw_heading)"/>
1139     </z:index>
1140   </xslo:template>
1141   <xslo:template mode="index_data_field" match="marc:datafield[@tag='030']">
1142     <z:index name="CODEN:w Identifier-standard:w">
1143       <xslo:variable name="raw_heading">
1144         <xslo:for-each select="marc:subfield">
1145           <xslo:if test="position() &gt; 1">
1146             <xslo:value-of select="substring(' ', 1, 1)"/>
1147           </xslo:if>
1148           <xslo:value-of select="."/>
1149         </xslo:for-each>
1150       </xslo:variable>
1151       <xslo:value-of select="normalize-space($raw_heading)"/>
1152     </z:index>
1153   </xslo:template>
1154   <xslo:template mode="index_data_field" match="marc:datafield[@tag='040']">
1155     <z:index name="Code-institution:w Record-source:w">
1156       <xslo:variable name="raw_heading">
1157         <xslo:for-each select="marc:subfield">
1158           <xslo:if test="position() &gt; 1">
1159             <xslo:value-of select="substring(' ', 1, 1)"/>
1160           </xslo:if>
1161           <xslo:value-of select="."/>
1162         </xslo:for-each>
1163       </xslo:variable>
1164       <xslo:value-of select="normalize-space($raw_heading)"/>
1165     </z:index>
1166   </xslo:template>
1167   <xslo:template mode="index_data_field" match="marc:datafield[@tag='041']">
1168     <z:index name="ln:w">
1169       <xslo:variable name="raw_heading">
1170         <xslo:for-each select="marc:subfield">
1171           <xslo:if test="position() &gt; 1">
1172             <xslo:value-of select="substring(' ', 1, 1)"/>
1173           </xslo:if>
1174           <xslo:value-of select="."/>
1175         </xslo:for-each>
1176       </xslo:variable>
1177       <xslo:value-of select="normalize-space($raw_heading)"/>
1178     </z:index>
1179   </xslo:template>
1180   <xslo:template mode="index_data_field" match="marc:datafield[@tag='043']">
1181     <z:index name="Code-geographic:w">
1182       <xslo:variable name="raw_heading">
1183         <xslo:for-each select="marc:subfield">
1184           <xslo:if test="position() &gt; 1">
1185             <xslo:value-of select="substring(' ', 1, 1)"/>
1186           </xslo:if>
1187           <xslo:value-of select="."/>
1188         </xslo:for-each>
1189       </xslo:variable>
1190       <xslo:value-of select="normalize-space($raw_heading)"/>
1191     </z:index>
1192   </xslo:template>
1193   <xslo:template mode="index_data_field" match="marc:datafield[@tag='060']">
1194     <z:index name="NLM-call-number:w">
1195       <xslo:variable name="raw_heading">
1196         <xslo:for-each select="marc:subfield">
1197           <xslo:if test="position() &gt; 1">
1198             <xslo:value-of select="substring(' ', 1, 1)"/>
1199           </xslo:if>
1200           <xslo:value-of select="."/>
1201         </xslo:for-each>
1202       </xslo:variable>
1203       <xslo:value-of select="normalize-space($raw_heading)"/>
1204     </z:index>
1205   </xslo:template>
1206   <xslo:template mode="index_data_field" match="marc:datafield[@tag='080']">
1207     <z:index name="UDC-classification:w">
1208       <xslo:variable name="raw_heading">
1209         <xslo:for-each select="marc:subfield">
1210           <xslo:if test="position() &gt; 1">
1211             <xslo:value-of select="substring(' ', 1, 1)"/>
1212           </xslo:if>
1213           <xslo:value-of select="."/>
1214         </xslo:for-each>
1215       </xslo:variable>
1216       <xslo:value-of select="normalize-space($raw_heading)"/>
1217     </z:index>
1218   </xslo:template>
1219   <xslo:template mode="index_data_field" match="marc:datafield[@tag='082']">
1220     <z:index name="Dewey-classification:w Dewey-classification:s">
1221       <xslo:variable name="raw_heading">
1222         <xslo:for-each select="marc:subfield">
1223           <xslo:if test="position() &gt; 1">
1224             <xslo:value-of select="substring(' ', 1, 1)"/>
1225           </xslo:if>
1226           <xslo:value-of select="."/>
1227         </xslo:for-each>
1228       </xslo:variable>
1229       <xslo:value-of select="normalize-space($raw_heading)"/>
1230     </z:index>
1231   </xslo:template>
1232   <xslo:template mode="index_data_field" match="marc:datafield[@tag='100']">
1233     <z:index name="Author:w Author-title:w Author-name-personal:w Name:w Name-and-title:w Personal-name:w">
1234       <xslo:variable name="raw_heading">
1235         <xslo:for-each select="marc:subfield">
1236           <xslo:if test="position() &gt; 1">
1237             <xslo:value-of select="substring(' ', 1, 1)"/>
1238           </xslo:if>
1239           <xslo:value-of select="."/>
1240         </xslo:for-each>
1241       </xslo:variable>
1242       <xslo:value-of select="normalize-space($raw_heading)"/>
1243     </z:index>
1244   </xslo:template>
1245   <xslo:template mode="index_data_field" match="marc:datafield[@tag='110']">
1246     <z:index name="Author:w Author-title:w Author-name-corporate:w Name:w Name-and-title:w Corporate-name:w">
1247       <xslo:variable name="raw_heading">
1248         <xslo:for-each select="marc:subfield">
1249           <xslo:if test="position() &gt; 1">
1250             <xslo:value-of select="substring(' ', 1, 1)"/>
1251           </xslo:if>
1252           <xslo:value-of select="."/>
1253         </xslo:for-each>
1254       </xslo:variable>
1255       <xslo:value-of select="normalize-space($raw_heading)"/>
1256     </z:index>
1257   </xslo:template>
1258   <xslo:template mode="index_data_field" match="marc:datafield[@tag='111']">
1259     <z:index name="Author:w Author-title:w Author-name-corporate:w Name:w Name-and-title:w Conference-name:w">
1260       <xslo:variable name="raw_heading">
1261         <xslo:for-each select="marc:subfield">
1262           <xslo:if test="position() &gt; 1">
1263             <xslo:value-of select="substring(' ', 1, 1)"/>
1264           </xslo:if>
1265           <xslo:value-of select="."/>
1266         </xslo:for-each>
1267       </xslo:variable>
1268       <xslo:value-of select="normalize-space($raw_heading)"/>
1269     </z:index>
1270   </xslo:template>
1271   <xslo:template mode="index_data_field" match="marc:datafield[@tag='130']">
1272     <z:index name="Title:w Title-uniform:w">
1273       <xslo:variable name="raw_heading">
1274         <xslo:for-each select="marc:subfield">
1275           <xslo:if test="position() &gt; 1">
1276             <xslo:value-of select="substring(' ', 1, 1)"/>
1277           </xslo:if>
1278           <xslo:value-of select="."/>
1279         </xslo:for-each>
1280       </xslo:variable>
1281       <xslo:value-of select="normalize-space($raw_heading)"/>
1282     </z:index>
1283   </xslo:template>
1284   <xslo:template mode="index_data_field" match="marc:datafield[@tag='210']">
1285     <z:index name="Title:w Title-abbreviated:w">
1286       <xslo:variable name="raw_heading">
1287         <xslo:for-each select="marc:subfield">
1288           <xslo:if test="position() &gt; 1">
1289             <xslo:value-of select="substring(' ', 1, 1)"/>
1290           </xslo:if>
1291           <xslo:value-of select="."/>
1292         </xslo:for-each>
1293       </xslo:variable>
1294       <xslo:value-of select="normalize-space($raw_heading)"/>
1295     </z:index>
1296   </xslo:template>
1297   <xslo:template mode="index_data_field" match="marc:datafield[@tag='222']">
1298     <z:index name="Title:w Title-key:w">
1299       <xslo:variable name="raw_heading">
1300         <xslo:for-each select="marc:subfield">
1301           <xslo:if test="position() &gt; 1">
1302             <xslo:value-of select="substring(' ', 1, 1)"/>
1303           </xslo:if>
1304           <xslo:value-of select="."/>
1305         </xslo:for-each>
1306       </xslo:variable>
1307       <xslo:value-of select="normalize-space($raw_heading)"/>
1308     </z:index>
1309   </xslo:template>
1310   <xslo:template mode="index_data_field" match="marc:datafield[@tag='240']">
1311     <z:index name="Title:w Title:p Title-uniform:w">
1312       <xslo:variable name="raw_heading">
1313         <xslo:for-each select="marc:subfield">
1314           <xslo:if test="position() &gt; 1">
1315             <xslo:value-of select="substring(' ', 1, 1)"/>
1316           </xslo:if>
1317           <xslo:value-of select="."/>
1318         </xslo:for-each>
1319       </xslo:variable>
1320       <xslo:value-of select="normalize-space($raw_heading)"/>
1321     </z:index>
1322   </xslo:template>
1323   <xslo:template mode="index_data_field" match="marc:datafield[@tag='245']">
1324     <z:index name="Title:w Title:p">
1325       <xslo:variable name="raw_heading">
1326         <xslo:for-each select="marc:subfield">
1327           <xslo:if test="position() &gt; 1">
1328             <xslo:value-of select="substring(' ', 1, 1)"/>
1329           </xslo:if>
1330           <xslo:value-of select="."/>
1331         </xslo:for-each>
1332       </xslo:variable>
1333       <xslo:value-of select="normalize-space($raw_heading)"/>
1334     </z:index>
1335   </xslo:template>
1336   <xslo:template mode="index_data_field" match="marc:datafield[@tag='246']">
1337     <z:index name="Title:w Title:p Title-abbreviated:w Title-expanded:w Title-former:w">
1338       <xslo:variable name="raw_heading">
1339         <xslo:for-each select="marc:subfield">
1340           <xslo:if test="position() &gt; 1">
1341             <xslo:value-of select="substring(' ', 1, 1)"/>
1342           </xslo:if>
1343           <xslo:value-of select="."/>
1344         </xslo:for-each>
1345       </xslo:variable>
1346       <xslo:value-of select="normalize-space($raw_heading)"/>
1347     </z:index>
1348   </xslo:template>
1349   <xslo:template mode="index_data_field" match="marc:datafield[@tag='260']">
1350     <z:index name="pl:w">
1351       <xslo:variable name="raw_heading">
1352         <xslo:for-each select="marc:subfield">
1353           <xslo:if test="position() &gt; 1">
1354             <xslo:value-of select="substring(' ', 1, 1)"/>
1355           </xslo:if>
1356           <xslo:value-of select="."/>
1357         </xslo:for-each>
1358       </xslo:variable>
1359       <xslo:value-of select="normalize-space($raw_heading)"/>
1360     </z:index>
1361   </xslo:template>
1362   <xslo:template mode="index_data_field" match="marc:datafield[@tag='300']">
1363     <z:index name="Extent:w Extent:p">
1364       <xslo:variable name="raw_heading">
1365         <xslo:for-each select="marc:subfield">
1366           <xslo:if test="position() &gt; 1">
1367             <xslo:value-of select="substring(' ', 1, 1)"/>
1368           </xslo:if>
1369           <xslo:value-of select="."/>
1370         </xslo:for-each>
1371       </xslo:variable>
1372       <xslo:value-of select="normalize-space($raw_heading)"/>
1373     </z:index>
1374   </xslo:template>
1375   <xslo:template mode="index_data_field" match="marc:datafield[@tag='440']">
1376     <z:index name="Title-series:w Title-series:p Title:w Title-series:w">
1377       <xslo:variable name="raw_heading">
1378         <xslo:for-each select="marc:subfield">
1379           <xslo:if test="position() &gt; 1">
1380             <xslo:value-of select="substring(' ', 1, 1)"/>
1381           </xslo:if>
1382           <xslo:value-of select="."/>
1383         </xslo:for-each>
1384       </xslo:variable>
1385       <xslo:value-of select="normalize-space($raw_heading)"/>
1386     </z:index>
1387   </xslo:template>
1388   <xslo:template mode="index_data_field" match="marc:datafield[@tag='490']">
1389     <z:index name="Title:w Title-series:w">
1390       <xslo:variable name="raw_heading">
1391         <xslo:for-each select="marc:subfield">
1392           <xslo:if test="position() &gt; 1">
1393             <xslo:value-of select="substring(' ', 1, 1)"/>
1394           </xslo:if>
1395           <xslo:value-of select="."/>
1396         </xslo:for-each>
1397       </xslo:variable>
1398       <xslo:value-of select="normalize-space($raw_heading)"/>
1399     </z:index>
1400   </xslo:template>
1401   <xslo:template mode="index_data_field" match="marc:datafield[@tag='502']">
1402     <z:index name="Material-type:w">
1403       <xslo:variable name="raw_heading">
1404         <xslo:for-each select="marc:subfield">
1405           <xslo:if test="position() &gt; 1">
1406             <xslo:value-of select="substring(' ', 1, 1)"/>
1407           </xslo:if>
1408           <xslo:value-of select="."/>
1409         </xslo:for-each>
1410       </xslo:variable>
1411       <xslo:value-of select="normalize-space($raw_heading)"/>
1412     </z:index>
1413   </xslo:template>
1414   <xslo:template mode="index_data_field" match="marc:datafield[@tag='505']">
1415     <z:index name="Note:w Note:p">
1416       <xslo:variable name="raw_heading">
1417         <xslo:for-each select="marc:subfield">
1418           <xslo:if test="position() &gt; 1">
1419             <xslo:value-of select="substring(' ', 1, 1)"/>
1420           </xslo:if>
1421           <xslo:value-of select="."/>
1422         </xslo:for-each>
1423       </xslo:variable>
1424       <xslo:value-of select="normalize-space($raw_heading)"/>
1425     </z:index>
1426   </xslo:template>
1427   <xslo:template mode="index_data_field" match="marc:datafield[@tag='510']">
1428     <z:index name="Indexed-by:w">
1429       <xslo:variable name="raw_heading">
1430         <xslo:for-each select="marc:subfield">
1431           <xslo:if test="position() &gt; 1">
1432             <xslo:value-of select="substring(' ', 1, 1)"/>
1433           </xslo:if>
1434           <xslo:value-of select="."/>
1435         </xslo:for-each>
1436       </xslo:variable>
1437       <xslo:value-of select="normalize-space($raw_heading)"/>
1438     </z:index>
1439   </xslo:template>
1440   <xslo:template mode="index_data_field" match="marc:datafield[@tag='520']">
1441     <z:index name="Abstract:w Abstract:p">
1442       <xslo:variable name="raw_heading">
1443         <xslo:for-each select="marc:subfield">
1444           <xslo:if test="position() &gt; 1">
1445             <xslo:value-of select="substring(' ', 1, 1)"/>
1446           </xslo:if>
1447           <xslo:value-of select="."/>
1448         </xslo:for-each>
1449       </xslo:variable>
1450       <xslo:value-of select="normalize-space($raw_heading)"/>
1451     </z:index>
1452   </xslo:template>
1453   <xslo:template mode="index_data_field" match="marc:datafield[@tag='600']">
1454     <z:index name="Name:w Personal-name:w Subject-name-personal:w Subject:w Subject:p">
1455       <xslo:variable name="raw_heading">
1456         <xslo:for-each select="marc:subfield">
1457           <xslo:if test="position() &gt; 1">
1458             <xslo:value-of select="substring(' ', 1, 1)"/>
1459           </xslo:if>
1460           <xslo:value-of select="."/>
1461         </xslo:for-each>
1462       </xslo:variable>
1463       <xslo:value-of select="normalize-space($raw_heading)"/>
1464     </z:index>
1465   </xslo:template>
1466   <xslo:template mode="index_data_field" match="marc:datafield[@tag='610']">
1467     <z:index name="Name:w Subject:w Corporate-name:w Subject:w Subject:p">
1468       <xslo:variable name="raw_heading">
1469         <xslo:for-each select="marc:subfield">
1470           <xslo:if test="position() &gt; 1">
1471             <xslo:value-of select="substring(' ', 1, 1)"/>
1472           </xslo:if>
1473           <xslo:value-of select="."/>
1474         </xslo:for-each>
1475       </xslo:variable>
1476       <xslo:value-of select="normalize-space($raw_heading)"/>
1477     </z:index>
1478   </xslo:template>
1479   <xslo:template mode="index_data_field" match="marc:datafield[@tag='611']">
1480     <z:index name="Conference-name:w Subject:w Subject:p">
1481       <xslo:variable name="raw_heading">
1482         <xslo:for-each select="marc:subfield">
1483           <xslo:if test="position() &gt; 1">
1484             <xslo:value-of select="substring(' ', 1, 1)"/>
1485           </xslo:if>
1486           <xslo:value-of select="."/>
1487         </xslo:for-each>
1488       </xslo:variable>
1489       <xslo:value-of select="normalize-space($raw_heading)"/>
1490     </z:index>
1491     <z:index name="Name:w Subject:w Subject:p">
1492       <xslo:variable name="raw_heading">
1493         <xslo:for-each select="marc:subfield">
1494           <xslo:if test="position() &gt; 1">
1495             <xslo:value-of select="substring(' ', 1, 1)"/>
1496           </xslo:if>
1497           <xslo:value-of select="."/>
1498         </xslo:for-each>
1499       </xslo:variable>
1500       <xslo:value-of select="normalize-space($raw_heading)"/>
1501     </z:index>
1502   </xslo:template>
1503   <xslo:template mode="index_data_field" match="marc:datafield[@tag='630']">
1504     <z:index name="Subject:w Subject:p">
1505       <xslo:variable name="raw_heading">
1506         <xslo:for-each select="marc:subfield">
1507           <xslo:if test="position() &gt; 1">
1508             <xslo:value-of select="substring(' ', 1, 1)"/>
1509           </xslo:if>
1510           <xslo:value-of select="."/>
1511         </xslo:for-each>
1512       </xslo:variable>
1513       <xslo:value-of select="normalize-space($raw_heading)"/>
1514     </z:index>
1515   </xslo:template>
1516   <xslo:template mode="index_data_field" match="marc:datafield[@tag='650']">
1517     <z:index name="Subject:w Subject:p">
1518       <xslo:variable name="raw_heading">
1519         <xslo:for-each select="marc:subfield">
1520           <xslo:if test="position() &gt; 1">
1521             <xslo:value-of select="substring(' ', 1, 1)"/>
1522           </xslo:if>
1523           <xslo:value-of select="."/>
1524         </xslo:for-each>
1525       </xslo:variable>
1526       <xslo:value-of select="normalize-space($raw_heading)"/>
1527     </z:index>
1528   </xslo:template>
1529   <xslo:template mode="index_data_field" match="marc:datafield[@tag='651']">
1530     <z:index name="Name-geographic:w Subject:w Subject:p">
1531       <xslo:variable name="raw_heading">
1532         <xslo:for-each select="marc:subfield">
1533           <xslo:if test="position() &gt; 1">
1534             <xslo:value-of select="substring(' ', 1, 1)"/>
1535           </xslo:if>
1536           <xslo:value-of select="."/>
1537         </xslo:for-each>
1538       </xslo:variable>
1539       <xslo:value-of select="normalize-space($raw_heading)"/>
1540     </z:index>
1541   </xslo:template>
1542   <xslo:template mode="index_data_field" match="marc:datafield[@tag='653']">
1543     <z:index name="Subject:w Subject:p">
1544       <xslo:variable name="raw_heading">
1545         <xslo:for-each select="marc:subfield">
1546           <xslo:if test="position() &gt; 1">
1547             <xslo:value-of select="substring(' ', 1, 1)"/>
1548           </xslo:if>
1549           <xslo:value-of select="."/>
1550         </xslo:for-each>
1551       </xslo:variable>
1552       <xslo:value-of select="normalize-space($raw_heading)"/>
1553     </z:index>
1554   </xslo:template>
1555   <xslo:template mode="index_data_field" match="marc:datafield[@tag='654']">
1556     <z:index name="Subject:w Subject:p">
1557       <xslo:variable name="raw_heading">
1558         <xslo:for-each select="marc:subfield">
1559           <xslo:if test="position() &gt; 1">
1560             <xslo:value-of select="substring(' ', 1, 1)"/>
1561           </xslo:if>
1562           <xslo:value-of select="."/>
1563         </xslo:for-each>
1564       </xslo:variable>
1565       <xslo:value-of select="normalize-space($raw_heading)"/>
1566     </z:index>
1567   </xslo:template>
1568   <xslo:template mode="index_data_field" match="marc:datafield[@tag='655']">
1569     <z:index name="Subject:w Subject:p">
1570       <xslo:variable name="raw_heading">
1571         <xslo:for-each select="marc:subfield">
1572           <xslo:if test="position() &gt; 1">
1573             <xslo:value-of select="substring(' ', 1, 1)"/>
1574           </xslo:if>
1575           <xslo:value-of select="."/>
1576         </xslo:for-each>
1577       </xslo:variable>
1578       <xslo:value-of select="normalize-space($raw_heading)"/>
1579     </z:index>
1580   </xslo:template>
1581   <xslo:template mode="index_data_field" match="marc:datafield[@tag='656']">
1582     <z:index name="Subject:w Subject:p">
1583       <xslo:variable name="raw_heading">
1584         <xslo:for-each select="marc:subfield">
1585           <xslo:if test="position() &gt; 1">
1586             <xslo:value-of select="substring(' ', 1, 1)"/>
1587           </xslo:if>
1588           <xslo:value-of select="."/>
1589         </xslo:for-each>
1590       </xslo:variable>
1591       <xslo:value-of select="normalize-space($raw_heading)"/>
1592     </z:index>
1593   </xslo:template>
1594   <xslo:template mode="index_data_field" match="marc:datafield[@tag='657']">
1595     <z:index name="Subject:w Subject:p">
1596       <xslo:variable name="raw_heading">
1597         <xslo:for-each select="marc:subfield">
1598           <xslo:if test="position() &gt; 1">
1599             <xslo:value-of select="substring(' ', 1, 1)"/>
1600           </xslo:if>
1601           <xslo:value-of select="."/>
1602         </xslo:for-each>
1603       </xslo:variable>
1604       <xslo:value-of select="normalize-space($raw_heading)"/>
1605     </z:index>
1606   </xslo:template>
1607   <xslo:template mode="index_data_field" match="marc:datafield[@tag='690']">
1608     <z:index name="Subject:w Subject:p">
1609       <xslo:variable name="raw_heading">
1610         <xslo:for-each select="marc:subfield">
1611           <xslo:if test="position() &gt; 1">
1612             <xslo:value-of select="substring(' ', 1, 1)"/>
1613           </xslo:if>
1614           <xslo:value-of select="."/>
1615         </xslo:for-each>
1616       </xslo:variable>
1617       <xslo:value-of select="normalize-space($raw_heading)"/>
1618     </z:index>
1619   </xslo:template>
1620   <xslo:template mode="index_data_field" match="marc:datafield[@tag='700']">
1621     <z:index name="Author:w Author-name-corporate:w Author-name-personal:w Name:w Editor:w Personal-name:w">
1622       <xslo:variable name="raw_heading">
1623         <xslo:for-each select="marc:subfield">
1624           <xslo:if test="position() &gt; 1">
1625             <xslo:value-of select="substring(' ', 1, 1)"/>
1626           </xslo:if>
1627           <xslo:value-of select="."/>
1628         </xslo:for-each>
1629       </xslo:variable>
1630       <xslo:value-of select="normalize-space($raw_heading)"/>
1631     </z:index>
1632   </xslo:template>
1633   <xslo:template mode="index_data_field" match="marc:datafield[@tag='710']">
1634     <z:index name="Author:w Corporate-name:w">
1635       <xslo:variable name="raw_heading">
1636         <xslo:for-each select="marc:subfield">
1637           <xslo:if test="position() &gt; 1">
1638             <xslo:value-of select="substring(' ', 1, 1)"/>
1639           </xslo:if>
1640           <xslo:value-of select="."/>
1641         </xslo:for-each>
1642       </xslo:variable>
1643       <xslo:value-of select="normalize-space($raw_heading)"/>
1644     </z:index>
1645     <z:index name="Author:w Name:w">
1646       <xslo:variable name="raw_heading">
1647         <xslo:for-each select="marc:subfield">
1648           <xslo:if test="position() &gt; 1">
1649             <xslo:value-of select="substring(' ', 1, 1)"/>
1650           </xslo:if>
1651           <xslo:value-of select="."/>
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_data_field" match="marc:datafield[@tag='711']">
1658     <z:index name="Author-name-corporate:w Name:w Conference-name:w">
1659       <xslo:variable name="raw_heading">
1660         <xslo:for-each select="marc:subfield">
1661           <xslo:if test="position() &gt; 1">
1662             <xslo:value-of select="substring(' ', 1, 1)"/>
1663           </xslo:if>
1664           <xslo:value-of select="."/>
1665         </xslo:for-each>
1666       </xslo:variable>
1667       <xslo:value-of select="normalize-space($raw_heading)"/>
1668     </z:index>
1669   </xslo:template>
1670   <xslo:template mode="index_data_field" match="marc:datafield[@tag='730']">
1671     <z:index name="Title:w Title-uniform:w">
1672       <xslo:variable name="raw_heading">
1673         <xslo:for-each select="marc:subfield">
1674           <xslo:if test="position() &gt; 1">
1675             <xslo:value-of select="substring(' ', 1, 1)"/>
1676           </xslo:if>
1677           <xslo:value-of select="."/>
1678         </xslo:for-each>
1679       </xslo:variable>
1680       <xslo:value-of select="normalize-space($raw_heading)"/>
1681     </z:index>
1682   </xslo:template>
1683   <xslo:template mode="index_data_field" match="marc:datafield[@tag='740']">
1684     <z:index name="Title:w Title-other-variant:w">
1685       <xslo:variable name="raw_heading">
1686         <xslo:for-each select="marc:subfield">
1687           <xslo:if test="position() &gt; 1">
1688             <xslo:value-of select="substring(' ', 1, 1)"/>
1689           </xslo:if>
1690           <xslo:value-of select="."/>
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_data_field" match="marc:datafield[@tag='780']">
1697     <z:index name="Title:w Title-former:w Related-periodical:w">
1698       <xslo:variable name="raw_heading">
1699         <xslo:for-each select="marc:subfield">
1700           <xslo:if test="position() &gt; 1">
1701             <xslo:value-of select="substring(' ', 1, 1)"/>
1702           </xslo:if>
1703           <xslo:value-of select="."/>
1704         </xslo:for-each>
1705       </xslo:variable>
1706       <xslo:value-of select="normalize-space($raw_heading)"/>
1707     </z:index>
1708   </xslo:template>
1709   <xslo:template mode="index_data_field" match="marc:datafield[@tag='785']">
1710     <z:index name="Related-periodical:w">
1711       <xslo:variable name="raw_heading">
1712         <xslo:for-each select="marc:subfield">
1713           <xslo:if test="position() &gt; 1">
1714             <xslo:value-of select="substring(' ', 1, 1)"/>
1715           </xslo:if>
1716           <xslo:value-of select="."/>
1717         </xslo:for-each>
1718       </xslo:variable>
1719       <xslo:value-of select="normalize-space($raw_heading)"/>
1720     </z:index>
1721   </xslo:template>
1722   <xslo:template mode="index_data_field" match="marc:datafield[@tag='800']">
1723     <z:index name="Author:w Author-name-personal:w Name:w Personal-name:w">
1724       <xslo:variable name="raw_heading">
1725         <xslo:for-each select="marc:subfield">
1726           <xslo:if test="position() &gt; 1">
1727             <xslo:value-of select="substring(' ', 1, 1)"/>
1728           </xslo:if>
1729           <xslo:value-of select="."/>
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_data_field" match="marc:datafield[@tag='810']">
1736     <z:index name="Author:w Corporate-name:w Author-name-corporate:w Name:w">
1737       <xslo:variable name="raw_heading">
1738         <xslo:for-each select="marc:subfield">
1739           <xslo:if test="position() &gt; 1">
1740             <xslo:value-of select="substring(' ', 1, 1)"/>
1741           </xslo:if>
1742           <xslo:value-of select="."/>
1743         </xslo:for-each>
1744       </xslo:variable>
1745       <xslo:value-of select="normalize-space($raw_heading)"/>
1746     </z:index>
1747   </xslo:template>
1748   <xslo:template mode="index_data_field" match="marc:datafield[@tag='811']">
1749     <z:index name="Author:w Author-name-corporate:w Name:w Conference-name:w">
1750       <xslo:variable name="raw_heading">
1751         <xslo:for-each select="marc:subfield">
1752           <xslo:if test="position() &gt; 1">
1753             <xslo:value-of select="substring(' ', 1, 1)"/>
1754           </xslo:if>
1755           <xslo:value-of select="."/>
1756         </xslo:for-each>
1757       </xslo:variable>
1758       <xslo:value-of select="normalize-space($raw_heading)"/>
1759     </z:index>
1760   </xslo:template>
1761   <xslo:template mode="index_data_field" match="marc:datafield[@tag='830']">
1762     <z:index name="Title:w Title-series:w">
1763       <xslo:variable name="raw_heading">
1764         <xslo:for-each select="marc:subfield">
1765           <xslo:if test="position() &gt; 1">
1766             <xslo:value-of select="substring(' ', 1, 1)"/>
1767           </xslo:if>
1768           <xslo:value-of select="."/>
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_facets" match="marc:datafield[@tag='100']">
1775     <xslo:if test="not(@ind1='z')">
1776       <z:index name="au:0">
1777         <xslo:value-of select="marc:subfield[@code='a']"/>
1778       </z:index>
1779     </xslo:if>
1780   </xslo:template>
1781   <xslo:template mode="index_facets" match="marc:datafield[@tag='110']">
1782     <xslo:if test="not(@ind1='z')">
1783       <z:index name="au:0">
1784         <xslo:value-of select="marc:subfield[@code='a']"/>
1785       </z:index>
1786     </xslo:if>
1787   </xslo:template>
1788   <xslo:template mode="index_facets" match="marc:datafield[@tag='440']">
1789     <xslo:if test="not(@ind1='z')">
1790       <z:index name="se:0">
1791         <xslo:value-of select="marc:subfield[@code='a']"/>
1792       </z:index>
1793     </xslo:if>
1794   </xslo:template>
1795   <xslo:template mode="index_facets" match="marc:datafield[@tag='490']">
1796     <xslo:if test="not(@ind1='z')">
1797       <z:index name="&gt;se:0">
1798         <xslo:value-of select="marc:subfield[@code='a']"/>
1799       </z:index>
1800     </xslo:if>
1801   </xslo:template>
1802   <xslo:template mode="index_facets" match="marc:datafield[@tag='630']">
1803     <xslo:if test="not(@ind1='z')">
1804       <z:index name="su-ut:0">
1805         <xslo:value-of select="marc:subfield[@code='a']"/>
1806       </z:index>
1807     </xslo:if>
1808   </xslo:template>
1809   <xslo:template mode="index_facets" match="marc:datafield[@tag='650']">
1810     <xslo:if test="not(@ind1='z')">
1811       <z:index name="su-to:0">
1812         <xslo:value-of select="marc:subfield[@code='a']"/>
1813       </z:index>
1814     </xslo:if>
1815   </xslo:template>
1816   <xslo:template mode="index_facets" match="marc:datafield[@tag='651']">
1817     <xslo:if test="not(@ind1='z')">
1818       <z:index name="su-geo:0">
1819         <xslo:value-of select="marc:subfield[@code='a']"/>
1820       </z:index>
1821     </xslo:if>
1822   </xslo:template>
1823   <xslo:template mode="index_facets" match="marc:datafield[@tag='700']">
1824     <xslo:if test="not(@ind1='z')">
1825       <z:index name="au:0">
1826         <xslo:value-of select="marc:subfield[@code='a']"/>
1827       </z:index>
1828     </xslo:if>
1829   </xslo:template>
1830   <xslo:template mode="index_facets" match="marc:datafield[@tag='942']">
1831     <xslo:if test="not(@ind1='z')">
1832       <z:index name="itype:0">
1833         <xslo:value-of select="marc:subfield[@code='c']"/>
1834       </z:index>
1835     </xslo:if>
1836   </xslo:template>
1837   <xslo:template mode="index_facets" match="marc:datafield[@tag='952']">
1838     <xslo:if test="not(@ind1='z')">
1839       <z:index name="homebranch:0">
1840         <xslo:value-of select="marc:subfield[@code='a']"/>
1841       </z:index>
1842       <z:index name="holdingbranch:0">
1843         <xslo:value-of select="marc:subfield[@code='b']"/>
1844       </z:index>
1845       <z:index name="location:0">
1846         <xslo:value-of select="marc:subfield[@code='c']"/>
1847       </z:index>
1848       <z:index name="itype:0">
1849         <xslo:value-of select="marc:subfield[@code='y']"/>
1850       </z:index>
1851     </xslo:if>
1852   </xslo:template>
1853   <xslo:template mode="index_all" match="text()">
1854     <z:index name="Any:w Any:p">
1855       <xslo:value-of select="."/>
1856     </z:index>
1857   </xslo:template>
1858   <xslo:template name="chopPunctuation">
1859     <xslo:param name="chopString"/>
1860     <xslo:variable name="length" select="string-length($chopString)"/>
1861     <xslo:choose>
1862       <xslo:when test="$length=0"/>
1863       <xslo:when test="contains('-,.:=;!%/', substring($chopString,$length,1))">
1864         <xslo:call-template name="chopPunctuation">
1865           <xslo:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
1866         </xslo:call-template>
1867       </xslo:when>
1868       <xslo:when test="not($chopString)"/>
1869       <xslo:otherwise>
1870         <xslo:value-of select="$chopString"/>
1871       </xslo:otherwise>
1872     </xslo:choose>
1873     <xslo:text/>
1874   </xslo:template>
1875 </xslo:stylesheet>