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