Bug 8252: Fix indexing of UNIMARC 1xx for GRS-1
[koha.git] / etc / zebradb / marc_defs / unimarc / 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_heading"/>
16   <xslo:template match="text()" mode="index_heading_conditional"/>
17   <xslo:template match="text()" mode="index_match_heading"/>
18   <xslo:template match="text()" mode="index_subject_thesaurus"/>
19   <xslo:template match="/">
20     <xslo:if test="marc:collection">
21       <collection>
22         <xslo:apply-templates select="marc:collection/marc:record"/>
23       </collection>
24     </xslo:if>
25     <xslo:if test="marc:record">
26       <xslo:apply-templates select="marc:record"/>
27     </xslo:if>
28   </xslo:template>
29   <xslo:template match="marc:record">
30     <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
31     <z:record type="update">
32       <xslo:attribute name="z:id">
33         <xslo:value-of select="$idfield"/>
34       </xslo:attribute>
35       <xslo:apply-templates/>
36       <xslo:apply-templates mode="index_subfields"/>
37       <xslo:apply-templates mode="index_data_field"/>
38       <xslo:apply-templates mode="index_heading"/>
39       <xslo:apply-templates mode="index_heading_conditional"/>
40       <xslo:apply-templates mode="index_match_heading"/>
41       <xslo:apply-templates mode="index_subject_thesaurus"/>
42     </z:record>
43   </xslo:template>
44   <xslo:template match="marc:controlfield[@tag='001']">
45     <z:index name="Local-number:w">
46       <xslo:value-of select="."/>
47     </z:index>
48     <z:index name="Local-number:n">
49       <xslo:value-of select="."/>
50     </z:index>
51   </xslo:template>
52   <xslo:template match="marc:controlfield[@tag='009']">
53     <z:index name="Identifier-standard:w">
54       <xslo:value-of select="."/>
55     </z:index>
56     <z:index name="Identifier-standard:n">
57       <xslo:value-of select="."/>
58     </z:index>
59   </xslo:template>
60   <xslo:template mode="index_subfields" match="marc:datafield[@tag='090']">
61     <xslo:for-each select="marc:subfield">
62       <xslo:if test="contains('9', @code)">
63         <z:index name="Local-number:w Local-number:n">
64           <xslo:value-of select="."/>
65         </z:index>
66       </xslo:if>
67     </xslo:for-each>
68   </xslo:template>
69   <xslo:template mode="index_subfields" match="marc:datafield[@tag='099']">
70     <xslo:for-each select="marc:subfield">
71       <xslo:if test="contains('c', @code)">
72         <z:index name="date-entered-on-file:s date-entered-on-file:n date-entered-on-file:y Date-of-acquisition:w Date-of-acquisition:d Date-of-acquisition:s">
73           <xslo:value-of select="."/>
74         </z:index>
75       </xslo:if>
76     </xslo:for-each>
77     <xslo:for-each select="marc:subfield">
78       <xslo:if test="contains('d', @code)">
79         <z:index name="Date/time-last-modified:s Date/time-last-modified:n Date/time-last-modified:y">
80           <xslo:value-of select="."/>
81         </z:index>
82       </xslo:if>
83     </xslo:for-each>
84     <xslo:for-each select="marc:subfield">
85       <xslo:if test="contains('t', @code)">
86         <z:index name="ccode:w">
87           <xslo:value-of select="."/>
88         </z:index>
89       </xslo:if>
90     </xslo:for-each>
91   </xslo:template>
92   <xslo:template mode="index_subfields" match="marc:datafield[@tag='010']">
93     <xslo:for-each select="marc:subfield">
94       <xslo:if test="contains('a', @code)">
95         <z:index name="ISBN:w">
96           <xslo:value-of select="."/>
97         </z:index>
98       </xslo:if>
99     </xslo:for-each>
100     <xslo:for-each select="marc:subfield">
101       <xslo:if test="contains('z', @code)">
102         <z:index name="ISBN:w Identifier-standard:w">
103           <xslo:value-of select="."/>
104         </z:index>
105       </xslo:if>
106     </xslo:for-each>
107   </xslo:template>
108   <xslo:template mode="index_subfields" match="marc:datafield[@tag='011']">
109     <xslo:for-each select="marc:subfield">
110       <xslo:if test="contains('a', @code)">
111         <z:index name="ISSN:w Identifier-standard:w">
112           <xslo:value-of select="."/>
113         </z:index>
114       </xslo:if>
115     </xslo:for-each>
116     <xslo:for-each select="marc:subfield">
117       <xslo:if test="contains('y', @code)">
118         <z:index name="ISSN:w Identifier-standard:w">
119           <xslo:value-of select="."/>
120         </z:index>
121       </xslo:if>
122     </xslo:for-each>
123     <xslo:for-each select="marc:subfield">
124       <xslo:if test="contains('z', @code)">
125         <z:index name="ISSN:w Identifier-standard:w">
126           <xslo:value-of select="."/>
127         </z:index>
128       </xslo:if>
129     </xslo:for-each>
130     <xslo:for-each select="marc:subfield">
131       <xslo:if test="contains('f', @code)">
132         <z:index name="Identifier-standard:w">
133           <xslo:value-of select="."/>
134         </z:index>
135       </xslo:if>
136     </xslo:for-each>
137     <xslo:for-each select="marc:subfield">
138       <xslo:if test="contains('g', @code)">
139         <z:index name="Identifier-standard:w">
140           <xslo:value-of select="."/>
141         </z:index>
142       </xslo:if>
143     </xslo:for-each>
144   </xslo:template>
145   <xslo:template mode="index_subfields" match="marc:datafield[@tag='012']">
146     <xslo:for-each select="marc:subfield">
147       <xslo:if test="contains('a', @code)">
148         <z:index name="Identifier-standard:w">
149           <xslo:value-of select="."/>
150         </z:index>
151       </xslo:if>
152     </xslo:for-each>
153   </xslo:template>
154   <xslo:template mode="index_subfields" match="marc:datafield[@tag='013']">
155     <xslo:for-each select="marc:subfield">
156       <xslo:if test="contains('a', @code)">
157         <z:index name="Identifier-standard:w">
158           <xslo:value-of select="."/>
159         </z:index>
160       </xslo:if>
161     </xslo:for-each>
162     <xslo:for-each select="marc:subfield">
163       <xslo:if test="contains('z', @code)">
164         <z:index name="Identifier-standard:w">
165           <xslo:value-of select="."/>
166         </z:index>
167       </xslo:if>
168     </xslo:for-each>
169   </xslo:template>
170   <xslo:template mode="index_subfields" match="marc:datafield[@tag='014']">
171     <xslo:for-each select="marc:subfield">
172       <xslo:if test="contains('a', @code)">
173         <z:index name="Identifier-standard:w">
174           <xslo:value-of select="."/>
175         </z:index>
176       </xslo:if>
177     </xslo:for-each>
178     <xslo:for-each select="marc:subfield">
179       <xslo:if test="contains('z', @code)">
180         <z:index name="Identifier-standard:w">
181           <xslo:value-of select="."/>
182         </z:index>
183       </xslo:if>
184     </xslo:for-each>
185   </xslo:template>
186   <xslo:template mode="index_subfields" match="marc:datafield[@tag='015']">
187     <xslo:for-each select="marc:subfield">
188       <xslo:if test="contains('a', @code)">
189         <z:index name="Identifier-standard:w">
190           <xslo:value-of select="."/>
191         </z:index>
192       </xslo:if>
193     </xslo:for-each>
194     <xslo:for-each select="marc:subfield">
195       <xslo:if test="contains('z', @code)">
196         <z:index name="Identifier-standard:w">
197           <xslo:value-of select="."/>
198         </z:index>
199       </xslo:if>
200     </xslo:for-each>
201   </xslo:template>
202   <xslo:template mode="index_subfields" match="marc:datafield[@tag='016']">
203     <xslo:for-each select="marc:subfield">
204       <xslo:if test="contains('a', @code)">
205         <z:index name="Identifier-standard:w">
206           <xslo:value-of select="."/>
207         </z:index>
208       </xslo:if>
209     </xslo:for-each>
210     <xslo:for-each select="marc:subfield">
211       <xslo:if test="contains('z', @code)">
212         <z:index name="Identifier-standard:w">
213           <xslo:value-of select="."/>
214         </z:index>
215       </xslo:if>
216     </xslo:for-each>
217   </xslo:template>
218   <xslo:template mode="index_subfields" match="marc:datafield[@tag='017']">
219     <xslo:for-each select="marc:subfield">
220       <xslo:if test="contains('a', @code)">
221         <z:index name="Identifier-standard:w">
222           <xslo:value-of select="."/>
223         </z:index>
224       </xslo:if>
225     </xslo:for-each>
226     <xslo:for-each select="marc:subfield">
227       <xslo:if test="contains('z', @code)">
228         <z:index name="Identifier-standard:w">
229           <xslo:value-of select="."/>
230         </z:index>
231       </xslo:if>
232     </xslo:for-each>
233   </xslo:template>
234   <xslo:template mode="index_subfields" match="marc:datafield[@tag='040']">
235     <xslo:for-each select="marc:subfield">
236       <xslo:if test="contains('a', @code)">
237         <z:index name="Identifier-standard:w">
238           <xslo:value-of select="."/>
239         </z:index>
240       </xslo:if>
241     </xslo:for-each>
242     <xslo:for-each select="marc:subfield">
243       <xslo:if test="contains('z', @code)">
244         <z:index name="Identifier-standard:w">
245           <xslo:value-of select="."/>
246         </z:index>
247       </xslo:if>
248     </xslo:for-each>
249   </xslo:template>
250   <xslo:template mode="index_subfields" match="marc:datafield[@tag='071']">
251     <xslo:for-each select="marc:subfield">
252       <xslo:if test="contains('a', @code)">
253         <z:index name="Music-number:w Identifier-standard:w">
254           <xslo:value-of select="."/>
255         </z:index>
256       </xslo:if>
257     </xslo:for-each>
258     <xslo:for-each select="marc:subfield">
259       <xslo:if test="contains('z', @code)">
260         <z:index name="Music-number:w Identifier-standard:w">
261           <xslo:value-of select="."/>
262         </z:index>
263       </xslo:if>
264     </xslo:for-each>
265     <xslo:for-each select="marc:subfield">
266       <xslo:if test="contains('b', @code)">
267         <z:index name="Publisher:w Publisher:p">
268           <xslo:value-of select="."/>
269         </z:index>
270       </xslo:if>
271     </xslo:for-each>
272   </xslo:template>
273   <xslo:template mode="index_subfields" match="marc:datafield[@tag='072']">
274     <xslo:for-each select="marc:subfield">
275       <xslo:if test="contains('a', @code)">
276         <z:index name="UPC:w Identifier-standard:w">
277           <xslo:value-of select="."/>
278         </z:index>
279       </xslo:if>
280     </xslo:for-each>
281     <xslo:for-each select="marc:subfield">
282       <xslo:if test="contains('z', @code)">
283         <z:index name="UPC:w Identifier-standard:w">
284           <xslo:value-of select="."/>
285         </z:index>
286       </xslo:if>
287     </xslo:for-each>
288   </xslo:template>
289   <xslo:template mode="index_subfields" match="marc:datafield[@tag='073']">
290     <xslo:for-each select="marc:subfield">
291       <xslo:if test="contains('a', @code)">
292         <z:index name="EAN:w Identifier-standard:w">
293           <xslo:value-of select="."/>
294         </z:index>
295       </xslo:if>
296     </xslo:for-each>
297     <xslo:for-each select="marc:subfield">
298       <xslo:if test="contains('z', @code)">
299         <z:index name="EAN:w Identifier-standard:w">
300           <xslo:value-of select="."/>
301         </z:index>
302       </xslo:if>
303     </xslo:for-each>
304   </xslo:template>
305   <xslo:template mode="index_subfields" match="marc:datafield[@tag='200']">
306     <xslo:for-each select="marc:subfield">
307       <xslo:if test="contains('b', @code)">
308         <z:index name="itemtype:w itemtype:p itype:w itype:p">
309           <xslo:value-of select="."/>
310         </z:index>
311       </xslo:if>
312     </xslo:for-each>
313     <xslo:for-each select="marc:subfield">
314       <xslo:if test="contains('f', @code)">
315         <z:index name="Author:w Author:p">
316           <xslo:value-of select="."/>
317         </z:index>
318       </xslo:if>
319     </xslo:for-each>
320     <xslo:for-each select="marc:subfield">
321       <xslo:if test="contains('g', @code)">
322         <z:index name="Author:w Author:p">
323           <xslo:value-of select="."/>
324         </z:index>
325       </xslo:if>
326     </xslo:for-each>
327     <xslo:for-each select="marc:subfield">
328       <xslo:if test="contains('a', @code)">
329         <z:index name="Title:w Title:p Title:s Title-cover:w Title-cover:p Title-cover:s">
330           <xslo:value-of select="."/>
331         </z:index>
332       </xslo:if>
333     </xslo:for-each>
334     <xslo:for-each select="marc:subfield">
335       <xslo:if test="contains('c', @code)">
336         <z:index name="Title:w Title:p">
337           <xslo:value-of select="."/>
338         </z:index>
339       </xslo:if>
340     </xslo:for-each>
341     <xslo:for-each select="marc:subfield">
342       <xslo:if test="contains('d', @code)">
343         <z:index name="Title:w Title:p">
344           <xslo:value-of select="."/>
345         </z:index>
346       </xslo:if>
347     </xslo:for-each>
348     <xslo:for-each select="marc:subfield">
349       <xslo:if test="contains('e', @code)">
350         <z:index name="Title:w Title:p Title-cover:w Title-cover:p">
351           <xslo:value-of select="."/>
352         </z:index>
353       </xslo:if>
354     </xslo:for-each>
355     <xslo:for-each select="marc:subfield">
356       <xslo:if test="contains('i', @code)">
357         <z:index name="Title:w Title:p Title-cover:w Title-cover:p">
358           <xslo:value-of select="."/>
359         </z:index>
360       </xslo:if>
361     </xslo:for-each>
362   </xslo:template>
363   <xslo:template mode="index_subfields" match="marc:datafield[@tag='995']">
364     <xslo:for-each select="marc:subfield">
365       <xslo:if test="contains('r', @code)">
366         <z:index name="itemtype:w itemtype:p itype:w itype:p">
367           <xslo:value-of select="."/>
368         </z:index>
369       </xslo:if>
370     </xslo:for-each>
371     <xslo:for-each select="marc:subfield">
372       <xslo:if test="contains('2', @code)">
373         <z:index name="lost:w lost:n item:w">
374           <xslo:value-of select="."/>
375         </z:index>
376       </xslo:if>
377     </xslo:for-each>
378     <xslo:for-each select="marc:subfield">
379       <xslo:if test="contains('a', @code)">
380         <z:index name="homebranch:w Host-item:w item:w">
381           <xslo:value-of select="."/>
382         </z:index>
383       </xslo:if>
384     </xslo:for-each>
385     <xslo:for-each select="marc:subfield">
386       <xslo:if test="contains('b', @code)">
387         <z:index name="homebranch:w Host-item:w item:w">
388           <xslo:value-of select="."/>
389         </z:index>
390       </xslo:if>
391     </xslo:for-each>
392     <xslo:for-each select="marc:subfield">
393       <xslo:if test="contains('c', @code)">
394         <z:index name="holdingbranch:w Record-Source:w item: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('d', @code)">
401         <z:index name="holdingbranch:w Record-Source:w item: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('e', @code)">
408         <z:index name="location:w item:w">
409           <xslo:value-of select="."/>
410         </z:index>
411       </xslo:if>
412     </xslo:for-each>
413     <xslo:for-each select="marc:subfield">
414       <xslo:if test="contains('f', @code)">
415         <z:index name="barcode:w item:w">
416           <xslo:value-of select="."/>
417         </z:index>
418       </xslo:if>
419     </xslo:for-each>
420     <xslo:for-each select="marc:subfield">
421       <xslo:if test="contains('h', @code)">
422         <z:index name="ccode:w item:w">
423           <xslo:value-of select="."/>
424         </z:index>
425       </xslo:if>
426     </xslo:for-each>
427     <xslo:for-each select="marc:subfield">
428       <xslo:if test="contains('j', @code)">
429         <z:index name="LC-card-number:s item:w">
430           <xslo:value-of select="."/>
431         </z:index>
432       </xslo:if>
433     </xslo:for-each>
434     <xslo:for-each select="marc:subfield">
435       <xslo:if test="contains('k', @code)">
436         <z:index name="Call-Number:w Local-classification:w lcn:w Call-Number:p Local-classification:p lcn:p item:w Local-classification:s">
437           <xslo:value-of select="."/>
438         </z:index>
439       </xslo:if>
440     </xslo:for-each>
441     <xslo:for-each select="marc:subfield">
442       <xslo:if test="contains('n', @code)">
443         <z:index name="onloan:d onloan:n onloan:s onloan:w item:w">
444           <xslo:value-of select="."/>
445         </z:index>
446       </xslo:if>
447     </xslo:for-each>
448     <xslo:for-each select="marc:subfield">
449       <xslo:if test="contains('u', @code)">
450         <z:index name="Note:w Note:p item:w">
451           <xslo:value-of select="."/>
452         </z:index>
453       </xslo:if>
454     </xslo:for-each>
455   </xslo:template>
456   <xslo:template mode="index_subfields" match="marc:datafield[@tag='100']">
457     <xslo:for-each select="marc:subfield">
458       <xslo:if test="contains('a', @code)">
459         <z:index name="tpubdate:s ta:w ta:w ta:w Modified-code:n ln:s char-encoding:n char-encoding:n char-encoding:n script-Title:n">
460           <xslo:value-of select="."/>
461         </z:index>
462       </xslo:if>
463     </xslo:for-each>
464   </xslo:template>
465   <xslo:template mode="index_subfields" match="marc:datafield[@tag='101']">
466     <xslo:for-each select="marc:subfield">
467       <xslo:if test="contains('a', @code)">
468         <z:index name="ln:w">
469           <xslo:value-of select="."/>
470         </z:index>
471       </xslo:if>
472     </xslo:for-each>
473   </xslo:template>
474   <xslo:template mode="index_subfields" match="marc:datafield[@tag='102']">
475     <xslo:for-each select="marc:subfield">
476       <xslo:if test="contains('a', @code)">
477         <z:index name="Country-heading:w">
478           <xslo:value-of select="."/>
479         </z:index>
480       </xslo:if>
481     </xslo:for-each>
482   </xslo:template>
483   <xslo:template mode="index_subfields" match="marc:datafield[@tag='105']">
484     <xslo:for-each select="marc:subfield">
485       <xslo:if test="contains('a', @code)">
486         <z:index name="Illustration-code:w Content-type:w Content-type:w Content-type:w Content-type:w Conference-code:w Festschrift-indicator:w Index-indicator:w Literature-Code:w Biography-Code:w">
487           <xslo:value-of select="."/>
488         </z:index>
489       </xslo:if>
490     </xslo:for-each>
491   </xslo:template>
492   <xslo:template mode="index_subfields" match="marc:datafield[@tag='106']">
493     <xslo:for-each select="marc:subfield">
494       <xslo:if test="contains('a', @code)">
495         <z:index name="itype:w itype:p">
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='110']">
502     <xslo:for-each select="marc:subfield">
503       <xslo:if test="contains('a', @code)">
504         <z:index name="Type-Of-Serial:w Frequency-code:w Regularity-code:w Content-type:w Content-type:w Conference-publication-Code:w Title-Page-availability-Code:w Index-availability-Code:w Cumulative-Index-availability-Code:w">
505           <xslo:value-of select="."/>
506         </z:index>
507       </xslo:if>
508     </xslo:for-each>
509   </xslo:template>
510   <xslo:template mode="index_subfields" match="marc:datafield[@tag='115']">
511     <xslo:for-each select="marc:subfield">
512       <xslo:if test="contains('a', @code)">
513         <z:index name="Video-mt:w">
514           <xslo:value-of select="."/>
515         </z:index>
516       </xslo:if>
517     </xslo:for-each>
518   </xslo:template>
519   <xslo:template mode="index_subfields" match="marc:datafield[@tag='116']">
520     <xslo:for-each select="marc:subfield">
521       <xslo:if test="contains('a', @code)">
522         <z:index name="Graphics-type:w Graphics-support:w Graphics-support:w">
523           <xslo:value-of select="."/>
524         </z:index>
525       </xslo:if>
526     </xslo:for-each>
527   </xslo:template>
528   <xslo:template mode="index_subfields" match="marc:datafield[@tag='700']">
529     <xslo:for-each select="marc:subfield">
530       <xslo:if test="contains('9', @code)">
531         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
532           <xslo:value-of select="."/>
533         </z:index>
534       </xslo:if>
535     </xslo:for-each>
536     <xslo:for-each select="marc:subfield">
537       <xslo:if test="contains('a', @code)">
538         <z:index name="Author:w Personal-name:w Author:p Personal-name:p Personal-name:w Author:s">
539           <xslo:value-of select="."/>
540         </z:index>
541       </xslo:if>
542     </xslo:for-each>
543   </xslo:template>
544   <xslo:template mode="index_subfields" match="marc:datafield[@tag='701']">
545     <xslo:for-each select="marc:subfield">
546       <xslo:if test="contains('9', @code)">
547         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
548           <xslo:value-of select="."/>
549         </z:index>
550       </xslo:if>
551     </xslo:for-each>
552   </xslo:template>
553   <xslo:template mode="index_subfields" match="marc:datafield[@tag='702']">
554     <xslo:for-each select="marc:subfield">
555       <xslo:if test="contains('9', @code)">
556         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
557           <xslo:value-of select="."/>
558         </z:index>
559       </xslo:if>
560     </xslo:for-each>
561   </xslo:template>
562   <xslo:template mode="index_subfields" match="marc:datafield[@tag='710']">
563     <xslo:for-each select="marc:subfield">
564       <xslo:if test="contains('9', @code)">
565         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
566           <xslo:value-of select="."/>
567         </z:index>
568       </xslo:if>
569     </xslo:for-each>
570   </xslo:template>
571   <xslo:template mode="index_subfields" match="marc:datafield[@tag='711']">
572     <xslo:for-each select="marc:subfield">
573       <xslo:if test="contains('9', @code)">
574         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
575           <xslo:value-of select="."/>
576         </z:index>
577       </xslo:if>
578     </xslo:for-each>
579   </xslo:template>
580   <xslo:template mode="index_subfields" match="marc:datafield[@tag='712']">
581     <xslo:for-each select="marc:subfield">
582       <xslo:if test="contains('9', @code)">
583         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
584           <xslo:value-of select="."/>
585         </z:index>
586       </xslo:if>
587     </xslo:for-each>
588   </xslo:template>
589   <xslo:template mode="index_subfields" match="marc:datafield[@tag='716']">
590     <xslo:for-each select="marc:subfield">
591       <xslo:if test="contains('9', @code)">
592         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
593           <xslo:value-of select="."/>
594         </z:index>
595       </xslo:if>
596     </xslo:for-each>
597   </xslo:template>
598   <xslo:template mode="index_subfields" match="marc:datafield[@tag='720']">
599     <xslo:for-each select="marc:subfield">
600       <xslo:if test="contains('9', @code)">
601         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
602           <xslo:value-of select="."/>
603         </z:index>
604       </xslo:if>
605     </xslo:for-each>
606   </xslo:template>
607   <xslo:template mode="index_subfields" match="marc:datafield[@tag='721']">
608     <xslo:for-each select="marc:subfield">
609       <xslo:if test="contains('9', @code)">
610         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
611           <xslo:value-of select="."/>
612         </z:index>
613       </xslo:if>
614     </xslo:for-each>
615   </xslo:template>
616   <xslo:template mode="index_subfields" match="marc:datafield[@tag='722']">
617     <xslo:for-each select="marc:subfield">
618       <xslo:if test="contains('9', @code)">
619         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
620           <xslo:value-of select="."/>
621         </z:index>
622       </xslo:if>
623     </xslo:for-each>
624   </xslo:template>
625   <xslo:template mode="index_subfields" match="marc:datafield[@tag='730']">
626     <xslo:for-each select="marc:subfield">
627       <xslo:if test="contains('9', @code)">
628         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
629           <xslo:value-of select="."/>
630         </z:index>
631       </xslo:if>
632     </xslo:for-each>
633   </xslo:template>
634   <xslo:template mode="index_subfields" match="marc:datafield[@tag='230']">
635     <xslo:for-each select="marc:subfield">
636       <xslo:if test="contains('a', @code)">
637         <z:index name="Electronic-ressource:w">
638           <xslo:value-of select="."/>
639         </z:index>
640       </xslo:if>
641     </xslo:for-each>
642   </xslo:template>
643   <xslo:template mode="index_subfields" match="marc:datafield[@tag='210']">
644     <xslo:for-each select="marc:subfield">
645       <xslo:if test="contains('a', @code)">
646         <z:index name="pl:w pl:p">
647           <xslo:value-of select="."/>
648         </z:index>
649       </xslo:if>
650     </xslo:for-each>
651     <xslo:for-each select="marc:subfield">
652       <xslo:if test="contains('c', @code)">
653         <z:index name="Publisher:w Publisher:p">
654           <xslo:value-of select="."/>
655         </z:index>
656       </xslo:if>
657     </xslo:for-each>
658     <xslo:for-each select="marc:subfield">
659       <xslo:if test="contains('d', @code)">
660         <z:index name="pubdate:n pubdate:y pubdate:s">
661           <xslo:value-of select="."/>
662         </z:index>
663       </xslo:if>
664     </xslo:for-each>
665   </xslo:template>
666   <xslo:template mode="index_subfields" match="marc:datafield[@tag='225']">
667     <xslo:for-each select="marc:subfield">
668       <xslo:if test="contains('a', @code)">
669         <z:index name="Title-series:w Title-series:p">
670           <xslo:value-of select="."/>
671         </z:index>
672       </xslo:if>
673     </xslo:for-each>
674     <xslo:for-each select="marc:subfield">
675       <xslo:if test="contains('d', @code)">
676         <z:index name="Title-series:w Title-series:p">
677           <xslo:value-of select="."/>
678         </z:index>
679       </xslo:if>
680     </xslo:for-each>
681     <xslo:for-each select="marc:subfield">
682       <xslo:if test="contains('e', @code)">
683         <z:index name="Title-series:w Title-series:p">
684           <xslo:value-of select="."/>
685         </z:index>
686       </xslo:if>
687     </xslo:for-each>
688     <xslo:for-each select="marc:subfield">
689       <xslo:if test="contains('f', @code)">
690         <z:index name="Author:w Author:p Name-and-title:w Name-and-title:p">
691           <xslo:value-of select="."/>
692         </z:index>
693       </xslo:if>
694     </xslo:for-each>
695     <xslo:for-each select="marc:subfield">
696       <xslo:if test="contains('h', @code)">
697         <z:index name="Title-series:w Title-series:p">
698           <xslo:value-of select="."/>
699         </z:index>
700       </xslo:if>
701     </xslo:for-each>
702     <xslo:for-each select="marc:subfield">
703       <xslo:if test="contains('i', @code)">
704         <z:index name="Title-series:w Title-series:p">
705           <xslo:value-of select="."/>
706         </z:index>
707       </xslo:if>
708     </xslo:for-each>
709     <xslo:for-each select="marc:subfield">
710       <xslo:if test="contains('v', @code)">
711         <z:index name="Title-series:w Title-series:p">
712           <xslo:value-of select="."/>
713         </z:index>
714       </xslo:if>
715     </xslo:for-each>
716     <xslo:for-each select="marc:subfield">
717       <xslo:if test="contains('x', @code)">
718         <z:index name="ISSN: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='300']">
725     <xslo:for-each select="marc:subfield">
726       <xslo:if test="contains('a', @code)">
727         <z:index name="Note:w Note:p">
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='301']">
734     <xslo:for-each select="marc:subfield">
735       <xslo:if test="contains('a', @code)">
736         <z:index name="Note:w Note:p">
737           <xslo:value-of select="."/>
738         </z:index>
739       </xslo:if>
740     </xslo:for-each>
741   </xslo:template>
742   <xslo:template mode="index_subfields" match="marc:datafield[@tag='302']">
743     <xslo:for-each select="marc:subfield">
744       <xslo:if test="contains('a', @code)">
745         <z:index name="Note:w Note:p">
746           <xslo:value-of select="."/>
747         </z:index>
748       </xslo:if>
749     </xslo:for-each>
750   </xslo:template>
751   <xslo:template mode="index_subfields" match="marc:datafield[@tag='303']">
752     <xslo:for-each select="marc:subfield">
753       <xslo:if test="contains('a', @code)">
754         <z:index name="Note:w Note:p">
755           <xslo:value-of select="."/>
756         </z:index>
757       </xslo:if>
758     </xslo:for-each>
759   </xslo:template>
760   <xslo:template mode="index_subfields" match="marc:datafield[@tag='304']">
761     <xslo:for-each select="marc:subfield">
762       <xslo:if test="contains('a', @code)">
763         <z:index name="Note:w Note:p">
764           <xslo:value-of select="."/>
765         </z:index>
766       </xslo:if>
767     </xslo:for-each>
768   </xslo:template>
769   <xslo:template mode="index_subfields" match="marc:datafield[@tag='305']">
770     <xslo:for-each select="marc:subfield">
771       <xslo:if test="contains('a', @code)">
772         <z:index name="Note:w Note:p">
773           <xslo:value-of select="."/>
774         </z:index>
775       </xslo:if>
776     </xslo:for-each>
777   </xslo:template>
778   <xslo:template mode="index_subfields" match="marc:datafield[@tag='306']">
779     <xslo:for-each select="marc:subfield">
780       <xslo:if test="contains('a', @code)">
781         <z:index name="Note:w Note:p">
782           <xslo:value-of select="."/>
783         </z:index>
784       </xslo:if>
785     </xslo:for-each>
786   </xslo:template>
787   <xslo:template mode="index_subfields" match="marc:datafield[@tag='307']">
788     <xslo:for-each select="marc:subfield">
789       <xslo:if test="contains('a', @code)">
790         <z:index name="Note:w Note:p">
791           <xslo:value-of select="."/>
792         </z:index>
793       </xslo:if>
794     </xslo:for-each>
795   </xslo:template>
796   <xslo:template mode="index_subfields" match="marc:datafield[@tag='310']">
797     <xslo:for-each select="marc:subfield">
798       <xslo:if test="contains('a', @code)">
799         <z:index name="Note:w Note:p">
800           <xslo:value-of select="."/>
801         </z:index>
802       </xslo:if>
803     </xslo:for-each>
804   </xslo:template>
805   <xslo:template mode="index_subfields" match="marc:datafield[@tag='311']">
806     <xslo:for-each select="marc:subfield">
807       <xslo:if test="contains('a', @code)">
808         <z:index name="Note:w Note:p">
809           <xslo:value-of select="."/>
810         </z:index>
811       </xslo:if>
812     </xslo:for-each>
813   </xslo:template>
814   <xslo:template mode="index_subfields" match="marc:datafield[@tag='312']">
815     <xslo:for-each select="marc:subfield">
816       <xslo:if test="contains('a', @code)">
817         <z:index name="Note:w Note:p">
818           <xslo:value-of select="."/>
819         </z:index>
820       </xslo:if>
821     </xslo:for-each>
822   </xslo:template>
823   <xslo:template mode="index_subfields" match="marc:datafield[@tag='313']">
824     <xslo:for-each select="marc:subfield">
825       <xslo:if test="contains('a', @code)">
826         <z:index name="Note:w Note:p">
827           <xslo:value-of select="."/>
828         </z:index>
829       </xslo:if>
830     </xslo:for-each>
831   </xslo:template>
832   <xslo:template mode="index_subfields" match="marc:datafield[@tag='314']">
833     <xslo:for-each select="marc:subfield">
834       <xslo:if test="contains('a', @code)">
835         <z:index name="Note:w Note:p">
836           <xslo:value-of select="."/>
837         </z:index>
838       </xslo:if>
839     </xslo:for-each>
840   </xslo:template>
841   <xslo:template mode="index_subfields" match="marc:datafield[@tag='315']">
842     <xslo:for-each select="marc:subfield">
843       <xslo:if test="contains('a', @code)">
844         <z:index name="Note:w Note:p">
845           <xslo:value-of select="."/>
846         </z:index>
847       </xslo:if>
848     </xslo:for-each>
849   </xslo:template>
850   <xslo:template mode="index_subfields" match="marc:datafield[@tag='316']">
851     <xslo:for-each select="marc:subfield">
852       <xslo:if test="contains('a', @code)">
853         <z:index name="Note:w Note:p">
854           <xslo:value-of select="."/>
855         </z:index>
856       </xslo:if>
857     </xslo:for-each>
858   </xslo:template>
859   <xslo:template mode="index_subfields" match="marc:datafield[@tag='317']">
860     <xslo:for-each select="marc:subfield">
861       <xslo:if test="contains('a', @code)">
862         <z:index name="Note:w Note:p">
863           <xslo:value-of select="."/>
864         </z:index>
865       </xslo:if>
866     </xslo:for-each>
867   </xslo:template>
868   <xslo:template mode="index_subfields" match="marc:datafield[@tag='318']">
869     <xslo:for-each select="marc:subfield">
870       <xslo:if test="contains('a', @code)">
871         <z:index name="Note:w Note:p">
872           <xslo:value-of select="."/>
873         </z:index>
874       </xslo:if>
875     </xslo:for-each>
876   </xslo:template>
877   <xslo:template mode="index_subfields" match="marc:datafield[@tag='320']">
878     <xslo:for-each select="marc:subfield">
879       <xslo:if test="contains('a', @code)">
880         <z:index name="Note:w Note:p">
881           <xslo:value-of select="."/>
882         </z:index>
883       </xslo:if>
884     </xslo:for-each>
885   </xslo:template>
886   <xslo:template mode="index_subfields" match="marc:datafield[@tag='321']">
887     <xslo:for-each select="marc:subfield">
888       <xslo:if test="contains('a', @code)">
889         <z:index name="Note:w Note:p">
890           <xslo:value-of select="."/>
891         </z:index>
892       </xslo:if>
893     </xslo:for-each>
894   </xslo:template>
895   <xslo:template mode="index_subfields" match="marc:datafield[@tag='322']">
896     <xslo:for-each select="marc:subfield">
897       <xslo:if test="contains('a', @code)">
898         <z:index name="Note:w Note:p">
899           <xslo:value-of select="."/>
900         </z:index>
901       </xslo:if>
902     </xslo:for-each>
903   </xslo:template>
904   <xslo:template mode="index_subfields" match="marc:datafield[@tag='323']">
905     <xslo:for-each select="marc:subfield">
906       <xslo:if test="contains('a', @code)">
907         <z:index name="Note:w Note:p">
908           <xslo:value-of select="."/>
909         </z:index>
910       </xslo:if>
911     </xslo:for-each>
912   </xslo:template>
913   <xslo:template mode="index_subfields" match="marc:datafield[@tag='324']">
914     <xslo:for-each select="marc:subfield">
915       <xslo:if test="contains('a', @code)">
916         <z:index name="Note:w Note:p">
917           <xslo:value-of select="."/>
918         </z:index>
919       </xslo:if>
920     </xslo:for-each>
921   </xslo:template>
922   <xslo:template mode="index_subfields" match="marc:datafield[@tag='325']">
923     <xslo:for-each select="marc:subfield">
924       <xslo:if test="contains('a', @code)">
925         <z:index name="Note:w Note:p">
926           <xslo:value-of select="."/>
927         </z:index>
928       </xslo:if>
929     </xslo:for-each>
930   </xslo:template>
931   <xslo:template mode="index_subfields" match="marc:datafield[@tag='326']">
932     <xslo:for-each select="marc:subfield">
933       <xslo:if test="contains('a', @code)">
934         <z:index name="Note:w Note:p">
935           <xslo:value-of select="."/>
936         </z:index>
937       </xslo:if>
938     </xslo:for-each>
939   </xslo:template>
940   <xslo:template mode="index_subfields" match="marc:datafield[@tag='327']">
941     <xslo:for-each select="marc:subfield">
942       <xslo:if test="contains('a', @code)">
943         <z:index name="Note:w Note:p">
944           <xslo:value-of select="."/>
945         </z:index>
946       </xslo:if>
947     </xslo:for-each>
948   </xslo:template>
949   <xslo:template mode="index_subfields" match="marc:datafield[@tag='330']">
950     <xslo:for-each select="marc:subfield">
951       <xslo:if test="contains('a', @code)">
952         <z:index name="Abstract:w Note:w Abstract:p Note:p">
953           <xslo:value-of select="."/>
954         </z:index>
955       </xslo:if>
956     </xslo:for-each>
957   </xslo:template>
958   <xslo:template mode="index_subfields" match="marc:datafield[@tag='332']">
959     <xslo:for-each select="marc:subfield">
960       <xslo:if test="contains('a', @code)">
961         <z:index name="Note:w Note:p">
962           <xslo:value-of select="."/>
963         </z:index>
964       </xslo:if>
965     </xslo:for-each>
966   </xslo:template>
967   <xslo:template mode="index_subfields" match="marc:datafield[@tag='333']">
968     <xslo:for-each select="marc:subfield">
969       <xslo:if test="contains('a', @code)">
970         <z:index name="Note:w Note:p">
971           <xslo:value-of select="."/>
972         </z:index>
973       </xslo:if>
974     </xslo:for-each>
975   </xslo:template>
976   <xslo:template mode="index_subfields" match="marc:datafield[@tag='334']">
977     <xslo:for-each select="marc:subfield">
978       <xslo:if test="contains('a', @code)">
979         <z:index name="Note:w Note:p">
980           <xslo:value-of select="."/>
981         </z:index>
982       </xslo:if>
983     </xslo:for-each>
984   </xslo:template>
985   <xslo:template mode="index_subfields" match="marc:datafield[@tag='336']">
986     <xslo:for-each select="marc:subfield">
987       <xslo:if test="contains('a', @code)">
988         <z:index name="Note:w Note:p">
989           <xslo:value-of select="."/>
990         </z:index>
991       </xslo:if>
992     </xslo:for-each>
993   </xslo:template>
994   <xslo:template mode="index_subfields" match="marc:datafield[@tag='337']">
995     <xslo:for-each select="marc:subfield">
996       <xslo:if test="contains('a', @code)">
997         <z:index name="Note:w Note:p">
998           <xslo:value-of select="."/>
999         </z:index>
1000       </xslo:if>
1001     </xslo:for-each>
1002   </xslo:template>
1003   <xslo:template mode="index_subfields" match="marc:datafield[@tag='345']">
1004     <xslo:for-each select="marc:subfield">
1005       <xslo:if test="contains('a', @code)">
1006         <z:index name="Note:w Note:p">
1007           <xslo:value-of select="."/>
1008         </z:index>
1009       </xslo:if>
1010     </xslo:for-each>
1011   </xslo:template>
1012   <xslo:template mode="index_subfields" match="marc:datafield[@tag='410']">
1013     <xslo:for-each select="marc:subfield">
1014       <xslo:if test="contains('t', @code)">
1015         <z:index name="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('d', @code)">
1022         <z:index name="pubdate:n">
1023           <xslo:value-of select="."/>
1024         </z:index>
1025       </xslo:if>
1026     </xslo:for-each>
1027   </xslo:template>
1028   <xslo:template mode="index_subfields" match="marc:datafield[@tag='411']">
1029     <xslo:for-each select="marc:subfield">
1030       <xslo:if test="contains('t', @code)">
1031         <z:index name="Title:w Title:p">
1032           <xslo:value-of select="."/>
1033         </z:index>
1034       </xslo:if>
1035     </xslo:for-each>
1036   </xslo:template>
1037   <xslo:template mode="index_subfields" match="marc:datafield[@tag='412']">
1038     <xslo:for-each select="marc:subfield">
1039       <xslo:if test="contains('t', @code)">
1040         <z:index name="Title:w Title:p">
1041           <xslo:value-of select="."/>
1042         </z:index>
1043       </xslo:if>
1044     </xslo:for-each>
1045     <xslo:for-each select="marc:subfield">
1046       <xslo:if test="contains('d', @code)">
1047         <z:index name="pubdate:n">
1048           <xslo:value-of select="."/>
1049         </z:index>
1050       </xslo:if>
1051     </xslo:for-each>
1052   </xslo:template>
1053   <xslo:template mode="index_subfields" match="marc:datafield[@tag='413']">
1054     <xslo:for-each select="marc:subfield">
1055       <xslo:if test="contains('t', @code)">
1056         <z:index name="Title:w Title:p">
1057           <xslo:value-of select="."/>
1058         </z:index>
1059       </xslo:if>
1060     </xslo:for-each>
1061     <xslo:for-each select="marc:subfield">
1062       <xslo:if test="contains('d', @code)">
1063         <z:index name="pubdate:n">
1064           <xslo:value-of select="."/>
1065         </z:index>
1066       </xslo:if>
1067     </xslo:for-each>
1068   </xslo:template>
1069   <xslo:template mode="index_subfields" match="marc:datafield[@tag='421']">
1070     <xslo:for-each select="marc:subfield">
1071       <xslo:if test="contains('t', @code)">
1072         <z:index name="Title:w Title:p">
1073           <xslo:value-of select="."/>
1074         </z:index>
1075       </xslo:if>
1076     </xslo:for-each>
1077   </xslo:template>
1078   <xslo:template mode="index_subfields" match="marc:datafield[@tag='422']">
1079     <xslo:for-each select="marc:subfield">
1080       <xslo:if test="contains('t', @code)">
1081         <z:index name="Title:w Title:p">
1082           <xslo:value-of select="."/>
1083         </z:index>
1084       </xslo:if>
1085     </xslo:for-each>
1086   </xslo:template>
1087   <xslo:template mode="index_subfields" match="marc:datafield[@tag='423']">
1088     <xslo:for-each select="marc:subfield">
1089       <xslo:if test="contains('t', @code)">
1090         <z:index name="Title:w Title:p">
1091           <xslo:value-of select="."/>
1092         </z:index>
1093       </xslo:if>
1094     </xslo:for-each>
1095   </xslo:template>
1096   <xslo:template mode="index_subfields" match="marc:datafield[@tag='424']">
1097     <xslo:for-each select="marc:subfield">
1098       <xslo:if test="contains('t', @code)">
1099         <z:index name="Title:w Title:p">
1100           <xslo:value-of select="."/>
1101         </z:index>
1102       </xslo:if>
1103     </xslo:for-each>
1104   </xslo:template>
1105   <xslo:template mode="index_subfields" match="marc:datafield[@tag='425']">
1106     <xslo:for-each select="marc:subfield">
1107       <xslo:if test="contains('t', @code)">
1108         <z:index name="Title:w Title:p">
1109           <xslo:value-of select="."/>
1110         </z:index>
1111       </xslo:if>
1112     </xslo:for-each>
1113   </xslo:template>
1114   <xslo:template mode="index_subfields" match="marc:datafield[@tag='430']">
1115     <xslo:for-each select="marc:subfield">
1116       <xslo:if test="contains('t', @code)">
1117         <z:index name="Title:w Title:p">
1118           <xslo:value-of select="."/>
1119         </z:index>
1120       </xslo:if>
1121     </xslo:for-each>
1122     <xslo:for-each select="marc:subfield">
1123       <xslo:if test="contains('d', @code)">
1124         <z:index name="pubdate:n">
1125           <xslo:value-of select="."/>
1126         </z:index>
1127       </xslo:if>
1128     </xslo:for-each>
1129   </xslo:template>
1130   <xslo:template mode="index_subfields" match="marc:datafield[@tag='431']">
1131     <xslo:for-each select="marc:subfield">
1132       <xslo:if test="contains('t', @code)">
1133         <z:index name="Title:w Title:p">
1134           <xslo:value-of select="."/>
1135         </z:index>
1136       </xslo:if>
1137     </xslo:for-each>
1138     <xslo:for-each select="marc:subfield">
1139       <xslo:if test="contains('d', @code)">
1140         <z:index name="pubdate:n">
1141           <xslo:value-of select="."/>
1142         </z:index>
1143       </xslo:if>
1144     </xslo:for-each>
1145   </xslo:template>
1146   <xslo:template mode="index_subfields" match="marc:datafield[@tag='432']">
1147     <xslo:for-each select="marc:subfield">
1148       <xslo:if test="contains('t', @code)">
1149         <z:index name="Title:w Title:p">
1150           <xslo:value-of select="."/>
1151         </z:index>
1152       </xslo:if>
1153     </xslo:for-each>
1154     <xslo:for-each select="marc:subfield">
1155       <xslo:if test="contains('d', @code)">
1156         <z:index name="pubdate:n">
1157           <xslo:value-of select="."/>
1158         </z:index>
1159       </xslo:if>
1160     </xslo:for-each>
1161   </xslo:template>
1162   <xslo:template mode="index_subfields" match="marc:datafield[@tag='433']">
1163     <xslo:for-each select="marc:subfield">
1164       <xslo:if test="contains('t', @code)">
1165         <z:index name="Title:w Title:p">
1166           <xslo:value-of select="."/>
1167         </z:index>
1168       </xslo:if>
1169     </xslo:for-each>
1170   </xslo:template>
1171   <xslo:template mode="index_subfields" match="marc:datafield[@tag='434']">
1172     <xslo:for-each select="marc:subfield">
1173       <xslo:if test="contains('t', @code)">
1174         <z:index name="Title:w Title:p">
1175           <xslo:value-of select="."/>
1176         </z:index>
1177       </xslo:if>
1178     </xslo:for-each>
1179   </xslo:template>
1180   <xslo:template mode="index_subfields" match="marc:datafield[@tag='435']">
1181     <xslo:for-each select="marc:subfield">
1182       <xslo:if test="contains('t', @code)">
1183         <z:index name="Title:w Title:p">
1184           <xslo:value-of select="."/>
1185         </z:index>
1186       </xslo:if>
1187     </xslo:for-each>
1188   </xslo:template>
1189   <xslo:template mode="index_subfields" match="marc:datafield[@tag='436']">
1190     <xslo:for-each select="marc:subfield">
1191       <xslo:if test="contains('t', @code)">
1192         <z:index name="Title:w Title:p">
1193           <xslo:value-of select="."/>
1194         </z:index>
1195       </xslo:if>
1196     </xslo:for-each>
1197   </xslo:template>
1198   <xslo:template mode="index_subfields" match="marc:datafield[@tag='437']">
1199     <xslo:for-each select="marc:subfield">
1200       <xslo:if test="contains('t', @code)">
1201         <z:index name="Title:w Title:p">
1202           <xslo:value-of select="."/>
1203         </z:index>
1204       </xslo:if>
1205     </xslo:for-each>
1206   </xslo:template>
1207   <xslo:template mode="index_subfields" match="marc:datafield[@tag='440']">
1208     <xslo:for-each select="marc:subfield">
1209       <xslo:if test="contains('t', @code)">
1210         <z:index name="Title:w Title:p">
1211           <xslo:value-of select="."/>
1212         </z:index>
1213       </xslo:if>
1214     </xslo:for-each>
1215     <xslo:for-each select="marc:subfield">
1216       <xslo:if test="contains('d', @code)">
1217         <z:index name="pubdate:n">
1218           <xslo:value-of select="."/>
1219         </z:index>
1220       </xslo:if>
1221     </xslo:for-each>
1222   </xslo:template>
1223   <xslo:template mode="index_subfields" match="marc:datafield[@tag='441']">
1224     <xslo:for-each select="marc:subfield">
1225       <xslo:if test="contains('t', @code)">
1226         <z:index name="Title:w Title:p">
1227           <xslo:value-of select="."/>
1228         </z:index>
1229       </xslo:if>
1230     </xslo:for-each>
1231     <xslo:for-each select="marc:subfield">
1232       <xslo:if test="contains('d', @code)">
1233         <z:index name="pubdate:n">
1234           <xslo:value-of select="."/>
1235         </z:index>
1236       </xslo:if>
1237     </xslo:for-each>
1238   </xslo:template>
1239   <xslo:template mode="index_subfields" match="marc:datafield[@tag='442']">
1240     <xslo:for-each select="marc:subfield">
1241       <xslo:if test="contains('t', @code)">
1242         <z:index name="Title:w Title:p">
1243           <xslo:value-of select="."/>
1244         </z:index>
1245       </xslo:if>
1246     </xslo:for-each>
1247   </xslo:template>
1248   <xslo:template mode="index_subfields" match="marc:datafield[@tag='443']">
1249     <xslo:for-each select="marc:subfield">
1250       <xslo:if test="contains('t', @code)">
1251         <z:index name="Title:w Title:p">
1252           <xslo:value-of select="."/>
1253         </z:index>
1254       </xslo:if>
1255     </xslo:for-each>
1256   </xslo:template>
1257   <xslo:template mode="index_subfields" match="marc:datafield[@tag='444']">
1258     <xslo:for-each select="marc:subfield">
1259       <xslo:if test="contains('t', @code)">
1260         <z:index name="Title:w Title:p">
1261           <xslo:value-of select="."/>
1262         </z:index>
1263       </xslo:if>
1264     </xslo:for-each>
1265   </xslo:template>
1266   <xslo:template mode="index_subfields" match="marc:datafield[@tag='445']">
1267     <xslo:for-each select="marc:subfield">
1268       <xslo:if test="contains('t', @code)">
1269         <z:index name="Title:w Title:p">
1270           <xslo:value-of select="."/>
1271         </z:index>
1272       </xslo:if>
1273     </xslo:for-each>
1274     <xslo:for-each select="marc:subfield">
1275       <xslo:if test="contains('d', @code)">
1276         <z:index name="pubdate:n">
1277           <xslo:value-of select="."/>
1278         </z:index>
1279       </xslo:if>
1280     </xslo:for-each>
1281   </xslo:template>
1282   <xslo:template mode="index_subfields" match="marc:datafield[@tag='446']">
1283     <xslo:for-each select="marc:subfield">
1284       <xslo:if test="contains('t', @code)">
1285         <z:index name="Title:w Title:p">
1286           <xslo:value-of select="."/>
1287         </z:index>
1288       </xslo:if>
1289     </xslo:for-each>
1290   </xslo:template>
1291   <xslo:template mode="index_subfields" match="marc:datafield[@tag='447']">
1292     <xslo:for-each select="marc:subfield">
1293       <xslo:if test="contains('t', @code)">
1294         <z:index name="Title:w Title:p">
1295           <xslo:value-of select="."/>
1296         </z:index>
1297       </xslo:if>
1298     </xslo:for-each>
1299   </xslo:template>
1300   <xslo:template mode="index_subfields" match="marc:datafield[@tag='448']">
1301     <xslo:for-each select="marc:subfield">
1302       <xslo:if test="contains('t', @code)">
1303         <z:index name="Title:w Title:p">
1304           <xslo:value-of select="."/>
1305         </z:index>
1306       </xslo:if>
1307     </xslo:for-each>
1308   </xslo:template>
1309   <xslo:template mode="index_subfields" match="marc:datafield[@tag='451']">
1310     <xslo:for-each select="marc:subfield">
1311       <xslo:if test="contains('t', @code)">
1312         <z:index name="Title:w Title:p">
1313           <xslo:value-of select="."/>
1314         </z:index>
1315       </xslo:if>
1316     </xslo:for-each>
1317   </xslo:template>
1318   <xslo:template mode="index_subfields" match="marc:datafield[@tag='452']">
1319     <xslo:for-each select="marc:subfield">
1320       <xslo:if test="contains('t', @code)">
1321         <z:index name="Title:w Title:p">
1322           <xslo:value-of select="."/>
1323         </z:index>
1324       </xslo:if>
1325     </xslo:for-each>
1326   </xslo:template>
1327   <xslo:template mode="index_subfields" match="marc:datafield[@tag='453']">
1328     <xslo:for-each select="marc:subfield">
1329       <xslo:if test="contains('t', @code)">
1330         <z:index name="Title:w Title:p">
1331           <xslo:value-of select="."/>
1332         </z:index>
1333       </xslo:if>
1334     </xslo:for-each>
1335   </xslo:template>
1336   <xslo:template mode="index_subfields" match="marc:datafield[@tag='454']">
1337     <xslo:for-each select="marc:subfield">
1338       <xslo:if test="contains('t', @code)">
1339         <z:index name="Title:w Title:p">
1340           <xslo:value-of select="."/>
1341         </z:index>
1342       </xslo:if>
1343     </xslo:for-each>
1344   </xslo:template>
1345   <xslo:template mode="index_subfields" match="marc:datafield[@tag='455']">
1346     <xslo:for-each select="marc:subfield">
1347       <xslo:if test="contains('t', @code)">
1348         <z:index name="Title:w Title:p">
1349           <xslo:value-of select="."/>
1350         </z:index>
1351       </xslo:if>
1352     </xslo:for-each>
1353   </xslo:template>
1354   <xslo:template mode="index_subfields" match="marc:datafield[@tag='456']">
1355     <xslo:for-each select="marc:subfield">
1356       <xslo:if test="contains('t', @code)">
1357         <z:index name="Title:w Title:p">
1358           <xslo:value-of select="."/>
1359         </z:index>
1360       </xslo:if>
1361     </xslo:for-each>
1362   </xslo:template>
1363   <xslo:template mode="index_subfields" match="marc:datafield[@tag='461']">
1364     <xslo:for-each select="marc:subfield">
1365       <xslo:if test="contains('t', @code)">
1366         <z:index name="Title:w Title-host:w title-host:p">
1367           <xslo:value-of select="."/>
1368         </z:index>
1369       </xslo:if>
1370     </xslo:for-each>
1371     <xslo:for-each select="marc:subfield">
1372       <xslo:if test="contains('9', @code)">
1373         <z:index name="Host-Item-Number:w">
1374           <xslo:value-of select="."/>
1375         </z:index>
1376       </xslo:if>
1377     </xslo:for-each>
1378     <xslo:for-each select="marc:subfield">
1379       <xslo:if test="contains('d', @code)">
1380         <z:index name="pubdate:n">
1381           <xslo:value-of select="."/>
1382         </z:index>
1383       </xslo:if>
1384     </xslo:for-each>
1385     <xslo:for-each select="marc:subfield">
1386       <xslo:if test="contains('9', @code)">
1387         <z:index name="Host-Item-Number:w">
1388           <xslo:value-of select="."/>
1389         </z:index>
1390       </xslo:if>
1391     </xslo:for-each>
1392   </xslo:template>
1393   <xslo:template mode="index_subfields" match="marc:datafield[@tag='462']">
1394     <xslo:for-each select="marc:subfield">
1395       <xslo:if test="contains('t', @code)">
1396         <z:index name="Title:w Title:p">
1397           <xslo:value-of select="."/>
1398         </z:index>
1399       </xslo:if>
1400     </xslo:for-each>
1401   </xslo:template>
1402   <xslo:template mode="index_subfields" match="marc:datafield[@tag='463']">
1403     <xslo:for-each select="marc:subfield">
1404       <xslo:if test="contains('t', @code)">
1405         <z:index name="Title:w Title:p">
1406           <xslo:value-of select="."/>
1407         </z:index>
1408       </xslo:if>
1409     </xslo:for-each>
1410   </xslo:template>
1411   <xslo:template mode="index_subfields" match="marc:datafield[@tag='464']">
1412     <xslo:for-each select="marc:subfield">
1413       <xslo:if test="contains('t', @code)">
1414         <z:index name="Title:w Title-host:w title-host:p Title:p">
1415           <xslo:value-of select="."/>
1416         </z:index>
1417       </xslo:if>
1418     </xslo:for-each>
1419   </xslo:template>
1420   <xslo:template mode="index_subfields" match="marc:datafield[@tag='470']">
1421     <xslo:for-each select="marc:subfield">
1422       <xslo:if test="contains('t', @code)">
1423         <z:index name="Title:w Title:p">
1424           <xslo:value-of select="."/>
1425         </z:index>
1426       </xslo:if>
1427     </xslo:for-each>
1428   </xslo:template>
1429   <xslo:template mode="index_subfields" match="marc:datafield[@tag='481']">
1430     <xslo:for-each select="marc:subfield">
1431       <xslo:if test="contains('t', @code)">
1432         <z:index name="Title:w Title:p">
1433           <xslo:value-of select="."/>
1434         </z:index>
1435       </xslo:if>
1436     </xslo:for-each>
1437   </xslo:template>
1438   <xslo:template mode="index_subfields" match="marc:datafield[@tag='482']">
1439     <xslo:for-each select="marc:subfield">
1440       <xslo:if test="contains('t', @code)">
1441         <z:index name="Title:w Title:p">
1442           <xslo:value-of select="."/>
1443         </z:index>
1444       </xslo:if>
1445     </xslo:for-each>
1446   </xslo:template>
1447   <xslo:template mode="index_subfields" match="marc:datafield[@tag='488']">
1448     <xslo:for-each select="marc:subfield">
1449       <xslo:if test="contains('t', @code)">
1450         <z:index name="Title:w Title:p">
1451           <xslo:value-of select="."/>
1452         </z:index>
1453       </xslo:if>
1454     </xslo:for-each>
1455   </xslo:template>
1456   <xslo:template mode="index_subfields" match="marc:datafield[@tag='400']">
1457     <xslo:for-each select="marc:subfield">
1458       <xslo:if test="contains('t', @code)">
1459         <z:index name="Title:w Title:p">
1460           <xslo:value-of select="."/>
1461         </z:index>
1462       </xslo:if>
1463     </xslo:for-each>
1464     <xslo:for-each select="marc:subfield">
1465       <xslo:if test="contains('d', @code)">
1466         <z:index name="pubdate:n">
1467           <xslo:value-of select="."/>
1468         </z:index>
1469       </xslo:if>
1470     </xslo:for-each>
1471   </xslo:template>
1472   <xslo:template mode="index_subfields" match="marc:datafield[@tag='401']">
1473     <xslo:for-each select="marc:subfield">
1474       <xslo:if test="contains('t', @code)">
1475         <z:index name="Title:w Title:p">
1476           <xslo:value-of select="."/>
1477         </z:index>
1478       </xslo:if>
1479     </xslo:for-each>
1480     <xslo:for-each select="marc:subfield">
1481       <xslo:if test="contains('d', @code)">
1482         <z:index name="pubdate:n">
1483           <xslo:value-of select="."/>
1484         </z:index>
1485       </xslo:if>
1486     </xslo:for-each>
1487   </xslo:template>
1488   <xslo:template mode="index_subfields" match="marc:datafield[@tag='403']">
1489     <xslo:for-each select="marc:subfield">
1490       <xslo:if test="contains('t', @code)">
1491         <z:index name="Title:w Title:p Title-Uniform:w Title-Uniform:p">
1492           <xslo:value-of select="."/>
1493         </z:index>
1494       </xslo:if>
1495     </xslo:for-each>
1496     <xslo:for-each select="marc:subfield">
1497       <xslo:if test="contains('d', @code)">
1498         <z:index name="pubdate:n">
1499           <xslo:value-of select="."/>
1500         </z:index>
1501       </xslo:if>
1502     </xslo:for-each>
1503   </xslo:template>
1504   <xslo:template mode="index_subfields" match="marc:datafield[@tag='414']">
1505     <xslo:for-each select="marc:subfield">
1506       <xslo:if test="contains('t', @code)">
1507         <z:index name="Title:w Title:p">
1508           <xslo:value-of select="."/>
1509         </z:index>
1510       </xslo:if>
1511     </xslo:for-each>
1512     <xslo:for-each select="marc:subfield">
1513       <xslo:if test="contains('d', @code)">
1514         <z:index name="pubdate:n">
1515           <xslo:value-of select="."/>
1516         </z:index>
1517       </xslo:if>
1518     </xslo:for-each>
1519   </xslo:template>
1520   <xslo:template mode="index_subfields" match="marc:datafield[@tag='415']">
1521     <xslo:for-each select="marc:subfield">
1522       <xslo:if test="contains('t', @code)">
1523         <z:index name="Title:w Title:p">
1524           <xslo:value-of select="."/>
1525         </z:index>
1526       </xslo:if>
1527     </xslo:for-each>
1528     <xslo:for-each select="marc:subfield">
1529       <xslo:if test="contains('d', @code)">
1530         <z:index name="pubdate:n">
1531           <xslo:value-of select="."/>
1532         </z:index>
1533       </xslo:if>
1534     </xslo:for-each>
1535   </xslo:template>
1536   <xslo:template mode="index_subfields" match="marc:datafield[@tag='416']">
1537     <xslo:for-each select="marc:subfield">
1538       <xslo:if test="contains('t', @code)">
1539         <z:index name="Title:w Title:p">
1540           <xslo:value-of select="."/>
1541         </z:index>
1542       </xslo:if>
1543     </xslo:for-each>
1544     <xslo:for-each select="marc:subfield">
1545       <xslo:if test="contains('d', @code)">
1546         <z:index name="pubdate:n">
1547           <xslo:value-of select="."/>
1548         </z:index>
1549       </xslo:if>
1550     </xslo:for-each>
1551   </xslo:template>
1552   <xslo:template mode="index_subfields" match="marc:datafield[@tag='417']">
1553     <xslo:for-each select="marc:subfield">
1554       <xslo:if test="contains('t', @code)">
1555         <z:index name="Title:w Title:p">
1556           <xslo:value-of select="."/>
1557         </z:index>
1558       </xslo:if>
1559     </xslo:for-each>
1560     <xslo:for-each select="marc:subfield">
1561       <xslo:if test="contains('d', @code)">
1562         <z:index name="pubdate:n">
1563           <xslo:value-of select="."/>
1564         </z:index>
1565       </xslo:if>
1566     </xslo:for-each>
1567   </xslo:template>
1568   <xslo:template mode="index_subfields" match="marc:datafield[@tag='418']">
1569     <xslo:for-each select="marc:subfield">
1570       <xslo:if test="contains('t', @code)">
1571         <z:index name="Title:w Title:p">
1572           <xslo:value-of select="."/>
1573         </z:index>
1574       </xslo:if>
1575     </xslo:for-each>
1576     <xslo:for-each select="marc:subfield">
1577       <xslo:if test="contains('d', @code)">
1578         <z:index name="pubdate:n">
1579           <xslo:value-of select="."/>
1580         </z:index>
1581       </xslo:if>
1582     </xslo:for-each>
1583   </xslo:template>
1584   <xslo:template mode="index_subfields" match="marc:datafield[@tag='419']">
1585     <xslo:for-each select="marc:subfield">
1586       <xslo:if test="contains('t', @code)">
1587         <z:index name="Title:w Title:p">
1588           <xslo:value-of select="."/>
1589         </z:index>
1590       </xslo:if>
1591     </xslo:for-each>
1592     <xslo:for-each select="marc:subfield">
1593       <xslo:if test="contains('d', @code)">
1594         <z:index name="pubdate:n">
1595           <xslo:value-of select="."/>
1596         </z:index>
1597       </xslo:if>
1598     </xslo:for-each>
1599   </xslo:template>
1600   <xslo:template mode="index_subfields" match="marc:datafield[@tag='420']">
1601     <xslo:for-each select="marc:subfield">
1602       <xslo:if test="contains('t', @code)">
1603         <z:index name="Title:w Title:p">
1604           <xslo:value-of select="."/>
1605         </z:index>
1606       </xslo:if>
1607     </xslo:for-each>
1608     <xslo:for-each select="marc:subfield">
1609       <xslo:if test="contains('d', @code)">
1610         <z:index name="pubdate:n">
1611           <xslo:value-of select="."/>
1612         </z:index>
1613       </xslo:if>
1614     </xslo:for-each>
1615   </xslo:template>
1616   <xslo:template mode="index_subfields" match="marc:datafield[@tag='500']">
1617     <xslo:for-each select="marc:subfield">
1618       <xslo:if test="contains('9', @code)">
1619         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1620           <xslo:value-of select="."/>
1621         </z:index>
1622       </xslo:if>
1623     </xslo:for-each>
1624   </xslo:template>
1625   <xslo:template mode="index_subfields" match="marc:datafield[@tag='501']">
1626     <xslo:for-each select="marc:subfield">
1627       <xslo:if test="contains('9', @code)">
1628         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1629           <xslo:value-of select="."/>
1630         </z:index>
1631       </xslo:if>
1632     </xslo:for-each>
1633   </xslo:template>
1634   <xslo:template mode="index_subfields" match="marc:datafield[@tag='503']">
1635     <xslo:for-each select="marc:subfield">
1636       <xslo:if test="contains('9', @code)">
1637         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1638           <xslo:value-of select="."/>
1639         </z:index>
1640       </xslo:if>
1641     </xslo:for-each>
1642   </xslo:template>
1643   <xslo:template mode="index_subfields" match="marc:datafield[@tag='510']">
1644     <xslo:for-each select="marc:subfield">
1645       <xslo:if test="contains('9', @code)">
1646         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1647           <xslo:value-of select="."/>
1648         </z:index>
1649       </xslo:if>
1650     </xslo:for-each>
1651   </xslo:template>
1652   <xslo:template mode="index_subfields" match="marc:datafield[@tag='512']">
1653     <xslo:for-each select="marc:subfield">
1654       <xslo:if test="contains('9', @code)">
1655         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1656           <xslo:value-of select="."/>
1657         </z:index>
1658       </xslo:if>
1659     </xslo:for-each>
1660   </xslo:template>
1661   <xslo:template mode="index_subfields" match="marc:datafield[@tag='513']">
1662     <xslo:for-each select="marc:subfield">
1663       <xslo:if test="contains('9', @code)">
1664         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1665           <xslo:value-of select="."/>
1666         </z:index>
1667       </xslo:if>
1668     </xslo:for-each>
1669   </xslo:template>
1670   <xslo:template mode="index_subfields" match="marc:datafield[@tag='514']">
1671     <xslo:for-each select="marc:subfield">
1672       <xslo:if test="contains('9', @code)">
1673         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1674           <xslo:value-of select="."/>
1675         </z:index>
1676       </xslo:if>
1677     </xslo:for-each>
1678   </xslo:template>
1679   <xslo:template mode="index_subfields" match="marc:datafield[@tag='515']">
1680     <xslo:for-each select="marc:subfield">
1681       <xslo:if test="contains('9', @code)">
1682         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1683           <xslo:value-of select="."/>
1684         </z:index>
1685       </xslo:if>
1686     </xslo:for-each>
1687   </xslo:template>
1688   <xslo:template mode="index_subfields" match="marc:datafield[@tag='516']">
1689     <xslo:for-each select="marc:subfield">
1690       <xslo:if test="contains('9', @code)">
1691         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1692           <xslo:value-of select="."/>
1693         </z:index>
1694       </xslo:if>
1695     </xslo:for-each>
1696   </xslo:template>
1697   <xslo:template mode="index_subfields" match="marc:datafield[@tag='517']">
1698     <xslo:for-each select="marc:subfield">
1699       <xslo:if test="contains('9', @code)">
1700         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1701           <xslo:value-of select="."/>
1702         </z:index>
1703       </xslo:if>
1704     </xslo:for-each>
1705   </xslo:template>
1706   <xslo:template mode="index_subfields" match="marc:datafield[@tag='518']">
1707     <xslo:for-each select="marc:subfield">
1708       <xslo:if test="contains('9', @code)">
1709         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1710           <xslo:value-of select="."/>
1711         </z:index>
1712       </xslo:if>
1713     </xslo:for-each>
1714   </xslo:template>
1715   <xslo:template mode="index_subfields" match="marc:datafield[@tag='519']">
1716     <xslo:for-each select="marc:subfield">
1717       <xslo:if test="contains('9', @code)">
1718         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1719           <xslo:value-of select="."/>
1720         </z:index>
1721       </xslo:if>
1722     </xslo:for-each>
1723   </xslo:template>
1724   <xslo:template mode="index_subfields" match="marc:datafield[@tag='520']">
1725     <xslo:for-each select="marc:subfield">
1726       <xslo:if test="contains('9', @code)">
1727         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1728           <xslo:value-of select="."/>
1729         </z:index>
1730       </xslo:if>
1731     </xslo:for-each>
1732   </xslo:template>
1733   <xslo:template mode="index_subfields" match="marc:datafield[@tag='530']">
1734     <xslo:for-each select="marc:subfield">
1735       <xslo:if test="contains('9', @code)">
1736         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1737           <xslo:value-of select="."/>
1738         </z:index>
1739       </xslo:if>
1740     </xslo:for-each>
1741   </xslo:template>
1742   <xslo:template mode="index_subfields" match="marc:datafield[@tag='531']">
1743     <xslo:for-each select="marc:subfield">
1744       <xslo:if test="contains('9', @code)">
1745         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1746           <xslo:value-of select="."/>
1747         </z:index>
1748       </xslo:if>
1749     </xslo:for-each>
1750   </xslo:template>
1751   <xslo:template mode="index_subfields" match="marc:datafield[@tag='532']">
1752     <xslo:for-each select="marc:subfield">
1753       <xslo:if test="contains('9', @code)">
1754         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1755           <xslo:value-of select="."/>
1756         </z:index>
1757       </xslo:if>
1758     </xslo:for-each>
1759   </xslo:template>
1760   <xslo:template mode="index_subfields" match="marc:datafield[@tag='540']">
1761     <xslo:for-each select="marc:subfield">
1762       <xslo:if test="contains('9', @code)">
1763         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1764           <xslo:value-of select="."/>
1765         </z:index>
1766       </xslo:if>
1767     </xslo:for-each>
1768   </xslo:template>
1769   <xslo:template mode="index_subfields" match="marc:datafield[@tag='541']">
1770     <xslo:for-each select="marc:subfield">
1771       <xslo:if test="contains('9', @code)">
1772         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1773           <xslo:value-of select="."/>
1774         </z:index>
1775       </xslo:if>
1776     </xslo:for-each>
1777   </xslo:template>
1778   <xslo:template mode="index_subfields" match="marc:datafield[@tag='545']">
1779     <xslo:for-each select="marc:subfield">
1780       <xslo:if test="contains('9', @code)">
1781         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1782           <xslo:value-of select="."/>
1783         </z:index>
1784       </xslo:if>
1785     </xslo:for-each>
1786   </xslo:template>
1787   <xslo:template mode="index_subfields" match="marc:datafield[@tag='560']">
1788     <xslo:for-each select="marc:subfield">
1789       <xslo:if test="contains('9', @code)">
1790         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1791           <xslo:value-of select="."/>
1792         </z:index>
1793       </xslo:if>
1794     </xslo:for-each>
1795   </xslo:template>
1796   <xslo:template mode="index_subfields" match="marc:datafield[@tag='600']">
1797     <xslo:for-each select="marc:subfield">
1798       <xslo:if test="contains('9', @code)">
1799         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1800           <xslo:value-of select="."/>
1801         </z:index>
1802       </xslo:if>
1803     </xslo:for-each>
1804     <xslo:for-each select="marc:subfield">
1805       <xslo:if test="contains('a', @code)">
1806         <z:index name="Personal-name:w Personal-name:p Subject:w Subject:p">
1807           <xslo:value-of select="."/>
1808         </z:index>
1809       </xslo:if>
1810     </xslo:for-each>
1811   </xslo:template>
1812   <xslo:template mode="index_subfields" match="marc:datafield[@tag='601']">
1813     <xslo:for-each select="marc:subfield">
1814       <xslo:if test="contains('9', @code)">
1815         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1816           <xslo:value-of select="."/>
1817         </z:index>
1818       </xslo:if>
1819     </xslo:for-each>
1820     <xslo:for-each select="marc:subfield">
1821       <xslo:if test="contains('a', @code)">
1822         <z:index name="Corporate-name:w Conference-name:w Corporate-name:p Conference-name:p">
1823           <xslo:value-of select="."/>
1824         </z:index>
1825       </xslo:if>
1826     </xslo:for-each>
1827   </xslo:template>
1828   <xslo:template mode="index_subfields" match="marc:datafield[@tag='602']">
1829     <xslo:for-each select="marc:subfield">
1830       <xslo:if test="contains('9', @code)">
1831         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1832           <xslo:value-of select="."/>
1833         </z:index>
1834       </xslo:if>
1835     </xslo:for-each>
1836     <xslo:for-each select="marc:subfield">
1837       <xslo:if test="contains('a', @code)">
1838         <z:index name="Personal-name:w Personal-name:p">
1839           <xslo:value-of select="."/>
1840         </z:index>
1841       </xslo:if>
1842     </xslo:for-each>
1843   </xslo:template>
1844   <xslo:template mode="index_subfields" match="marc:datafield[@tag='603']">
1845     <xslo:for-each select="marc:subfield">
1846       <xslo:if test="contains('9', @code)">
1847         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1848           <xslo:value-of select="."/>
1849         </z:index>
1850       </xslo:if>
1851     </xslo:for-each>
1852   </xslo:template>
1853   <xslo:template mode="index_subfields" match="marc:datafield[@tag='604']">
1854     <xslo:for-each select="marc:subfield">
1855       <xslo:if test="contains('9', @code)">
1856         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1857           <xslo:value-of select="."/>
1858         </z:index>
1859       </xslo:if>
1860     </xslo:for-each>
1861   </xslo:template>
1862   <xslo:template mode="index_subfields" match="marc:datafield[@tag='605']">
1863     <xslo:for-each select="marc:subfield">
1864       <xslo:if test="contains('9', @code)">
1865         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1866           <xslo:value-of select="."/>
1867         </z:index>
1868       </xslo:if>
1869     </xslo:for-each>
1870   </xslo:template>
1871   <xslo:template mode="index_subfields" match="marc:datafield[@tag='606']">
1872     <xslo:for-each select="marc:subfield">
1873       <xslo:if test="contains('9', @code)">
1874         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1875           <xslo:value-of select="."/>
1876         </z:index>
1877       </xslo:if>
1878     </xslo:for-each>
1879   </xslo:template>
1880   <xslo:template mode="index_subfields" match="marc:datafield[@tag='607']">
1881     <xslo:for-each select="marc:subfield">
1882       <xslo:if test="contains('9', @code)">
1883         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1884           <xslo:value-of select="."/>
1885         </z:index>
1886       </xslo:if>
1887     </xslo:for-each>
1888   </xslo:template>
1889   <xslo:template mode="index_subfields" match="marc:datafield[@tag='608']">
1890     <xslo:for-each select="marc:subfield">
1891       <xslo:if test="contains('9', @code)">
1892         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1893           <xslo:value-of select="."/>
1894         </z:index>
1895       </xslo:if>
1896     </xslo:for-each>
1897   </xslo:template>
1898   <xslo:template mode="index_subfields" match="marc:datafield[@tag='610']">
1899     <xslo:for-each select="marc:subfield">
1900       <xslo:if test="contains('9', @code)">
1901         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1902           <xslo:value-of select="."/>
1903         </z:index>
1904       </xslo:if>
1905     </xslo:for-each>
1906   </xslo:template>
1907   <xslo:template mode="index_subfields" match="marc:datafield[@tag='615']">
1908     <xslo:for-each select="marc:subfield">
1909       <xslo:if test="contains('9', @code)">
1910         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1911           <xslo:value-of select="."/>
1912         </z:index>
1913       </xslo:if>
1914     </xslo:for-each>
1915   </xslo:template>
1916   <xslo:template mode="index_subfields" match="marc:datafield[@tag='616']">
1917     <xslo:for-each select="marc:subfield">
1918       <xslo:if test="contains('9', @code)">
1919         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1920           <xslo:value-of select="."/>
1921         </z:index>
1922       </xslo:if>
1923     </xslo:for-each>
1924   </xslo:template>
1925   <xslo:template mode="index_subfields" match="marc:datafield[@tag='617']">
1926     <xslo:for-each select="marc:subfield">
1927       <xslo:if test="contains('9', @code)">
1928         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1929           <xslo:value-of select="."/>
1930         </z:index>
1931       </xslo:if>
1932     </xslo:for-each>
1933   </xslo:template>
1934   <xslo:template mode="index_subfields" match="marc:datafield[@tag='620']">
1935     <xslo:for-each select="marc:subfield">
1936       <xslo:if test="contains('9', @code)">
1937         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1938           <xslo:value-of select="."/>
1939         </z:index>
1940       </xslo:if>
1941     </xslo:for-each>
1942   </xslo:template>
1943   <xslo:template mode="index_subfields" match="marc:datafield[@tag='621']">
1944     <xslo:for-each select="marc:subfield">
1945       <xslo:if test="contains('9', @code)">
1946         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1947           <xslo:value-of select="."/>
1948         </z:index>
1949       </xslo:if>
1950     </xslo:for-each>
1951   </xslo:template>
1952   <xslo:template mode="index_subfields" match="marc:datafield[@tag='630']">
1953     <xslo:for-each select="marc:subfield">
1954       <xslo:if test="contains('9', @code)">
1955         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1956           <xslo:value-of select="."/>
1957         </z:index>
1958       </xslo:if>
1959     </xslo:for-each>
1960   </xslo:template>
1961   <xslo:template mode="index_subfields" match="marc:datafield[@tag='631']">
1962     <xslo:for-each select="marc:subfield">
1963       <xslo:if test="contains('9', @code)">
1964         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1965           <xslo:value-of select="."/>
1966         </z:index>
1967       </xslo:if>
1968     </xslo:for-each>
1969   </xslo:template>
1970   <xslo:template mode="index_subfields" match="marc:datafield[@tag='632']">
1971     <xslo:for-each select="marc:subfield">
1972       <xslo:if test="contains('9', @code)">
1973         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1974           <xslo:value-of select="."/>
1975         </z:index>
1976       </xslo:if>
1977     </xslo:for-each>
1978   </xslo:template>
1979   <xslo:template mode="index_subfields" match="marc:datafield[@tag='633']">
1980     <xslo:for-each select="marc:subfield">
1981       <xslo:if test="contains('9', @code)">
1982         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1983           <xslo:value-of select="."/>
1984         </z:index>
1985       </xslo:if>
1986     </xslo:for-each>
1987   </xslo:template>
1988   <xslo:template mode="index_subfields" match="marc:datafield[@tag='634']">
1989     <xslo:for-each select="marc:subfield">
1990       <xslo:if test="contains('9', @code)">
1991         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
1992           <xslo:value-of select="."/>
1993         </z:index>
1994       </xslo:if>
1995     </xslo:for-each>
1996   </xslo:template>
1997   <xslo:template mode="index_subfields" match="marc:datafield[@tag='635']">
1998     <xslo:for-each select="marc:subfield">
1999       <xslo:if test="contains('9', @code)">
2000         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
2001           <xslo:value-of select="."/>
2002         </z:index>
2003       </xslo:if>
2004     </xslo:for-each>
2005   </xslo:template>
2006   <xslo:template mode="index_subfields" match="marc:datafield[@tag='636']">
2007     <xslo:for-each select="marc:subfield">
2008       <xslo:if test="contains('9', @code)">
2009         <z:index name="Koha-Auth-Number:w Koha-Auth-Number:n">
2010           <xslo:value-of select="."/>
2011         </z:index>
2012       </xslo:if>
2013     </xslo:for-each>
2014   </xslo:template>
2015   <xslo:template mode="index_subfields" match="marc:datafield[@tag='675']">
2016     <xslo:for-each select="marc:subfield">
2017       <xslo:if test="contains('a', @code)">
2018         <z:index name="UDC-classification:w UDC-classification:p UDC-classification:s">
2019           <xslo:value-of select="."/>
2020         </z:index>
2021       </xslo:if>
2022     </xslo:for-each>
2023   </xslo:template>
2024   <xslo:template mode="index_subfields" match="marc:datafield[@tag='676']">
2025     <xslo:for-each select="marc:subfield">
2026       <xslo:if test="contains('a', @code)">
2027         <z:index name="Dewey-classification:w Dewey-classification:p Dewey-classification:s">
2028           <xslo:value-of select="."/>
2029         </z:index>
2030       </xslo:if>
2031     </xslo:for-each>
2032   </xslo:template>
2033   <xslo:template mode="index_subfields" match="marc:datafield[@tag='680']">
2034     <xslo:for-each select="marc:subfield">
2035       <xslo:if test="contains('b', @code)">
2036         <z:index name="LC-call-number:s">
2037           <xslo:value-of select="."/>
2038         </z:index>
2039       </xslo:if>
2040     </xslo:for-each>
2041   </xslo:template>
2042   <xslo:template mode="index_subfields" match="marc:datafield[@tag='942']">
2043     <xslo:for-each select="marc:subfield">
2044       <xslo:if test="contains('0', @code)">
2045         <z:index name="totalissues:n totalissues:s">
2046           <xslo:value-of select="."/>
2047         </z:index>
2048       </xslo:if>
2049     </xslo:for-each>
2050   </xslo:template>
2051   <xslo:template mode="index_data_field" match="marc:datafield[@tag='700']">
2052     <z:index name="Author:w Personal-name:w Author:p Personal-name:p Personal-name:p">
2053       <xslo:variable name="raw_heading">
2054         <xslo:for-each select="marc:subfield">
2055           <xslo:if test="position() &gt; 1">
2056             <xslo:value-of select="substring(' ', 1, 1)"/>
2057           </xslo:if>
2058           <xslo:value-of select="."/>
2059         </xslo:for-each>
2060       </xslo:variable>
2061       <xslo:value-of select="normalize-space($raw_heading)"/>
2062     </z:index>
2063   </xslo:template>
2064   <xslo:template mode="index_data_field" match="marc:datafield[@tag='701']">
2065     <z:index name="Author:w Personal-name:w Author:p Personal-name:p Personal-name:p">
2066       <xslo:variable name="raw_heading">
2067         <xslo:for-each select="marc:subfield">
2068           <xslo:if test="position() &gt; 1">
2069             <xslo:value-of select="substring(' ', 1, 1)"/>
2070           </xslo:if>
2071           <xslo:value-of select="."/>
2072         </xslo:for-each>
2073       </xslo:variable>
2074       <xslo:value-of select="normalize-space($raw_heading)"/>
2075     </z:index>
2076   </xslo:template>
2077   <xslo:template mode="index_data_field" match="marc:datafield[@tag='702']">
2078     <z:index name="Author:w Personal-name:w Author:p Personal-name:p Personal-name:p">
2079       <xslo:variable name="raw_heading">
2080         <xslo:for-each select="marc:subfield">
2081           <xslo:if test="position() &gt; 1">
2082             <xslo:value-of select="substring(' ', 1, 1)"/>
2083           </xslo:if>
2084           <xslo:value-of select="."/>
2085         </xslo:for-each>
2086       </xslo:variable>
2087       <xslo:value-of select="normalize-space($raw_heading)"/>
2088     </z:index>
2089   </xslo:template>
2090   <xslo:template mode="index_data_field" match="marc:datafield[@tag='710']">
2091     <z:index name="Author:w Author-name-corporate:w Author-name-conference:w Corporate-name:w Conference-name:w Author:p Author-name-corporate:p Author-name-conference:p Corporate-name:p Conference-name:p">
2092       <xslo:variable name="raw_heading">
2093         <xslo:for-each select="marc:subfield">
2094           <xslo:if test="position() &gt; 1">
2095             <xslo:value-of select="substring(' ', 1, 1)"/>
2096           </xslo:if>
2097           <xslo:value-of select="."/>
2098         </xslo:for-each>
2099       </xslo:variable>
2100       <xslo:value-of select="normalize-space($raw_heading)"/>
2101     </z:index>
2102   </xslo:template>
2103   <xslo:template mode="index_data_field" match="marc:datafield[@tag='711']">
2104     <z:index name="Author:w Author-name-corporate:w Author-name-conference:w Corporate-name:w Conference-name:w Author:p Author-name-corporate:p Author-name-conference:p Corporate-name:p Conference-name:p">
2105       <xslo:variable name="raw_heading">
2106         <xslo:for-each select="marc:subfield">
2107           <xslo:if test="position() &gt; 1">
2108             <xslo:value-of select="substring(' ', 1, 1)"/>
2109           </xslo:if>
2110           <xslo:value-of select="."/>
2111         </xslo:for-each>
2112       </xslo:variable>
2113       <xslo:value-of select="normalize-space($raw_heading)"/>
2114     </z:index>
2115   </xslo:template>
2116   <xslo:template mode="index_data_field" match="marc:datafield[@tag='712']">
2117     <z:index name="Author:w Author-name-corporate:w Author-name-conference:w Corporate-name:w Conference-name:w Author:p Author-name-corporate:p Author-name-conference:p Corporate-name:p Conference-name:p">
2118       <xslo:variable name="raw_heading">
2119         <xslo:for-each select="marc:subfield">
2120           <xslo:if test="position() &gt; 1">
2121             <xslo:value-of select="substring(' ', 1, 1)"/>
2122           </xslo:if>
2123           <xslo:value-of select="."/>
2124         </xslo:for-each>
2125       </xslo:variable>
2126       <xslo:value-of select="normalize-space($raw_heading)"/>
2127     </z:index>
2128   </xslo:template>
2129   <xslo:template mode="index_data_field" match="marc:datafield[@tag='716']">
2130     <z:index name="Author:w Author:p">
2131       <xslo:variable name="raw_heading">
2132         <xslo:for-each select="marc:subfield">
2133           <xslo:if test="position() &gt; 1">
2134             <xslo:value-of select="substring(' ', 1, 1)"/>
2135           </xslo:if>
2136           <xslo:value-of select="."/>
2137         </xslo:for-each>
2138       </xslo:variable>
2139       <xslo:value-of select="normalize-space($raw_heading)"/>
2140     </z:index>
2141   </xslo:template>
2142   <xslo:template mode="index_data_field" match="marc:datafield[@tag='720']">
2143     <z:index name="Author:w Author:p">
2144       <xslo:variable name="raw_heading">
2145         <xslo:for-each select="marc:subfield">
2146           <xslo:if test="position() &gt; 1">
2147             <xslo:value-of select="substring(' ', 1, 1)"/>
2148           </xslo:if>
2149           <xslo:value-of select="."/>
2150         </xslo:for-each>
2151       </xslo:variable>
2152       <xslo:value-of select="normalize-space($raw_heading)"/>
2153     </z:index>
2154   </xslo:template>
2155   <xslo:template mode="index_data_field" match="marc:datafield[@tag='721']">
2156     <z:index name="Author:w Author:p">
2157       <xslo:variable name="raw_heading">
2158         <xslo:for-each select="marc:subfield">
2159           <xslo:if test="position() &gt; 1">
2160             <xslo:value-of select="substring(' ', 1, 1)"/>
2161           </xslo:if>
2162           <xslo:value-of select="."/>
2163         </xslo:for-each>
2164       </xslo:variable>
2165       <xslo:value-of select="normalize-space($raw_heading)"/>
2166     </z:index>
2167   </xslo:template>
2168   <xslo:template mode="index_data_field" match="marc:datafield[@tag='722']">
2169     <z:index name="Author:w Author:p">
2170       <xslo:variable name="raw_heading">
2171         <xslo:for-each select="marc:subfield">
2172           <xslo:if test="position() &gt; 1">
2173             <xslo:value-of select="substring(' ', 1, 1)"/>
2174           </xslo:if>
2175           <xslo:value-of select="."/>
2176         </xslo:for-each>
2177       </xslo:variable>
2178       <xslo:value-of select="normalize-space($raw_heading)"/>
2179     </z:index>
2180   </xslo:template>
2181   <xslo:template mode="index_data_field" match="marc:datafield[@tag='730']">
2182     <z:index name="Author:w Author:p">
2183       <xslo:variable name="raw_heading">
2184         <xslo:for-each select="marc:subfield">
2185           <xslo:if test="position() &gt; 1">
2186             <xslo:value-of select="substring(' ', 1, 1)"/>
2187           </xslo:if>
2188           <xslo:value-of select="."/>
2189         </xslo:for-each>
2190       </xslo:variable>
2191       <xslo:value-of select="normalize-space($raw_heading)"/>
2192     </z:index>
2193   </xslo:template>
2194   <xslo:template mode="index_data_field" match="marc:datafield[@tag='205']">
2195     <z:index name="Title:w Title:p">
2196       <xslo:variable name="raw_heading">
2197         <xslo:for-each select="marc:subfield">
2198           <xslo:if test="position() &gt; 1">
2199             <xslo:value-of select="substring(' ', 1, 1)"/>
2200           </xslo:if>
2201           <xslo:value-of select="."/>
2202         </xslo:for-each>
2203       </xslo:variable>
2204       <xslo:value-of select="normalize-space($raw_heading)"/>
2205     </z:index>
2206   </xslo:template>
2207   <xslo:template mode="index_data_field" match="marc:datafield[@tag='207']">
2208     <z:index name="Serials:w Serials:p">
2209       <xslo:variable name="raw_heading">
2210         <xslo:for-each select="marc:subfield">
2211           <xslo:if test="position() &gt; 1">
2212             <xslo:value-of select="substring(' ', 1, 1)"/>
2213           </xslo:if>
2214           <xslo:value-of select="."/>
2215         </xslo:for-each>
2216       </xslo:variable>
2217       <xslo:value-of select="normalize-space($raw_heading)"/>
2218     </z:index>
2219   </xslo:template>
2220   <xslo:template mode="index_data_field" match="marc:datafield[@tag='208']">
2221     <z:index name="Printed-music:w Printed-music:p">
2222       <xslo:variable name="raw_heading">
2223         <xslo:for-each select="marc:subfield">
2224           <xslo:if test="position() &gt; 1">
2225             <xslo:value-of select="substring(' ', 1, 1)"/>
2226           </xslo:if>
2227           <xslo:value-of select="."/>
2228         </xslo:for-each>
2229       </xslo:variable>
2230       <xslo:value-of select="normalize-space($raw_heading)"/>
2231     </z:index>
2232   </xslo:template>
2233   <xslo:template mode="index_data_field" match="marc:datafield[@tag='215']">
2234     <z:index name="Extent:w">
2235       <xslo:variable name="raw_heading">
2236         <xslo:for-each select="marc:subfield">
2237           <xslo:if test="position() &gt; 1">
2238             <xslo:value-of select="substring(' ', 1, 1)"/>
2239           </xslo:if>
2240           <xslo:value-of select="."/>
2241         </xslo:for-each>
2242       </xslo:variable>
2243       <xslo:value-of select="normalize-space($raw_heading)"/>
2244     </z:index>
2245   </xslo:template>
2246   <xslo:template mode="index_data_field" match="marc:datafield[@tag='308']">
2247     <z:index name="Note:w Note:p">
2248       <xslo:variable name="raw_heading">
2249         <xslo:for-each select="marc:subfield">
2250           <xslo:if test="position() &gt; 1">
2251             <xslo:value-of select="substring(' ', 1, 1)"/>
2252           </xslo:if>
2253           <xslo:value-of select="."/>
2254         </xslo:for-each>
2255       </xslo:variable>
2256       <xslo:value-of select="normalize-space($raw_heading)"/>
2257     </z:index>
2258   </xslo:template>
2259   <xslo:template mode="index_data_field" match="marc:datafield[@tag='328']">
2260     <z:index name="Note:w Note:p">
2261       <xslo:variable name="raw_heading">
2262         <xslo:for-each select="marc:subfield">
2263           <xslo:if test="position() &gt; 1">
2264             <xslo:value-of select="substring(' ', 1, 1)"/>
2265           </xslo:if>
2266           <xslo:value-of select="."/>
2267         </xslo:for-each>
2268       </xslo:variable>
2269       <xslo:value-of select="normalize-space($raw_heading)"/>
2270     </z:index>
2271   </xslo:template>
2272   <xslo:template mode="index_data_field" match="marc:datafield[@tag='500']">
2273     <z:index name="Title:w Title:p">
2274       <xslo:variable name="raw_heading">
2275         <xslo:for-each select="marc:subfield">
2276           <xslo:if test="position() &gt; 1">
2277             <xslo:value-of select="substring(' ', 1, 1)"/>
2278           </xslo:if>
2279           <xslo:value-of select="."/>
2280         </xslo:for-each>
2281       </xslo:variable>
2282       <xslo:value-of select="normalize-space($raw_heading)"/>
2283     </z:index>
2284   </xslo:template>
2285   <xslo:template mode="index_data_field" match="marc:datafield[@tag='501']">
2286     <z:index name="Title:w Title:p">
2287       <xslo:variable name="raw_heading">
2288         <xslo:for-each select="marc:subfield">
2289           <xslo:if test="position() &gt; 1">
2290             <xslo:value-of select="substring(' ', 1, 1)"/>
2291           </xslo:if>
2292           <xslo:value-of select="."/>
2293         </xslo:for-each>
2294       </xslo:variable>
2295       <xslo:value-of select="normalize-space($raw_heading)"/>
2296     </z:index>
2297   </xslo:template>
2298   <xslo:template mode="index_data_field" match="marc:datafield[@tag='503']">
2299     <z:index name="Title:w Title:p">
2300       <xslo:variable name="raw_heading">
2301         <xslo:for-each select="marc:subfield">
2302           <xslo:if test="position() &gt; 1">
2303             <xslo:value-of select="substring(' ', 1, 1)"/>
2304           </xslo:if>
2305           <xslo:value-of select="."/>
2306         </xslo:for-each>
2307       </xslo:variable>
2308       <xslo:value-of select="normalize-space($raw_heading)"/>
2309     </z:index>
2310   </xslo:template>
2311   <xslo:template mode="index_data_field" match="marc:datafield[@tag='510']">
2312     <z:index name="Title:w Title:p">
2313       <xslo:variable name="raw_heading">
2314         <xslo:for-each select="marc:subfield">
2315           <xslo:if test="position() &gt; 1">
2316             <xslo:value-of select="substring(' ', 1, 1)"/>
2317           </xslo:if>
2318           <xslo:value-of select="."/>
2319         </xslo:for-each>
2320       </xslo:variable>
2321       <xslo:value-of select="normalize-space($raw_heading)"/>
2322     </z:index>
2323   </xslo:template>
2324   <xslo:template mode="index_data_field" match="marc:datafield[@tag='512']">
2325     <z:index name="Title:w Title:p">
2326       <xslo:variable name="raw_heading">
2327         <xslo:for-each select="marc:subfield">
2328           <xslo:if test="position() &gt; 1">
2329             <xslo:value-of select="substring(' ', 1, 1)"/>
2330           </xslo:if>
2331           <xslo:value-of select="."/>
2332         </xslo:for-each>
2333       </xslo:variable>
2334       <xslo:value-of select="normalize-space($raw_heading)"/>
2335     </z:index>
2336   </xslo:template>
2337   <xslo:template mode="index_data_field" match="marc:datafield[@tag='513']">
2338     <z:index name="Title:w Title:p">
2339       <xslo:variable name="raw_heading">
2340         <xslo:for-each select="marc:subfield">
2341           <xslo:if test="position() &gt; 1">
2342             <xslo:value-of select="substring(' ', 1, 1)"/>
2343           </xslo:if>
2344           <xslo:value-of select="."/>
2345         </xslo:for-each>
2346       </xslo:variable>
2347       <xslo:value-of select="normalize-space($raw_heading)"/>
2348     </z:index>
2349   </xslo:template>
2350   <xslo:template mode="index_data_field" match="marc:datafield[@tag='514']">
2351     <z:index name="Title:w Title:p">
2352       <xslo:variable name="raw_heading">
2353         <xslo:for-each select="marc:subfield">
2354           <xslo:if test="position() &gt; 1">
2355             <xslo:value-of select="substring(' ', 1, 1)"/>
2356           </xslo:if>
2357           <xslo:value-of select="."/>
2358         </xslo:for-each>
2359       </xslo:variable>
2360       <xslo:value-of select="normalize-space($raw_heading)"/>
2361     </z:index>
2362   </xslo:template>
2363   <xslo:template mode="index_data_field" match="marc:datafield[@tag='515']">
2364     <z:index name="Title:w Title:p">
2365       <xslo:variable name="raw_heading">
2366         <xslo:for-each select="marc:subfield">
2367           <xslo:if test="position() &gt; 1">
2368             <xslo:value-of select="substring(' ', 1, 1)"/>
2369           </xslo:if>
2370           <xslo:value-of select="."/>
2371         </xslo:for-each>
2372       </xslo:variable>
2373       <xslo:value-of select="normalize-space($raw_heading)"/>
2374     </z:index>
2375   </xslo:template>
2376   <xslo:template mode="index_data_field" match="marc:datafield[@tag='516']">
2377     <z:index name="Title:w Title:p">
2378       <xslo:variable name="raw_heading">
2379         <xslo:for-each select="marc:subfield">
2380           <xslo:if test="position() &gt; 1">
2381             <xslo:value-of select="substring(' ', 1, 1)"/>
2382           </xslo:if>
2383           <xslo:value-of select="."/>
2384         </xslo:for-each>
2385       </xslo:variable>
2386       <xslo:value-of select="normalize-space($raw_heading)"/>
2387     </z:index>
2388   </xslo:template>
2389   <xslo:template mode="index_data_field" match="marc:datafield[@tag='517']">
2390     <z:index name="Title:w Title:p">
2391       <xslo:variable name="raw_heading">
2392         <xslo:for-each select="marc:subfield">
2393           <xslo:if test="position() &gt; 1">
2394             <xslo:value-of select="substring(' ', 1, 1)"/>
2395           </xslo:if>
2396           <xslo:value-of select="."/>
2397         </xslo:for-each>
2398       </xslo:variable>
2399       <xslo:value-of select="normalize-space($raw_heading)"/>
2400     </z:index>
2401   </xslo:template>
2402   <xslo:template mode="index_data_field" match="marc:datafield[@tag='518']">
2403     <z:index name="Title:w Title:p">
2404       <xslo:variable name="raw_heading">
2405         <xslo:for-each select="marc:subfield">
2406           <xslo:if test="position() &gt; 1">
2407             <xslo:value-of select="substring(' ', 1, 1)"/>
2408           </xslo:if>
2409           <xslo:value-of select="."/>
2410         </xslo:for-each>
2411       </xslo:variable>
2412       <xslo:value-of select="normalize-space($raw_heading)"/>
2413     </z:index>
2414   </xslo:template>
2415   <xslo:template mode="index_data_field" match="marc:datafield[@tag='519']">
2416     <z:index name="Title:w Title:p">
2417       <xslo:variable name="raw_heading">
2418         <xslo:for-each select="marc:subfield">
2419           <xslo:if test="position() &gt; 1">
2420             <xslo:value-of select="substring(' ', 1, 1)"/>
2421           </xslo:if>
2422           <xslo:value-of select="."/>
2423         </xslo:for-each>
2424       </xslo:variable>
2425       <xslo:value-of select="normalize-space($raw_heading)"/>
2426     </z:index>
2427   </xslo:template>
2428   <xslo:template mode="index_data_field" match="marc:datafield[@tag='520']">
2429     <z:index name="Title:w Title:p">
2430       <xslo:variable name="raw_heading">
2431         <xslo:for-each select="marc:subfield">
2432           <xslo:if test="position() &gt; 1">
2433             <xslo:value-of select="substring(' ', 1, 1)"/>
2434           </xslo:if>
2435           <xslo:value-of select="."/>
2436         </xslo:for-each>
2437       </xslo:variable>
2438       <xslo:value-of select="normalize-space($raw_heading)"/>
2439     </z:index>
2440   </xslo:template>
2441   <xslo:template mode="index_data_field" match="marc:datafield[@tag='530']">
2442     <z:index name="Title:w Title:p">
2443       <xslo:variable name="raw_heading">
2444         <xslo:for-each select="marc:subfield">
2445           <xslo:if test="position() &gt; 1">
2446             <xslo:value-of select="substring(' ', 1, 1)"/>
2447           </xslo:if>
2448           <xslo:value-of select="."/>
2449         </xslo:for-each>
2450       </xslo:variable>
2451       <xslo:value-of select="normalize-space($raw_heading)"/>
2452     </z:index>
2453   </xslo:template>
2454   <xslo:template mode="index_data_field" match="marc:datafield[@tag='531']">
2455     <z:index name="Title:w Title:p">
2456       <xslo:variable name="raw_heading">
2457         <xslo:for-each select="marc:subfield">
2458           <xslo:if test="position() &gt; 1">
2459             <xslo:value-of select="substring(' ', 1, 1)"/>
2460           </xslo:if>
2461           <xslo:value-of select="."/>
2462         </xslo:for-each>
2463       </xslo:variable>
2464       <xslo:value-of select="normalize-space($raw_heading)"/>
2465     </z:index>
2466   </xslo:template>
2467   <xslo:template mode="index_data_field" match="marc:datafield[@tag='532']">
2468     <z:index name="Title:w Title:p">
2469       <xslo:variable name="raw_heading">
2470         <xslo:for-each select="marc:subfield">
2471           <xslo:if test="position() &gt; 1">
2472             <xslo:value-of select="substring(' ', 1, 1)"/>
2473           </xslo:if>
2474           <xslo:value-of select="."/>
2475         </xslo:for-each>
2476       </xslo:variable>
2477       <xslo:value-of select="normalize-space($raw_heading)"/>
2478     </z:index>
2479   </xslo:template>
2480   <xslo:template mode="index_data_field" match="marc:datafield[@tag='540']">
2481     <z:index name="Title:w Title:p">
2482       <xslo:variable name="raw_heading">
2483         <xslo:for-each select="marc:subfield">
2484           <xslo:if test="position() &gt; 1">
2485             <xslo:value-of select="substring(' ', 1, 1)"/>
2486           </xslo:if>
2487           <xslo:value-of select="."/>
2488         </xslo:for-each>
2489       </xslo:variable>
2490       <xslo:value-of select="normalize-space($raw_heading)"/>
2491     </z:index>
2492   </xslo:template>
2493   <xslo:template mode="index_data_field" match="marc:datafield[@tag='541']">
2494     <z:index name="Title:w Title:p">
2495       <xslo:variable name="raw_heading">
2496         <xslo:for-each select="marc:subfield">
2497           <xslo:if test="position() &gt; 1">
2498             <xslo:value-of select="substring(' ', 1, 1)"/>
2499           </xslo:if>
2500           <xslo:value-of select="."/>
2501         </xslo:for-each>
2502       </xslo:variable>
2503       <xslo:value-of select="normalize-space($raw_heading)"/>
2504     </z:index>
2505   </xslo:template>
2506   <xslo:template mode="index_data_field" match="marc:datafield[@tag='545']">
2507     <z:index name="Title:w Title:p">
2508       <xslo:variable name="raw_heading">
2509         <xslo:for-each select="marc:subfield">
2510           <xslo:if test="position() &gt; 1">
2511             <xslo:value-of select="substring(' ', 1, 1)"/>
2512           </xslo:if>
2513           <xslo:value-of select="."/>
2514         </xslo:for-each>
2515       </xslo:variable>
2516       <xslo:value-of select="normalize-space($raw_heading)"/>
2517     </z:index>
2518   </xslo:template>
2519   <xslo:template mode="index_data_field" match="marc:datafield[@tag='560']">
2520     <z:index name="Title:w Title:p">
2521       <xslo:variable name="raw_heading">
2522         <xslo:for-each select="marc:subfield">
2523           <xslo:if test="position() &gt; 1">
2524             <xslo:value-of select="substring(' ', 1, 1)"/>
2525           </xslo:if>
2526           <xslo:value-of select="."/>
2527         </xslo:for-each>
2528       </xslo:variable>
2529       <xslo:value-of select="normalize-space($raw_heading)"/>
2530     </z:index>
2531   </xslo:template>
2532   <xslo:template mode="index_data_field" match="marc:datafield[@tag='600']">
2533     <z:index name="Subject:w Subject:p">
2534       <xslo:variable name="raw_heading">
2535         <xslo:for-each select="marc:subfield">
2536           <xslo:if test="position() &gt; 1">
2537             <xslo:value-of select="substring(' ', 1, 1)"/>
2538           </xslo:if>
2539           <xslo:value-of select="."/>
2540         </xslo:for-each>
2541       </xslo:variable>
2542       <xslo:value-of select="normalize-space($raw_heading)"/>
2543     </z:index>
2544   </xslo:template>
2545   <xslo:template mode="index_data_field" match="marc:datafield[@tag='601']">
2546     <z:index name="Subject:w Subject:p">
2547       <xslo:variable name="raw_heading">
2548         <xslo:for-each select="marc:subfield">
2549           <xslo:if test="position() &gt; 1">
2550             <xslo:value-of select="substring(' ', 1, 1)"/>
2551           </xslo:if>
2552           <xslo:value-of select="."/>
2553         </xslo:for-each>
2554       </xslo:variable>
2555       <xslo:value-of select="normalize-space($raw_heading)"/>
2556     </z:index>
2557   </xslo:template>
2558   <xslo:template mode="index_data_field" match="marc:datafield[@tag='602']">
2559     <z:index name="Subject:w Subject:p">
2560       <xslo:variable name="raw_heading">
2561         <xslo:for-each select="marc:subfield">
2562           <xslo:if test="position() &gt; 1">
2563             <xslo:value-of select="substring(' ', 1, 1)"/>
2564           </xslo:if>
2565           <xslo:value-of select="."/>
2566         </xslo:for-each>
2567       </xslo:variable>
2568       <xslo:value-of select="normalize-space($raw_heading)"/>
2569     </z:index>
2570   </xslo:template>
2571   <xslo:template mode="index_data_field" match="marc:datafield[@tag='604']">
2572     <z:index name="Subject:w Subject:p">
2573       <xslo:variable name="raw_heading">
2574         <xslo:for-each select="marc:subfield">
2575           <xslo:if test="position() &gt; 1">
2576             <xslo:value-of select="substring(' ', 1, 1)"/>
2577           </xslo:if>
2578           <xslo:value-of select="."/>
2579         </xslo:for-each>
2580       </xslo:variable>
2581       <xslo:value-of select="normalize-space($raw_heading)"/>
2582     </z:index>
2583   </xslo:template>
2584   <xslo:template mode="index_data_field" match="marc:datafield[@tag='605']">
2585     <z:index name="Subject:w Subject:p">
2586       <xslo:variable name="raw_heading">
2587         <xslo:for-each select="marc:subfield">
2588           <xslo:if test="position() &gt; 1">
2589             <xslo:value-of select="substring(' ', 1, 1)"/>
2590           </xslo:if>
2591           <xslo:value-of select="."/>
2592         </xslo:for-each>
2593       </xslo:variable>
2594       <xslo:value-of select="normalize-space($raw_heading)"/>
2595     </z:index>
2596   </xslo:template>
2597   <xslo:template mode="index_data_field" match="marc:datafield[@tag='606']">
2598     <z:index name="Subject:w Subject:p">
2599       <xslo:variable name="raw_heading">
2600         <xslo:for-each select="marc:subfield">
2601           <xslo:if test="position() &gt; 1">
2602             <xslo:value-of select="substring(' ', 1, 1)"/>
2603           </xslo:if>
2604           <xslo:value-of select="."/>
2605         </xslo:for-each>
2606       </xslo:variable>
2607       <xslo:value-of select="normalize-space($raw_heading)"/>
2608     </z:index>
2609   </xslo:template>
2610   <xslo:template mode="index_data_field" match="marc:datafield[@tag='607']">
2611     <z:index name="Subject:w Subject:p">
2612       <xslo:variable name="raw_heading">
2613         <xslo:for-each select="marc:subfield">
2614           <xslo:if test="position() &gt; 1">
2615             <xslo:value-of select="substring(' ', 1, 1)"/>
2616           </xslo:if>
2617           <xslo:value-of select="."/>
2618         </xslo:for-each>
2619       </xslo:variable>
2620       <xslo:value-of select="normalize-space($raw_heading)"/>
2621     </z:index>
2622   </xslo:template>
2623   <xslo:template mode="index_data_field" match="marc:datafield[@tag='608']">
2624     <z:index name="Subject:w Subject:p">
2625       <xslo:variable name="raw_heading">
2626         <xslo:for-each select="marc:subfield">
2627           <xslo:if test="position() &gt; 1">
2628             <xslo:value-of select="substring(' ', 1, 1)"/>
2629           </xslo:if>
2630           <xslo:value-of select="."/>
2631         </xslo:for-each>
2632       </xslo:variable>
2633       <xslo:value-of select="normalize-space($raw_heading)"/>
2634     </z:index>
2635   </xslo:template>
2636   <xslo:template mode="index_data_field" match="marc:datafield[@tag='610']">
2637     <z:index name="Subject:w Subject:p">
2638       <xslo:variable name="raw_heading">
2639         <xslo:for-each select="marc:subfield">
2640           <xslo:if test="position() &gt; 1">
2641             <xslo:value-of select="substring(' ', 1, 1)"/>
2642           </xslo:if>
2643           <xslo:value-of select="."/>
2644         </xslo:for-each>
2645       </xslo:variable>
2646       <xslo:value-of select="normalize-space($raw_heading)"/>
2647     </z:index>
2648   </xslo:template>
2649   <xslo:template mode="index_data_field" match="marc:datafield[@tag='615']">
2650     <z:index name="Subject:w Subject:p">
2651       <xslo:variable name="raw_heading">
2652         <xslo:for-each select="marc:subfield">
2653           <xslo:if test="position() &gt; 1">
2654             <xslo:value-of select="substring(' ', 1, 1)"/>
2655           </xslo:if>
2656           <xslo:value-of select="."/>
2657         </xslo:for-each>
2658       </xslo:variable>
2659       <xslo:value-of select="normalize-space($raw_heading)"/>
2660     </z:index>
2661   </xslo:template>
2662   <xslo:template mode="index_data_field" match="marc:datafield[@tag='616']">
2663     <z:index name="Subject:w Subject:p">
2664       <xslo:variable name="raw_heading">
2665         <xslo:for-each select="marc:subfield">
2666           <xslo:if test="position() &gt; 1">
2667             <xslo:value-of select="substring(' ', 1, 1)"/>
2668           </xslo:if>
2669           <xslo:value-of select="."/>
2670         </xslo:for-each>
2671       </xslo:variable>
2672       <xslo:value-of select="normalize-space($raw_heading)"/>
2673     </z:index>
2674   </xslo:template>
2675   <xslo:template mode="index_data_field" match="marc:datafield[@tag='617']">
2676     <z:index name="Subject:w Subject:p">
2677       <xslo:variable name="raw_heading">
2678         <xslo:for-each select="marc:subfield">
2679           <xslo:if test="position() &gt; 1">
2680             <xslo:value-of select="substring(' ', 1, 1)"/>
2681           </xslo:if>
2682           <xslo:value-of select="."/>
2683         </xslo:for-each>
2684       </xslo:variable>
2685       <xslo:value-of select="normalize-space($raw_heading)"/>
2686     </z:index>
2687   </xslo:template>
2688   <xslo:template mode="index_data_field" match="marc:datafield[@tag='620']">
2689     <z:index name="Subject:w Subject:p">
2690       <xslo:variable name="raw_heading">
2691         <xslo:for-each select="marc:subfield">
2692           <xslo:if test="position() &gt; 1">
2693             <xslo:value-of select="substring(' ', 1, 1)"/>
2694           </xslo:if>
2695           <xslo:value-of select="."/>
2696         </xslo:for-each>
2697       </xslo:variable>
2698       <xslo:value-of select="normalize-space($raw_heading)"/>
2699     </z:index>
2700   </xslo:template>
2701   <xslo:template mode="index_data_field" match="marc:datafield[@tag='621']">
2702     <z:index name="Subject:w Subject:p">
2703       <xslo:variable name="raw_heading">
2704         <xslo:for-each select="marc:subfield">
2705           <xslo:if test="position() &gt; 1">
2706             <xslo:value-of select="substring(' ', 1, 1)"/>
2707           </xslo:if>
2708           <xslo:value-of select="."/>
2709         </xslo:for-each>
2710       </xslo:variable>
2711       <xslo:value-of select="normalize-space($raw_heading)"/>
2712     </z:index>
2713   </xslo:template>
2714   <xslo:template mode="index_data_field" match="marc:datafield[@tag='603']">
2715     <z:index name="Subject:w Subject:p">
2716       <xslo:variable name="raw_heading">
2717         <xslo:for-each select="marc:subfield">
2718           <xslo:if test="position() &gt; 1">
2719             <xslo:value-of select="substring(' ', 1, 1)"/>
2720           </xslo:if>
2721           <xslo:value-of select="."/>
2722         </xslo:for-each>
2723       </xslo:variable>
2724       <xslo:value-of select="normalize-space($raw_heading)"/>
2725     </z:index>
2726   </xslo:template>
2727   <xslo:template mode="index_data_field" match="marc:datafield[@tag='630']">
2728     <z:index name="Subject:w Subject:p">
2729       <xslo:variable name="raw_heading">
2730         <xslo:for-each select="marc:subfield">
2731           <xslo:if test="position() &gt; 1">
2732             <xslo:value-of select="substring(' ', 1, 1)"/>
2733           </xslo:if>
2734           <xslo:value-of select="."/>
2735         </xslo:for-each>
2736       </xslo:variable>
2737       <xslo:value-of select="normalize-space($raw_heading)"/>
2738     </z:index>
2739   </xslo:template>
2740   <xslo:template mode="index_data_field" match="marc:datafield[@tag='631']">
2741     <z:index name="Subject:w Subject:p">
2742       <xslo:variable name="raw_heading">
2743         <xslo:for-each select="marc:subfield">
2744           <xslo:if test="position() &gt; 1">
2745             <xslo:value-of select="substring(' ', 1, 1)"/>
2746           </xslo:if>
2747           <xslo:value-of select="."/>
2748         </xslo:for-each>
2749       </xslo:variable>
2750       <xslo:value-of select="normalize-space($raw_heading)"/>
2751     </z:index>
2752   </xslo:template>
2753   <xslo:template mode="index_data_field" match="marc:datafield[@tag='632']">
2754     <z:index name="Subject:w Subject:p">
2755       <xslo:variable name="raw_heading">
2756         <xslo:for-each select="marc:subfield">
2757           <xslo:if test="position() &gt; 1">
2758             <xslo:value-of select="substring(' ', 1, 1)"/>
2759           </xslo:if>
2760           <xslo:value-of select="."/>
2761         </xslo:for-each>
2762       </xslo:variable>
2763       <xslo:value-of select="normalize-space($raw_heading)"/>
2764     </z:index>
2765   </xslo:template>
2766   <xslo:template mode="index_data_field" match="marc:datafield[@tag='633']">
2767     <z:index name="Subject:w Subject:p">
2768       <xslo:variable name="raw_heading">
2769         <xslo:for-each select="marc:subfield">
2770           <xslo:if test="position() &gt; 1">
2771             <xslo:value-of select="substring(' ', 1, 1)"/>
2772           </xslo:if>
2773           <xslo:value-of select="."/>
2774         </xslo:for-each>
2775       </xslo:variable>
2776       <xslo:value-of select="normalize-space($raw_heading)"/>
2777     </z:index>
2778   </xslo:template>
2779   <xslo:template mode="index_data_field" match="marc:datafield[@tag='634']">
2780     <z:index name="Subject:w Subject:p">
2781       <xslo:variable name="raw_heading">
2782         <xslo:for-each select="marc:subfield">
2783           <xslo:if test="position() &gt; 1">
2784             <xslo:value-of select="substring(' ', 1, 1)"/>
2785           </xslo:if>
2786           <xslo:value-of select="."/>
2787         </xslo:for-each>
2788       </xslo:variable>
2789       <xslo:value-of select="normalize-space($raw_heading)"/>
2790     </z:index>
2791   </xslo:template>
2792   <xslo:template mode="index_data_field" match="marc:datafield[@tag='635']">
2793     <z:index name="Subject:w Subject:p">
2794       <xslo:variable name="raw_heading">
2795         <xslo:for-each select="marc:subfield">
2796           <xslo:if test="position() &gt; 1">
2797             <xslo:value-of select="substring(' ', 1, 1)"/>
2798           </xslo:if>
2799           <xslo:value-of select="."/>
2800         </xslo:for-each>
2801       </xslo:variable>
2802       <xslo:value-of select="normalize-space($raw_heading)"/>
2803     </z:index>
2804   </xslo:template>
2805   <xslo:template mode="index_data_field" match="marc:datafield[@tag='636']">
2806     <z:index name="Subject:w Subject:p">
2807       <xslo:variable name="raw_heading">
2808         <xslo:for-each select="marc:subfield">
2809           <xslo:if test="position() &gt; 1">
2810             <xslo:value-of select="substring(' ', 1, 1)"/>
2811           </xslo:if>
2812           <xslo:value-of select="."/>
2813         </xslo:for-each>
2814       </xslo:variable>
2815       <xslo:value-of select="normalize-space($raw_heading)"/>
2816     </z:index>
2817   </xslo:template>
2818   <xslo:template mode="index_data_field" match="marc:datafield[@tag='646']">
2819     <z:index name="Subject:w Subject:p">
2820       <xslo:variable name="raw_heading">
2821         <xslo:for-each select="marc:subfield">
2822           <xslo:if test="position() &gt; 1">
2823             <xslo:value-of select="substring(' ', 1, 1)"/>
2824           </xslo:if>
2825           <xslo:value-of select="."/>
2826         </xslo:for-each>
2827       </xslo:variable>
2828       <xslo:value-of select="normalize-space($raw_heading)"/>
2829     </z:index>
2830   </xslo:template>
2831   <xslo:template mode="index_data_field" match="marc:datafield[@tag='670']">
2832     <z:index name="Subject-precis:w Subject-precis:p">
2833       <xslo:variable name="raw_heading">
2834         <xslo:for-each select="marc:subfield">
2835           <xslo:if test="position() &gt; 1">
2836             <xslo:value-of select="substring(' ', 1, 1)"/>
2837           </xslo:if>
2838           <xslo:value-of select="."/>
2839         </xslo:for-each>
2840       </xslo:variable>
2841       <xslo:value-of select="normalize-space($raw_heading)"/>
2842     </z:index>
2843   </xslo:template>
2844   <xslo:template mode="index_data_field" match="marc:datafield[@tag='680']">
2845     <z:index name="LC-call-number:w LC-call-number:p">
2846       <xslo:variable name="raw_heading">
2847         <xslo:for-each select="marc:subfield">
2848           <xslo:if test="position() &gt; 1">
2849             <xslo:value-of select="substring(' ', 1, 1)"/>
2850           </xslo:if>
2851           <xslo:value-of select="."/>
2852         </xslo:for-each>
2853       </xslo:variable>
2854       <xslo:value-of select="normalize-space($raw_heading)"/>
2855     </z:index>
2856   </xslo:template>
2857   <xslo:template mode="index_data_field" match="marc:datafield[@tag='686']">
2858     <z:index name="Local-classification:w Local-classification:p">
2859       <xslo:variable name="raw_heading">
2860         <xslo:for-each select="marc:subfield">
2861           <xslo:if test="position() &gt; 1">
2862             <xslo:value-of select="substring(' ', 1, 1)"/>
2863           </xslo:if>
2864           <xslo:value-of select="."/>
2865         </xslo:for-each>
2866       </xslo:variable>
2867       <xslo:value-of select="normalize-space($raw_heading)"/>
2868     </z:index>
2869   </xslo:template>
2870   <xslo:template mode="index_data_field" match="marc:datafield[@tag='995']">
2871     <z:index name="item # just to index every subfield:w">
2872       <xslo:variable name="raw_heading">
2873         <xslo:for-each select="marc:subfield">
2874           <xslo:if test="position() &gt; 1">
2875             <xslo:value-of select="substring(' ', 1, 1)"/>
2876           </xslo:if>
2877           <xslo:value-of select="."/>
2878         </xslo:for-each>
2879       </xslo:variable>
2880       <xslo:value-of select="normalize-space($raw_heading)"/>
2881     </z:index>
2882   </xslo:template>
2883   <xslo:template match="*">
2884     <z:index name="Any:w Any:p">
2885       <xslo:value-of select="."/>
2886     </z:index>
2887   </xslo:template>
2888   <xslo:template name="chopPunctuation">
2889     <xslo:param name="chopString"/>
2890     <xslo:variable name="length" select="string-length($chopString)"/>
2891     <xslo:choose>
2892       <xslo:when test="$length=0"/>
2893       <xslo:when test="contains('-,.:=;!%/', substring($chopString,$length,1))">
2894         <xslo:call-template name="chopPunctuation">
2895           <xslo:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
2896         </xslo:call-template>
2897       </xslo:when>
2898       <xslo:when test="not($chopString)"/>
2899       <xslo:otherwise>
2900         <xslo:value-of select="$chopString"/>
2901       </xslo:otherwise>
2902     </xslo:choose>
2903     <xslo:text/>
2904   </xslo:template>
2905 </xslo:stylesheet>