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