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