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