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