5feab047fb89b34447a30ade83a17eaa429a4969
[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='648']">
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='650']">
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='651']">
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='652']">
659     <xslo:for-each select="marc:subfield">
660       <xslo:if test="contains('9', @code)">
661         <z:index name="Koha-Auth-Number:w">
662           <xslo:value-of select="."/>
663         </z:index>
664       </xslo:if>
665     </xslo:for-each>
666   </xslo:template>
667   <xslo:template mode="index_subfields" match="marc:datafield[@tag='653']">
668     <xslo:for-each select="marc:subfield">
669       <xslo:if test="contains('a', @code)">
670         <z:index name="Index-term-uncontrolled:w Index-term-uncontrolled:p Subject:w Subject:p">
671           <xslo:value-of select="."/>
672         </z:index>
673       </xslo:if>
674     </xslo:for-each>
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='654']">
684     <xslo:for-each select="marc:subfield">
685       <xslo:if test="contains('9', @code)">
686         <z:index name="Koha-Auth-Number:w">
687           <xslo:value-of select="."/>
688         </z:index>
689       </xslo:if>
690     </xslo:for-each>
691   </xslo:template>
692   <xslo:template mode="index_subfields" match="marc:datafield[@tag='655']">
693     <xslo:for-each select="marc:subfield">
694       <xslo:if test="contains('a', @code)">
695         <z:index name="Index-term-genre:w Index-term-genre:p Subject:w Subject:p">
696           <xslo:value-of select="."/>
697         </z:index>
698       </xslo:if>
699     </xslo:for-each>
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='656']">
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='657']">
718     <xslo:for-each select="marc:subfield">
719       <xslo:if test="contains('9', @code)">
720         <z:index name="Koha-Auth-Number:w">
721           <xslo:value-of select="."/>
722         </z:index>
723       </xslo:if>
724     </xslo:for-each>
725   </xslo:template>
726   <xslo:template mode="index_subfields" match="marc:datafield[@tag='658']">
727     <xslo:for-each select="marc:subfield">
728       <xslo:if test="contains('a', @code)">
729         <z:index name="curriculum:w curriculum:p Subject:w Subject:p">
730           <xslo:value-of select="."/>
731         </z:index>
732       </xslo:if>
733     </xslo:for-each>
734     <xslo:for-each select="marc:subfield">
735       <xslo:if test="contains('b', @code)">
736         <z:index name="curriculum:w curriculum:p Subject:w Subject:p">
737           <xslo:value-of select="."/>
738         </z:index>
739       </xslo:if>
740     </xslo:for-each>
741     <xslo:for-each select="marc:subfield">
742       <xslo:if test="contains('c', @code)">
743         <z:index name="curriculum:w curriculum:p Subject:w Subject:p">
744           <xslo:value-of select="."/>
745         </z:index>
746       </xslo:if>
747     </xslo:for-each>
748   </xslo:template>
749   <xslo:template mode="index_subfields" match="marc:datafield[@tag='690']">
750     <xslo:for-each select="marc:subfield">
751       <xslo:if test="contains('9', @code)">
752         <z:index name="Koha-Auth-Number:w">
753           <xslo:value-of select="."/>
754         </z:index>
755       </xslo:if>
756     </xslo:for-each>
757   </xslo:template>
758   <xslo:template mode="index_subfields" match="marc:datafield[@tag='700']">
759     <xslo:for-each select="marc:subfield">
760       <xslo:if test="contains('9', @code)">
761         <z:index name="Cross-Reference:w Koha-Auth-Number:w">
762           <xslo:value-of select="."/>
763         </z:index>
764       </xslo:if>
765     </xslo:for-each>
766     <xslo:for-each select="marc:subfield">
767       <xslo:if test="contains('a', @code)">
768         <z:index name="Author:w Author:p">
769           <xslo:value-of select="."/>
770         </z:index>
771       </xslo:if>
772     </xslo:for-each>
773     <xslo:for-each select="marc:subfield">
774       <xslo:if test="contains('n', @code)">
775         <z:index name="Thematic-number:w">
776           <xslo:value-of select="."/>
777         </z:index>
778       </xslo:if>
779     </xslo:for-each>
780     <xslo:for-each select="marc:subfield">
781       <xslo:if test="contains('r', @code)">
782         <z:index name="Music-key:w">
783           <xslo:value-of select="."/>
784         </z:index>
785       </xslo:if>
786     </xslo:for-each>
787     <xslo:for-each select="marc:subfield">
788       <xslo:if test="contains('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:template>
795   <xslo:template mode="index_subfields" match="marc:datafield[@tag='710']">
796     <xslo:for-each select="marc:subfield">
797       <xslo:if test="contains('t', @code)">
798         <z:index name="Author-title:w Name-and-title:w Title:w Title-uniform:w">
799           <xslo:value-of select="."/>
800         </z:index>
801       </xslo:if>
802     </xslo:for-each>
803     <xslo:for-each select="marc:subfield">
804       <xslo:if test="contains('a', @code)">
805         <z:index name="Name-and-title:w">
806           <xslo:value-of select="."/>
807         </z:index>
808       </xslo:if>
809     </xslo:for-each>
810     <xslo:for-each select="marc:subfield">
811       <xslo:if test="contains('9', @code)">
812         <z:index name="Koha-Auth-Number:w">
813           <xslo:value-of select="."/>
814         </z:index>
815       </xslo:if>
816     </xslo:for-each>
817   </xslo:template>
818   <xslo:template mode="index_subfields" match="marc:datafield[@tag='711']">
819     <xslo:for-each select="marc:subfield">
820       <xslo:if test="contains('a', @code)">
821         <z:index name="Name-and-title:w">
822           <xslo:value-of select="."/>
823         </z:index>
824       </xslo:if>
825     </xslo:for-each>
826     <xslo:for-each select="marc:subfield">
827       <xslo:if test="contains('t', @code)">
828         <z:index name="Author-title:w Title:w Title-uniform:w">
829           <xslo:value-of select="."/>
830         </z:index>
831       </xslo:if>
832     </xslo:for-each>
833     <xslo:for-each select="marc:subfield">
834       <xslo:if test="contains('9', @code)">
835         <z:index name="Koha-Auth-Number:w">
836           <xslo:value-of select="."/>
837         </z:index>
838       </xslo:if>
839     </xslo:for-each>
840   </xslo:template>
841   <xslo:template mode="index_subfields" match="marc:datafield[@tag='730']">
842     <xslo:for-each select="marc:subfield">
843       <xslo:if test="contains('n', @code)">
844         <z:index name="Thematic-number:w">
845           <xslo:value-of select="."/>
846         </z:index>
847       </xslo:if>
848     </xslo:for-each>
849     <xslo:for-each select="marc:subfield">
850       <xslo:if test="contains('r', @code)">
851         <z:index name="Music-key:w">
852           <xslo:value-of select="."/>
853         </z:index>
854       </xslo:if>
855     </xslo:for-each>
856     <xslo:for-each select="marc:subfield">
857       <xslo:if test="contains('9', @code)">
858         <z:index name="Koha-Auth-Number:w">
859           <xslo:value-of select="."/>
860         </z:index>
861       </xslo:if>
862     </xslo:for-each>
863   </xslo:template>
864   <xslo:template mode="index_subfields" match="marc:datafield[@tag='751']">
865     <xslo:for-each select="marc:subfield">
866       <xslo:if test="contains('a', @code)">
867         <z:index name="Name-geographic:w">
868           <xslo:value-of select="."/>
869         </z:index>
870       </xslo:if>
871     </xslo:for-each>
872     <xslo:for-each select="marc:subfield">
873       <xslo:if test="contains('9', @code)">
874         <z:index name="Koha-Auth-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='770']">
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='772']">
890     <xslo:for-each select="marc:subfield">
891       <xslo:if test="contains('w', @code)">
892         <z:index name="Record-control-number:w">
893           <xslo:value-of select="."/>
894         </z:index>
895       </xslo:if>
896     </xslo:for-each>
897   </xslo:template>
898   <xslo:template mode="index_subfields" match="marc:datafield[@tag='773']">
899     <xslo:for-each select="marc:subfield">
900       <xslo:if test="contains('a', @code)">
901         <z:index name="Host-item:w">
902           <xslo:value-of select="."/>
903         </z:index>
904       </xslo:if>
905     </xslo:for-each>
906     <xslo:for-each select="marc:subfield">
907       <xslo:if test="contains('9', @code)">
908         <z:index name="Host-Item-Number:w">
909           <xslo:value-of select="."/>
910         </z:index>
911       </xslo:if>
912     </xslo:for-each>
913     <xslo:for-each select="marc:subfield">
914       <xslo:if test="contains('t', @code)">
915         <z:index name="Host-item:w">
916           <xslo:value-of select="."/>
917         </z:index>
918       </xslo:if>
919     </xslo:for-each>
920     <xslo:for-each select="marc:subfield">
921       <xslo:if test="contains('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='774']">
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='775']">
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='776']">
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='777']">
956     <xslo:for-each select="marc:subfield">
957       <xslo:if test="contains('w', @code)">
958         <z:index name="Record-control-number:w">
959           <xslo:value-of select="."/>
960         </z:index>
961       </xslo:if>
962     </xslo:for-each>
963   </xslo:template>
964   <xslo:template mode="index_subfields" match="marc:datafield[@tag='780']">
965     <xslo:for-each select="marc:subfield">
966       <xslo:if test="contains('t', @code)">
967         <z:index name="Title:w">
968           <xslo:value-of select="."/>
969         </z:index>
970       </xslo:if>
971     </xslo:for-each>
972     <xslo:for-each select="marc:subfield">
973       <xslo:if test="contains('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='785']">
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='787']">
990     <xslo:for-each select="marc:subfield">
991       <xslo:if test="contains('w', @code)">
992         <z:index name="Record-control-number:w">
993           <xslo:value-of select="."/>
994         </z:index>
995       </xslo:if>
996     </xslo:for-each>
997   </xslo:template>
998   <xslo:template mode="index_subfields" match="marc:datafield[@tag='800']">
999     <xslo:for-each select="marc:subfield">
1000       <xslo:if test="contains('a', @code)">
1001         <z:index name="Name-and-title:w Title-series:w Title-series:p">
1002           <xslo:value-of select="."/>
1003         </z:index>
1004       </xslo:if>
1005     </xslo:for-each>
1006     <xslo:for-each select="marc:subfield">
1007       <xslo:if test="contains('t', @code)">
1008         <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w Title-series:p">
1009           <xslo:value-of select="."/>
1010         </z:index>
1011       </xslo:if>
1012     </xslo:for-each>
1013     <xslo:for-each select="marc:subfield">
1014       <xslo:if test="contains('9', @code)">
1015         <z:index name="Koha-Auth-Number:w">
1016           <xslo:value-of select="."/>
1017         </z:index>
1018       </xslo:if>
1019     </xslo:for-each>
1020     <xslo:for-each select="marc:subfield">
1021       <xslo:if test="contains('w', @code)">
1022         <z:index name="Record-control-number:w">
1023           <xslo:value-of select="."/>
1024         </z:index>
1025       </xslo:if>
1026     </xslo:for-each>
1027   </xslo:template>
1028   <xslo:template mode="index_subfields" match="marc:datafield[@tag='810']">
1029     <xslo:for-each select="marc:subfield">
1030       <xslo:if test="contains('a', @code)">
1031         <z:index name="Name-and-title:w Title-series:w Title-series:p">
1032           <xslo:value-of select="."/>
1033         </z:index>
1034       </xslo:if>
1035     </xslo:for-each>
1036     <xslo:for-each select="marc:subfield">
1037       <xslo:if test="contains('t', @code)">
1038         <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w Title-series:p">
1039           <xslo:value-of select="."/>
1040         </z:index>
1041       </xslo:if>
1042     </xslo:for-each>
1043     <xslo:for-each select="marc:subfield">
1044       <xslo:if test="contains('w', @code)">
1045         <z:index name="Record-control-number:w">
1046           <xslo:value-of select="."/>
1047         </z:index>
1048       </xslo:if>
1049     </xslo:for-each>
1050     <xslo:for-each select="marc:subfield">
1051       <xslo:if test="contains('9', @code)">
1052         <z:index name="Koha-Auth-Number:w">
1053           <xslo:value-of select="."/>
1054         </z:index>
1055       </xslo:if>
1056     </xslo:for-each>
1057   </xslo:template>
1058   <xslo:template mode="index_subfields" match="marc:datafield[@tag='811']">
1059     <xslo:for-each select="marc:subfield">
1060       <xslo:if test="contains('a', @code)">
1061         <z:index name="Name-and-title:w Title-series:w Title-series:p">
1062           <xslo:value-of select="."/>
1063         </z:index>
1064       </xslo:if>
1065     </xslo:for-each>
1066     <xslo:for-each select="marc:subfield">
1067       <xslo:if test="contains('9', @code)">
1068         <z:index name="Koha-Auth-Number:w">
1069           <xslo:value-of select="."/>
1070         </z:index>
1071       </xslo:if>
1072     </xslo:for-each>
1073     <xslo:for-each select="marc:subfield">
1074       <xslo:if test="contains('t', @code)">
1075         <z:index name="Author-title:w Name-and-title:w Title:w Title-series:w Title-series:p">
1076           <xslo:value-of select="."/>
1077         </z:index>
1078       </xslo:if>
1079     </xslo:for-each>
1080     <xslo:for-each select="marc:subfield">
1081       <xslo:if test="contains('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:template>
1088   <xslo:template mode="index_subfields" match="marc:datafield[@tag='830']">
1089     <xslo:for-each select="marc:subfield">
1090       <xslo:if test="contains('w', @code)">
1091         <z:index name="Record-control-number:w">
1092           <xslo:value-of select="."/>
1093         </z:index>
1094       </xslo:if>
1095     </xslo:for-each>
1096     <xslo:for-each select="marc:subfield">
1097       <xslo:if test="contains('9', @code)">
1098         <z:index name="Koha-Auth-Number:w">
1099           <xslo:value-of select="."/>
1100         </z:index>
1101       </xslo:if>
1102     </xslo:for-each>
1103   </xslo:template>
1104   <xslo:template mode="index_subfields" match="marc:datafield[@tag='999']">
1105     <xslo:for-each select="marc:subfield">
1106       <xslo:if test="contains('c', @code)">
1107         <z:index name="Local-Number:n Local-Number:w Local-Number:s">
1108           <xslo:value-of select="."/>
1109         </z:index>
1110       </xslo:if>
1111     </xslo:for-each>
1112     <xslo:for-each select="marc:subfield">
1113       <xslo:if test="contains('d', @code)">
1114         <z:index name="biblioitemnumber:n biblioitemnumber:w biblioitemnumber:s">
1115           <xslo:value-of select="."/>
1116         </z:index>
1117       </xslo:if>
1118     </xslo:for-each>
1119   </xslo:template>
1120   <xslo:template mode="index_subfields" match="marc:datafield[@tag='942']">
1121     <xslo:for-each select="marc:subfield">
1122       <xslo:if test="contains('0', @code)">
1123         <z:index name="totalissues:n totalissues:s">
1124           <xslo:value-of select="."/>
1125         </z:index>
1126       </xslo:if>
1127     </xslo:for-each>
1128     <xslo:for-each select="marc:subfield">
1129       <xslo:if test="contains('2', @code)">
1130         <z:index name="cn-bib-source:w">
1131           <xslo:value-of select="."/>
1132         </z:index>
1133       </xslo:if>
1134     </xslo:for-each>
1135     <xslo:for-each select="marc:subfield">
1136       <xslo:if test="contains('6', @code)">
1137         <z:index name="cn-bib-sort:n cn-bib-sort:s">
1138           <xslo:value-of select="."/>
1139         </z:index>
1140       </xslo:if>
1141     </xslo:for-each>
1142     <xslo:for-each select="marc:subfield">
1143       <xslo:if test="contains('c', @code)">
1144         <z:index name="itemtype:w itemtype:p itype:w itype:p">
1145           <xslo:value-of select="."/>
1146         </z:index>
1147       </xslo:if>
1148     </xslo:for-each>
1149     <xslo:for-each select="marc:subfield">
1150       <xslo:if test="contains('n', @code)">
1151         <z:index name="Suppress:w Suppress:n">
1152           <xslo:value-of select="."/>
1153         </z:index>
1154       </xslo:if>
1155     </xslo:for-each>
1156     <xslo:for-each select="marc:subfield">
1157       <xslo:if test="contains('h', @code)">
1158         <z:index name="cn-class:w">
1159           <xslo:value-of select="."/>
1160         </z:index>
1161       </xslo:if>
1162     </xslo:for-each>
1163     <xslo:for-each select="marc:subfield">
1164       <xslo:if test="contains('i', @code)">
1165         <z:index name="cn-item:w">
1166           <xslo:value-of select="."/>
1167         </z:index>
1168       </xslo:if>
1169     </xslo:for-each>
1170     <xslo:for-each select="marc:subfield">
1171       <xslo:if test="contains('k', @code)">
1172         <z:index name="cn-prefix:w">
1173           <xslo:value-of select="."/>
1174         </z:index>
1175       </xslo:if>
1176     </xslo:for-each>
1177     <xslo:for-each select="marc:subfield">
1178       <xslo:if test="contains('m', @code)">
1179         <z:index name="cn-suffix:w">
1180           <xslo:value-of select="."/>
1181         </z:index>
1182       </xslo:if>
1183     </xslo:for-each>
1184   </xslo:template>
1185   <xslo:template mode="index_subfields" match="marc:datafield[@tag='952']">
1186     <xslo:for-each select="marc:subfield">
1187       <xslo:if test="contains('0', @code)">
1188         <z:index name="withdrawn:n withdrawn:w">
1189           <xslo:value-of select="."/>
1190         </z:index>
1191       </xslo:if>
1192     </xslo:for-each>
1193     <xslo:for-each select="marc:subfield">
1194       <xslo:if test="contains('1', @code)">
1195         <z:index name="lost:w lost:n">
1196           <xslo:value-of select="."/>
1197         </z:index>
1198       </xslo:if>
1199     </xslo:for-each>
1200     <xslo:for-each select="marc:subfield">
1201       <xslo:if test="contains('2', @code)">
1202         <z:index name="classification-source:w">
1203           <xslo:value-of select="."/>
1204         </z:index>
1205       </xslo:if>
1206     </xslo:for-each>
1207     <xslo:for-each select="marc:subfield">
1208       <xslo:if test="contains('3', @code)">
1209         <z:index name="materials-specified:w">
1210           <xslo:value-of select="."/>
1211         </z:index>
1212       </xslo:if>
1213     </xslo:for-each>
1214     <xslo:for-each select="marc:subfield">
1215       <xslo:if test="contains('4', @code)">
1216         <z:index name="damaged:n damaged:w">
1217           <xslo:value-of select="."/>
1218         </z:index>
1219       </xslo:if>
1220     </xslo:for-each>
1221     <xslo:for-each select="marc:subfield">
1222       <xslo:if test="contains('5', @code)">
1223         <z:index name="restricted:n restricted:w">
1224           <xslo:value-of select="."/>
1225         </z:index>
1226       </xslo:if>
1227     </xslo:for-each>
1228     <xslo:for-each select="marc:subfield">
1229       <xslo:if test="contains('6', @code)">
1230         <z:index name="cn-sort:n cn-sort:s">
1231           <xslo:value-of select="."/>
1232         </z:index>
1233       </xslo:if>
1234     </xslo:for-each>
1235     <xslo:for-each select="marc:subfield">
1236       <xslo:if test="contains('7', @code)">
1237         <z:index name="notforloan:n notforloan:w">
1238           <xslo:value-of select="."/>
1239         </z:index>
1240       </xslo:if>
1241     </xslo:for-each>
1242     <xslo:for-each select="marc:subfield">
1243       <xslo:if test="contains('8', @code)">
1244         <z:index name="ccode:w ccode:p">
1245           <xslo:value-of select="."/>
1246         </z:index>
1247       </xslo:if>
1248     </xslo:for-each>
1249     <xslo:for-each select="marc:subfield">
1250       <xslo:if test="contains('9', @code)">
1251         <z:index name="itemnumber:n itemnumber:s">
1252           <xslo:value-of select="."/>
1253         </z:index>
1254       </xslo:if>
1255     </xslo:for-each>
1256     <xslo:for-each select="marc:subfield">
1257       <xslo:if test="contains('a', @code)">
1258         <z:index name="homebranch:w">
1259           <xslo:value-of select="."/>
1260         </z:index>
1261       </xslo:if>
1262     </xslo:for-each>
1263     <xslo:for-each select="marc:subfield">
1264       <xslo:if test="contains('b', @code)">
1265         <z:index name="holdingbranch:w">
1266           <xslo:value-of select="."/>
1267         </z:index>
1268       </xslo:if>
1269     </xslo:for-each>
1270     <xslo:for-each select="marc:subfield">
1271       <xslo:if test="contains('c', @code)">
1272         <z:index name="location:w">
1273           <xslo:value-of select="."/>
1274         </z:index>
1275       </xslo:if>
1276     </xslo:for-each>
1277     <xslo:for-each select="marc:subfield">
1278       <xslo:if test="contains('d', @code)">
1279         <z:index name="Date-of-acquisition:w Date-of-acquisition:d Date-of-acquisition:s">
1280           <xslo:value-of select="."/>
1281         </z:index>
1282       </xslo:if>
1283     </xslo:for-each>
1284     <xslo:for-each select="marc:subfield">
1285       <xslo:if test="contains('e', @code)">
1286         <z:index name="acqsource:w">
1287           <xslo:value-of select="."/>
1288         </z:index>
1289       </xslo:if>
1290     </xslo:for-each>
1291     <xslo:for-each select="marc:subfield">
1292       <xslo:if test="contains('f', @code)">
1293         <z:index name="coded-location-qualifier:w">
1294           <xslo:value-of select="."/>
1295         </z:index>
1296       </xslo:if>
1297     </xslo:for-each>
1298     <xslo:for-each select="marc:subfield">
1299       <xslo:if test="contains('g', @code)">
1300         <z:index name="price:w">
1301           <xslo:value-of select="."/>
1302         </z:index>
1303       </xslo:if>
1304     </xslo:for-each>
1305     <xslo:for-each select="marc:subfield">
1306       <xslo:if test="contains('i', @code)">
1307         <z:index name="Number-local-acquisition:w">
1308           <xslo:value-of select="."/>
1309         </z:index>
1310       </xslo:if>
1311     </xslo:for-each>
1312     <xslo:for-each select="marc:subfield">
1313       <xslo:if test="contains('j', @code)">
1314         <z:index name="stack:n stack:w">
1315           <xslo:value-of select="."/>
1316         </z:index>
1317       </xslo:if>
1318     </xslo:for-each>
1319     <xslo:for-each select="marc:subfield">
1320       <xslo:if test="contains('l', @code)">
1321         <z:index name="issues:n issues:w issues:s">
1322           <xslo:value-of select="."/>
1323         </z:index>
1324       </xslo:if>
1325     </xslo:for-each>
1326     <xslo:for-each select="marc:subfield">
1327       <xslo:if test="contains('m', @code)">
1328         <z:index name="renewals:n renewals:w">
1329           <xslo:value-of select="."/>
1330         </z:index>
1331       </xslo:if>
1332     </xslo:for-each>
1333     <xslo:for-each select="marc:subfield">
1334       <xslo:if test="contains('n', @code)">
1335         <z:index name="reserves:n reserves:w">
1336           <xslo:value-of select="."/>
1337         </z:index>
1338       </xslo:if>
1339     </xslo:for-each>
1340     <xslo:for-each select="marc:subfield">
1341       <xslo:if test="contains('o', @code)">
1342         <z:index name="Local-classification:w Local-classification:p Local-classification:s">
1343           <xslo:value-of select="."/>
1344         </z:index>
1345       </xslo:if>
1346     </xslo:for-each>
1347     <xslo:for-each select="marc:subfield">
1348       <xslo:if test="contains('p', @code)">
1349         <z:index name="barcode:w barcode:n">
1350           <xslo:value-of select="."/>
1351         </z:index>
1352       </xslo:if>
1353     </xslo:for-each>
1354     <xslo:for-each select="marc:subfield">
1355       <xslo:if test="contains('q', @code)">
1356         <z:index name="onloan:n onloan:w">
1357           <xslo:value-of select="."/>
1358         </z:index>
1359       </xslo:if>
1360     </xslo:for-each>
1361     <xslo:for-each select="marc:subfield">
1362       <xslo:if test="contains('r', @code)">
1363         <z:index name="datelastseen:w">
1364           <xslo:value-of select="."/>
1365         </z:index>
1366       </xslo:if>
1367     </xslo:for-each>
1368     <xslo:for-each select="marc:subfield">
1369       <xslo:if test="contains('s', @code)">
1370         <z:index name="datelastborrowed:w">
1371           <xslo:value-of select="."/>
1372         </z:index>
1373       </xslo:if>
1374     </xslo:for-each>
1375     <xslo:for-each select="marc:subfield">
1376       <xslo:if test="contains('t', @code)">
1377         <z:index name="copynumber:w">
1378           <xslo:value-of select="."/>
1379         </z:index>
1380       </xslo:if>
1381     </xslo:for-each>
1382     <xslo:for-each select="marc:subfield">
1383       <xslo:if test="contains('u', @code)">
1384         <z:index name="uri:u">
1385           <xslo:value-of select="."/>
1386         </z:index>
1387       </xslo:if>
1388     </xslo:for-each>
1389     <xslo:for-each select="marc:subfield">
1390       <xslo:if test="contains('v', @code)">
1391         <z:index name="replacementprice:w">
1392           <xslo:value-of select="."/>
1393         </z:index>
1394       </xslo:if>
1395     </xslo:for-each>
1396     <xslo:for-each select="marc:subfield">
1397       <xslo:if test="contains('w', @code)">
1398         <z:index name="replacementpricedate:w">
1399           <xslo:value-of select="."/>
1400         </z:index>
1401       </xslo:if>
1402     </xslo:for-each>
1403     <xslo:for-each select="marc:subfield">
1404       <xslo:if test="contains('y', @code)">
1405         <z:index name="itype:w itype:p">
1406           <xslo:value-of select="."/>
1407         </z:index>
1408       </xslo:if>
1409     </xslo:for-each>
1410     <xslo:for-each select="marc:subfield">
1411       <xslo:if test="contains('z', @code)">
1412         <z:index name="Note:w Note:p">
1413           <xslo:value-of select="."/>
1414         </z:index>
1415       </xslo:if>
1416     </xslo:for-each>
1417   </xslo:template>
1418   <xslo:template mode="index_data_field" match="marc:datafield[@tag='010']">
1419     <z:index name="LC-card-number:w Identifier-standard:w">
1420       <xslo:variable name="raw_heading">
1421         <xslo:for-each select="marc:subfield">
1422           <xslo:if test="position() &gt; 1">
1423             <xslo:value-of select="substring(' ', 1, 1)"/>
1424           </xslo:if>
1425           <xslo:value-of select="."/>
1426         </xslo:for-each>
1427       </xslo:variable>
1428       <xslo:value-of select="normalize-space($raw_heading)"/>
1429     </z:index>
1430   </xslo:template>
1431   <xslo:template mode="index_data_field" match="marc:datafield[@tag='011']">
1432     <z:index name="LC-card-number:w Identifier-standard:w">
1433       <xslo:variable name="raw_heading">
1434         <xslo:for-each select="marc:subfield">
1435           <xslo:if test="position() &gt; 1">
1436             <xslo:value-of select="substring(' ', 1, 1)"/>
1437           </xslo:if>
1438           <xslo:value-of select="."/>
1439         </xslo:for-each>
1440       </xslo:variable>
1441       <xslo:value-of select="normalize-space($raw_heading)"/>
1442     </z:index>
1443   </xslo:template>
1444   <xslo:template mode="index_data_field" match="marc:datafield[@tag='015']">
1445     <z:index name="BNB-card-number:w BGF-number:w Number-db:w Number-natl-biblio:w Identifier-standard:w">
1446       <xslo:variable name="raw_heading">
1447         <xslo:for-each select="marc:subfield">
1448           <xslo:if test="position() &gt; 1">
1449             <xslo:value-of select="substring(' ', 1, 1)"/>
1450           </xslo:if>
1451           <xslo:value-of select="."/>
1452         </xslo:for-each>
1453       </xslo:variable>
1454       <xslo:value-of select="normalize-space($raw_heading)"/>
1455     </z:index>
1456   </xslo:template>
1457   <xslo:template mode="index_data_field" match="marc:datafield[@tag='017']">
1458     <z:index name="Number-legal-deposit:w Identifier-standard:w">
1459       <xslo:variable name="raw_heading">
1460         <xslo:for-each select="marc:subfield">
1461           <xslo:if test="position() &gt; 1">
1462             <xslo:value-of select="substring(' ', 1, 1)"/>
1463           </xslo:if>
1464           <xslo:value-of select="."/>
1465         </xslo:for-each>
1466       </xslo:variable>
1467       <xslo:value-of select="normalize-space($raw_heading)"/>
1468     </z:index>
1469   </xslo:template>
1470   <xslo:template mode="index_data_field" match="marc:datafield[@tag='018']">
1471     <z:index name="Identifier-standard:w">
1472       <xslo:variable name="raw_heading">
1473         <xslo:for-each select="marc:subfield">
1474           <xslo:if test="position() &gt; 1">
1475             <xslo:value-of select="substring(' ', 1, 1)"/>
1476           </xslo:if>
1477           <xslo:value-of select="."/>
1478         </xslo:for-each>
1479       </xslo:variable>
1480       <xslo:value-of select="normalize-space($raw_heading)"/>
1481     </z:index>
1482   </xslo:template>
1483   <xslo:template mode="index_data_field" match="marc:datafield[@tag='020']">
1484     <z:index name="Identifier-standard:w">
1485       <xslo:variable name="raw_heading">
1486         <xslo:for-each select="marc:subfield">
1487           <xslo:if test="position() &gt; 1">
1488             <xslo:value-of select="substring(' ', 1, 1)"/>
1489           </xslo:if>
1490           <xslo:value-of select="."/>
1491         </xslo:for-each>
1492       </xslo:variable>
1493       <xslo:value-of select="normalize-space($raw_heading)"/>
1494     </z:index>
1495   </xslo:template>
1496   <xslo:template mode="index_data_field" match="marc:datafield[@tag='022']">
1497     <z:index name="Identifier-standard:w">
1498       <xslo:variable name="raw_heading">
1499         <xslo:for-each select="marc:subfield">
1500           <xslo:if test="position() &gt; 1">
1501             <xslo:value-of select="substring(' ', 1, 1)"/>
1502           </xslo:if>
1503           <xslo:value-of select="."/>
1504         </xslo:for-each>
1505       </xslo:variable>
1506       <xslo:value-of select="normalize-space($raw_heading)"/>
1507     </z:index>
1508   </xslo:template>
1509   <xslo:template mode="index_data_field" match="marc:datafield[@tag='023']">
1510     <z:index name="Identifier-standard:w">
1511       <xslo:variable name="raw_heading">
1512         <xslo:for-each select="marc:subfield">
1513           <xslo:if test="position() &gt; 1">
1514             <xslo:value-of select="substring(' ', 1, 1)"/>
1515           </xslo:if>
1516           <xslo:value-of select="."/>
1517         </xslo:for-each>
1518       </xslo:variable>
1519       <xslo:value-of select="normalize-space($raw_heading)"/>
1520     </z:index>
1521   </xslo:template>
1522   <xslo:template mode="index_data_field" match="marc:datafield[@tag='024']">
1523     <z:index name="Identifier-standard:w">
1524       <xslo:variable name="raw_heading">
1525         <xslo:for-each select="marc:subfield">
1526           <xslo:if test="position() &gt; 1">
1527             <xslo:value-of select="substring(' ', 1, 1)"/>
1528           </xslo:if>
1529           <xslo:value-of select="."/>
1530         </xslo:for-each>
1531       </xslo:variable>
1532       <xslo:value-of select="normalize-space($raw_heading)"/>
1533     </z:index>
1534   </xslo:template>
1535   <xslo:template mode="index_data_field" match="marc:datafield[@tag='025']">
1536     <z:index name="Identifier-standard:w">
1537       <xslo:variable name="raw_heading">
1538         <xslo:for-each select="marc:subfield">
1539           <xslo:if test="position() &gt; 1">
1540             <xslo:value-of select="substring(' ', 1, 1)"/>
1541           </xslo:if>
1542           <xslo:value-of select="."/>
1543         </xslo:for-each>
1544       </xslo:variable>
1545       <xslo:value-of select="normalize-space($raw_heading)"/>
1546     </z:index>
1547   </xslo:template>
1548   <xslo:template mode="index_data_field" match="marc:datafield[@tag='027']">
1549     <z:index name="Report-number:w Identifier-standard:w">
1550       <xslo:variable name="raw_heading">
1551         <xslo:for-each select="marc:subfield">
1552           <xslo:if test="position() &gt; 1">
1553             <xslo:value-of select="substring(' ', 1, 1)"/>
1554           </xslo:if>
1555           <xslo:value-of select="."/>
1556         </xslo:for-each>
1557       </xslo:variable>
1558       <xslo:value-of select="normalize-space($raw_heading)"/>
1559     </z:index>
1560   </xslo:template>
1561   <xslo:template mode="index_data_field" match="marc:datafield[@tag='028']">
1562     <z:index name="Identifier-publisher-for-music:w Identifier-standard:w">
1563       <xslo:variable name="raw_heading">
1564         <xslo:for-each select="marc:subfield">
1565           <xslo:if test="position() &gt; 1">
1566             <xslo:value-of select="substring(' ', 1, 1)"/>
1567           </xslo:if>
1568           <xslo:value-of select="."/>
1569         </xslo:for-each>
1570       </xslo:variable>
1571       <xslo:value-of select="normalize-space($raw_heading)"/>
1572     </z:index>
1573   </xslo:template>
1574   <xslo:template mode="index_data_field" match="marc:datafield[@tag='030']">
1575     <z:index name="CODEN:w Identifier-standard:w">
1576       <xslo:variable name="raw_heading">
1577         <xslo:for-each select="marc:subfield">
1578           <xslo:if test="position() &gt; 1">
1579             <xslo:value-of select="substring(' ', 1, 1)"/>
1580           </xslo:if>
1581           <xslo:value-of select="."/>
1582         </xslo:for-each>
1583       </xslo:variable>
1584       <xslo:value-of select="normalize-space($raw_heading)"/>
1585     </z:index>
1586   </xslo:template>
1587   <xslo:template mode="index_data_field" match="marc:datafield[@tag='034']">
1588     <z:index name="Map-scale:w">
1589       <xslo:variable name="raw_heading">
1590         <xslo:for-each select="marc:subfield">
1591           <xslo:if test="position() &gt; 1">
1592             <xslo:value-of select="substring(' ', 1, 1)"/>
1593           </xslo:if>
1594           <xslo:value-of select="."/>
1595         </xslo:for-each>
1596       </xslo:variable>
1597       <xslo:value-of select="normalize-space($raw_heading)"/>
1598     </z:index>
1599   </xslo:template>
1600   <xslo:template mode="index_data_field" match="marc:datafield[@tag='035']">
1601     <z:index name="Other-control-number:w">
1602       <xslo:variable name="raw_heading">
1603         <xslo:for-each select="marc:subfield">
1604           <xslo:if test="position() &gt; 1">
1605             <xslo:value-of select="substring(' ', 1, 1)"/>
1606           </xslo:if>
1607           <xslo:value-of select="."/>
1608         </xslo:for-each>
1609       </xslo:variable>
1610       <xslo:value-of select="normalize-space($raw_heading)"/>
1611     </z:index>
1612   </xslo:template>
1613   <xslo:template mode="index_data_field" match="marc:datafield[@tag='037']">
1614     <z:index name="Identifier-standard:w Stock-number:w">
1615       <xslo:variable name="raw_heading">
1616         <xslo:for-each select="marc:subfield">
1617           <xslo:if test="position() &gt; 1">
1618             <xslo:value-of select="substring(' ', 1, 1)"/>
1619           </xslo:if>
1620           <xslo:value-of select="."/>
1621         </xslo:for-each>
1622       </xslo:variable>
1623       <xslo:value-of select="normalize-space($raw_heading)"/>
1624     </z:index>
1625   </xslo:template>
1626   <xslo:template mode="index_data_field" match="marc:datafield[@tag='040']">
1627     <z:index name="Code-institution:w Record-source:w">
1628       <xslo:variable name="raw_heading">
1629         <xslo:for-each select="marc:subfield">
1630           <xslo:if test="position() &gt; 1">
1631             <xslo:value-of select="substring(' ', 1, 1)"/>
1632           </xslo:if>
1633           <xslo:value-of select="."/>
1634         </xslo:for-each>
1635       </xslo:variable>
1636       <xslo:value-of select="normalize-space($raw_heading)"/>
1637     </z:index>
1638   </xslo:template>
1639   <xslo:template mode="index_data_field" match="marc:datafield[@tag='043']">
1640     <z:index name="Code-geographic:w">
1641       <xslo:variable name="raw_heading">
1642         <xslo:for-each select="marc:subfield">
1643           <xslo:if test="position() &gt; 1">
1644             <xslo:value-of select="substring(' ', 1, 1)"/>
1645           </xslo:if>
1646           <xslo:value-of select="."/>
1647         </xslo:for-each>
1648       </xslo:variable>
1649       <xslo:value-of select="normalize-space($raw_heading)"/>
1650     </z:index>
1651   </xslo:template>
1652   <xslo:template mode="index_data_field" match="marc:datafield[@tag='050']">
1653     <z:index name="LC-call-number:w LC-call-number:p LC-call-number:s">
1654       <xslo:variable name="raw_heading">
1655         <xslo:for-each select="marc:subfield">
1656           <xslo:if test="position() &gt; 1">
1657             <xslo:value-of select="substring(' ', 1, 1)"/>
1658           </xslo:if>
1659           <xslo:value-of select="."/>
1660         </xslo:for-each>
1661       </xslo:variable>
1662       <xslo:value-of select="normalize-space($raw_heading)"/>
1663     </z:index>
1664   </xslo:template>
1665   <xslo:template mode="index_data_field" match="marc:datafield[@tag='052']">
1666     <z:index name="Geographic-class:w">
1667       <xslo:variable name="raw_heading">
1668         <xslo:for-each select="marc:subfield">
1669           <xslo:if test="position() &gt; 1">
1670             <xslo:value-of select="substring(' ', 1, 1)"/>
1671           </xslo:if>
1672           <xslo:value-of select="."/>
1673         </xslo:for-each>
1674       </xslo:variable>
1675       <xslo:value-of select="normalize-space($raw_heading)"/>
1676     </z:index>
1677   </xslo:template>
1678   <xslo:template mode="index_data_field" match="marc:datafield[@tag='060']">
1679     <z:index name="NLM-call-number:w">
1680       <xslo:variable name="raw_heading">
1681         <xslo:for-each select="marc:subfield">
1682           <xslo:if test="position() &gt; 1">
1683             <xslo:value-of select="substring(' ', 1, 1)"/>
1684           </xslo:if>
1685           <xslo:value-of select="."/>
1686         </xslo:for-each>
1687       </xslo:variable>
1688       <xslo:value-of select="normalize-space($raw_heading)"/>
1689     </z:index>
1690   </xslo:template>
1691   <xslo:template mode="index_data_field" match="marc:datafield[@tag='070']">
1692     <z:index name="NAL-call-number:w">
1693       <xslo:variable name="raw_heading">
1694         <xslo:for-each select="marc:subfield">
1695           <xslo:if test="position() &gt; 1">
1696             <xslo:value-of select="substring(' ', 1, 1)"/>
1697           </xslo:if>
1698           <xslo:value-of select="."/>
1699         </xslo:for-each>
1700       </xslo:variable>
1701       <xslo:value-of select="normalize-space($raw_heading)"/>
1702     </z:index>
1703   </xslo:template>
1704   <xslo:template mode="index_data_field" match="marc:datafield[@tag='080']">
1705     <z:index name="UDC-classification:w">
1706       <xslo:variable name="raw_heading">
1707         <xslo:for-each select="marc:subfield">
1708           <xslo:if test="position() &gt; 1">
1709             <xslo:value-of select="substring(' ', 1, 1)"/>
1710           </xslo:if>
1711           <xslo:value-of select="."/>
1712         </xslo:for-each>
1713       </xslo:variable>
1714       <xslo:value-of select="normalize-space($raw_heading)"/>
1715     </z:index>
1716   </xslo:template>
1717   <xslo:template mode="index_data_field" match="marc:datafield[@tag='082']">
1718     <z:index name="Dewey-classification:w Dewey-classification:s">
1719       <xslo:variable name="raw_heading">
1720         <xslo:for-each select="marc:subfield">
1721           <xslo:if test="position() &gt; 1">
1722             <xslo:value-of select="substring(' ', 1, 1)"/>
1723           </xslo:if>
1724           <xslo:value-of select="."/>
1725         </xslo:for-each>
1726       </xslo:variable>
1727       <xslo:value-of select="normalize-space($raw_heading)"/>
1728     </z:index>
1729   </xslo:template>
1730   <xslo:template mode="index_data_field" match="marc:datafield[@tag='086']">
1731     <z:index name="Number-govt-pub:w">
1732       <xslo:variable name="raw_heading">
1733         <xslo:for-each select="marc:subfield">
1734           <xslo:if test="position() &gt; 1">
1735             <xslo:value-of select="substring(' ', 1, 1)"/>
1736           </xslo:if>
1737           <xslo:value-of select="."/>
1738         </xslo:for-each>
1739       </xslo:variable>
1740       <xslo:value-of select="normalize-space($raw_heading)"/>
1741     </z:index>
1742   </xslo:template>
1743   <xslo:template mode="index_data_field" match="marc:datafield[@tag='100']">
1744     <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">
1745       <xslo:variable name="raw_heading">
1746         <xslo:for-each select="marc:subfield">
1747           <xslo:if test="position() &gt; 1">
1748             <xslo:value-of select="substring(' ', 1, 1)"/>
1749           </xslo:if>
1750           <xslo:value-of select="."/>
1751         </xslo:for-each>
1752       </xslo:variable>
1753       <xslo:value-of select="normalize-space($raw_heading)"/>
1754     </z:index>
1755   </xslo:template>
1756   <xslo:template mode="index_data_field" match="marc:datafield[@tag='110']">
1757     <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">
1758       <xslo:variable name="raw_heading">
1759         <xslo:for-each select="marc:subfield">
1760           <xslo:if test="position() &gt; 1">
1761             <xslo:value-of select="substring(' ', 1, 1)"/>
1762           </xslo:if>
1763           <xslo:value-of select="."/>
1764         </xslo:for-each>
1765       </xslo:variable>
1766       <xslo:value-of select="normalize-space($raw_heading)"/>
1767     </z:index>
1768   </xslo:template>
1769   <xslo:template mode="index_data_field" match="marc:datafield[@tag='111']">
1770     <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">
1771       <xslo:variable name="raw_heading">
1772         <xslo:for-each select="marc:subfield">
1773           <xslo:if test="position() &gt; 1">
1774             <xslo:value-of select="substring(' ', 1, 1)"/>
1775           </xslo:if>
1776           <xslo:value-of select="."/>
1777         </xslo:for-each>
1778       </xslo:variable>
1779       <xslo:value-of select="normalize-space($raw_heading)"/>
1780     </z:index>
1781   </xslo:template>
1782   <xslo:template mode="index_data_field" match="marc:datafield[@tag='130']">
1783     <z:index name="Title:w Title:p Title-uniform:w">
1784       <xslo:variable name="raw_heading">
1785         <xslo:for-each select="marc:subfield">
1786           <xslo:if test="position() &gt; 1">
1787             <xslo:value-of select="substring(' ', 1, 1)"/>
1788           </xslo:if>
1789           <xslo:value-of select="."/>
1790         </xslo:for-each>
1791       </xslo:variable>
1792       <xslo:value-of select="normalize-space($raw_heading)"/>
1793     </z:index>
1794   </xslo:template>
1795   <xslo:template mode="index_data_field" match="marc:datafield[@tag='210']">
1796     <z:index name="Title:w Title:p Title-abbreviated:w">
1797       <xslo:variable name="raw_heading">
1798         <xslo:for-each select="marc:subfield">
1799           <xslo:if test="position() &gt; 1">
1800             <xslo:value-of select="substring(' ', 1, 1)"/>
1801           </xslo:if>
1802           <xslo:value-of select="."/>
1803         </xslo:for-each>
1804       </xslo:variable>
1805       <xslo:value-of select="normalize-space($raw_heading)"/>
1806     </z:index>
1807   </xslo:template>
1808   <xslo:template mode="index_data_field" match="marc:datafield[@tag='211']">
1809     <z:index name="Title:w Title:p Title-abbreviated:w">
1810       <xslo:variable name="raw_heading">
1811         <xslo:for-each select="marc:subfield">
1812           <xslo:if test="position() &gt; 1">
1813             <xslo:value-of select="substring(' ', 1, 1)"/>
1814           </xslo:if>
1815           <xslo:value-of select="."/>
1816         </xslo:for-each>
1817       </xslo:variable>
1818       <xslo:value-of select="normalize-space($raw_heading)"/>
1819     </z:index>
1820   </xslo:template>
1821   <xslo:template mode="index_data_field" match="marc:datafield[@tag='212']">
1822     <z:index name="Title:w Title:p Title-other-variant:w">
1823       <xslo:variable name="raw_heading">
1824         <xslo:for-each select="marc:subfield">
1825           <xslo:if test="position() &gt; 1">
1826             <xslo:value-of select="substring(' ', 1, 1)"/>
1827           </xslo:if>
1828           <xslo:value-of select="."/>
1829         </xslo:for-each>
1830       </xslo:variable>
1831       <xslo:value-of select="normalize-space($raw_heading)"/>
1832     </z:index>
1833   </xslo:template>
1834   <xslo:template mode="index_data_field" match="marc:datafield[@tag='214']">
1835     <z:index name="Title:w Title:p Title-expanded:w">
1836       <xslo:variable name="raw_heading">
1837         <xslo:for-each select="marc:subfield">
1838           <xslo:if test="position() &gt; 1">
1839             <xslo:value-of select="substring(' ', 1, 1)"/>
1840           </xslo:if>
1841           <xslo:value-of select="."/>
1842         </xslo:for-each>
1843       </xslo:variable>
1844       <xslo:value-of select="normalize-space($raw_heading)"/>
1845     </z:index>
1846   </xslo:template>
1847   <xslo:template mode="index_data_field" match="marc:datafield[@tag='222']">
1848     <z:index name="Title:w Title:p Title-key:w">
1849       <xslo:variable name="raw_heading">
1850         <xslo:for-each select="marc:subfield">
1851           <xslo:if test="position() &gt; 1">
1852             <xslo:value-of select="substring(' ', 1, 1)"/>
1853           </xslo:if>
1854           <xslo:value-of select="."/>
1855         </xslo:for-each>
1856       </xslo:variable>
1857       <xslo:value-of select="normalize-space($raw_heading)"/>
1858     </z:index>
1859   </xslo:template>
1860   <xslo:template mode="index_data_field" match="marc:datafield[@tag='240']">
1861     <z:index name="Title:w Title:p Title-uniform:w">
1862       <xslo:variable name="raw_heading">
1863         <xslo:for-each select="marc:subfield">
1864           <xslo:if test="position() &gt; 1">
1865             <xslo:value-of select="substring(' ', 1, 1)"/>
1866           </xslo:if>
1867           <xslo:value-of select="."/>
1868         </xslo:for-each>
1869       </xslo:variable>
1870       <xslo:value-of select="normalize-space($raw_heading)"/>
1871     </z:index>
1872   </xslo:template>
1873   <xslo:template mode="index_data_field" match="marc:datafield[@tag='243']">
1874     <z:index name="Title:w Title:p Title-collective:w">
1875       <xslo:variable name="raw_heading">
1876         <xslo:for-each select="marc:subfield">
1877           <xslo:if test="position() &gt; 1">
1878             <xslo:value-of select="substring(' ', 1, 1)"/>
1879           </xslo:if>
1880           <xslo:value-of select="."/>
1881         </xslo:for-each>
1882       </xslo:variable>
1883       <xslo:value-of select="normalize-space($raw_heading)"/>
1884     </z:index>
1885   </xslo:template>
1886   <xslo:template mode="index_data_field" match="marc:datafield[@tag='245']">
1887     <z:index name="Title:w Title:p">
1888       <xslo:variable name="raw_heading">
1889         <xslo:for-each select="marc:subfield">
1890           <xslo:if test="position() &gt; 1">
1891             <xslo:value-of select="substring(' ', 1, 1)"/>
1892           </xslo:if>
1893           <xslo:value-of select="."/>
1894         </xslo:for-each>
1895       </xslo:variable>
1896       <xslo:value-of select="normalize-space($raw_heading)"/>
1897     </z:index>
1898   </xslo:template>
1899   <xslo:template mode="index_data_field" match="marc:datafield[@tag='246']">
1900     <z:index name="Title:w Title:p Title-abbreviated:w Title-expanded:w Title-former:w">
1901       <xslo:variable name="raw_heading">
1902         <xslo:for-each select="marc:subfield">
1903           <xslo:if test="position() &gt; 1">
1904             <xslo:value-of select="substring(' ', 1, 1)"/>
1905           </xslo:if>
1906           <xslo:value-of select="."/>
1907         </xslo:for-each>
1908       </xslo:variable>
1909       <xslo:value-of select="normalize-space($raw_heading)"/>
1910     </z:index>
1911   </xslo:template>
1912   <xslo:template mode="index_data_field" match="marc:datafield[@tag='247']">
1913     <z:index name="Title:w Title:p Title-former:w Title-other-variant:w Related-periodical:w">
1914       <xslo:variable name="raw_heading">
1915         <xslo:for-each select="marc:subfield">
1916           <xslo:if test="position() &gt; 1">
1917             <xslo:value-of select="substring(' ', 1, 1)"/>
1918           </xslo:if>
1919           <xslo:value-of select="."/>
1920         </xslo:for-each>
1921       </xslo:variable>
1922       <xslo:value-of select="normalize-space($raw_heading)"/>
1923     </z:index>
1924   </xslo:template>
1925   <xslo:template mode="index_data_field" match="marc:datafield[@tag='260']">
1926     <z:index name="pl:w Provider:w">
1927       <xslo:variable name="raw_heading">
1928         <xslo:for-each select="marc:subfield">
1929           <xslo:if test="position() &gt; 1">
1930             <xslo:value-of select="substring(' ', 1, 1)"/>
1931           </xslo:if>
1932           <xslo:value-of select="."/>
1933         </xslo:for-each>
1934       </xslo:variable>
1935       <xslo:value-of select="normalize-space($raw_heading)"/>
1936     </z:index>
1937   </xslo:template>
1938   <xslo:template mode="index_data_field" match="marc:datafield[@tag='264']">
1939     <z:index name="Provider:w">
1940       <xslo:variable name="raw_heading">
1941         <xslo:for-each select="marc:subfield">
1942           <xslo:if test="position() &gt; 1">
1943             <xslo:value-of select="substring(' ', 1, 1)"/>
1944           </xslo:if>
1945           <xslo:value-of select="."/>
1946         </xslo:for-each>
1947       </xslo:variable>
1948       <xslo:value-of select="normalize-space($raw_heading)"/>
1949     </z:index>
1950   </xslo:template>
1951   <xslo:template mode="index_data_field" match="marc:datafield[@tag='300']">
1952     <z:index name="Extent:w Extent:p">
1953       <xslo:variable name="raw_heading">
1954         <xslo:for-each select="marc:subfield">
1955           <xslo:if test="position() &gt; 1">
1956             <xslo:value-of select="substring(' ', 1, 1)"/>
1957           </xslo:if>
1958           <xslo:value-of select="."/>
1959         </xslo:for-each>
1960       </xslo:variable>
1961       <xslo:value-of select="normalize-space($raw_heading)"/>
1962     </z:index>
1963   </xslo:template>
1964   <xslo:template mode="index_data_field" match="marc:datafield[@tag='400']">
1965     <z:index name="Author:w Author-name-personal:w Name:w Personal-name:w">
1966       <xslo:variable name="raw_heading">
1967         <xslo:for-each select="marc:subfield">
1968           <xslo:if test="position() &gt; 1">
1969             <xslo:value-of select="substring(' ', 1, 1)"/>
1970           </xslo:if>
1971           <xslo:value-of select="."/>
1972         </xslo:for-each>
1973       </xslo:variable>
1974       <xslo:value-of select="normalize-space($raw_heading)"/>
1975     </z:index>
1976   </xslo:template>
1977   <xslo:template mode="index_data_field" match="marc:datafield[@tag='410']">
1978     <z:index name="Author:w Corporate-name:w">
1979       <xslo:variable name="raw_heading">
1980         <xslo:for-each select="marc:subfield">
1981           <xslo:if test="position() &gt; 1">
1982             <xslo:value-of select="substring(' ', 1, 1)"/>
1983           </xslo:if>
1984           <xslo:value-of select="."/>
1985         </xslo:for-each>
1986       </xslo:variable>
1987       <xslo:value-of select="normalize-space($raw_heading)"/>
1988     </z:index>
1989   </xslo:template>
1990   <xslo:template mode="index_data_field" match="marc:datafield[@tag='411']">
1991     <z:index name="Author:w Conference-name:w">
1992       <xslo:variable name="raw_heading">
1993         <xslo:for-each select="marc:subfield">
1994           <xslo:if test="position() &gt; 1">
1995             <xslo:value-of select="substring(' ', 1, 1)"/>
1996           </xslo:if>
1997           <xslo:value-of select="."/>
1998         </xslo:for-each>
1999       </xslo:variable>
2000       <xslo:value-of select="normalize-space($raw_heading)"/>
2001     </z:index>
2002   </xslo:template>
2003   <xslo:template mode="index_data_field" match="marc:datafield[@tag='440']">
2004     <z:index name="Title-series:w Title-series:p Title:w Title-series:w">
2005       <xslo:variable name="raw_heading">
2006         <xslo:for-each select="marc:subfield">
2007           <xslo:if test="position() &gt; 1">
2008             <xslo:value-of select="substring(' ', 1, 1)"/>
2009           </xslo:if>
2010           <xslo:value-of select="."/>
2011         </xslo:for-each>
2012       </xslo:variable>
2013       <xslo:value-of select="normalize-space($raw_heading)"/>
2014     </z:index>
2015   </xslo:template>
2016   <xslo:template mode="index_data_field" match="marc:datafield[@tag='490']">
2017     <z:index name="Title:w Title-series:w">
2018       <xslo:variable name="raw_heading">
2019         <xslo:for-each select="marc:subfield">
2020           <xslo:if test="position() &gt; 1">
2021             <xslo:value-of select="substring(' ', 1, 1)"/>
2022           </xslo:if>
2023           <xslo:value-of select="."/>
2024         </xslo:for-each>
2025       </xslo:variable>
2026       <xslo:value-of select="normalize-space($raw_heading)"/>
2027     </z:index>
2028   </xslo:template>
2029   <xslo:template mode="index_data_field" match="marc:datafield[@tag='500']">
2030     <z:index name="Note:w Note:p">
2031       <xslo:variable name="raw_heading">
2032         <xslo:for-each select="marc:subfield">
2033           <xslo:if test="position() &gt; 1">
2034             <xslo:value-of select="substring(' ', 1, 1)"/>
2035           </xslo:if>
2036           <xslo:value-of select="."/>
2037         </xslo:for-each>
2038       </xslo:variable>
2039       <xslo:value-of select="normalize-space($raw_heading)"/>
2040     </z:index>
2041   </xslo:template>
2042   <xslo:template mode="index_data_field" match="marc:datafield[@tag='502']">
2043     <z:index name="Material-type:w Dissertation-information:p Dissertation-information:w">
2044       <xslo:variable name="raw_heading">
2045         <xslo:for-each select="marc:subfield">
2046           <xslo:if test="position() &gt; 1">
2047             <xslo:value-of select="substring(' ', 1, 1)"/>
2048           </xslo:if>
2049           <xslo:value-of select="."/>
2050         </xslo:for-each>
2051       </xslo:variable>
2052       <xslo:value-of select="normalize-space($raw_heading)"/>
2053     </z:index>
2054   </xslo:template>
2055   <xslo:template mode="index_data_field" match="marc:datafield[@tag='505']">
2056     <z:index name="Note:w Note:p">
2057       <xslo:variable name="raw_heading">
2058         <xslo:for-each select="marc:subfield">
2059           <xslo:if test="position() &gt; 1">
2060             <xslo:value-of select="substring(' ', 1, 1)"/>
2061           </xslo:if>
2062           <xslo:value-of select="."/>
2063         </xslo:for-each>
2064       </xslo:variable>
2065       <xslo:value-of select="normalize-space($raw_heading)"/>
2066     </z:index>
2067   </xslo:template>
2068   <xslo:template mode="index_data_field" match="marc:datafield[@tag='510']">
2069     <z:index name="Indexed-by:w">
2070       <xslo:variable name="raw_heading">
2071         <xslo:for-each select="marc:subfield">
2072           <xslo:if test="position() &gt; 1">
2073             <xslo:value-of select="substring(' ', 1, 1)"/>
2074           </xslo:if>
2075           <xslo:value-of select="."/>
2076         </xslo:for-each>
2077       </xslo:variable>
2078       <xslo:value-of select="normalize-space($raw_heading)"/>
2079     </z:index>
2080   </xslo:template>
2081   <xslo:template mode="index_data_field" match="marc:datafield[@tag='520']">
2082     <z:index name="Abstract:w Abstract:p">
2083       <xslo:variable name="raw_heading">
2084         <xslo:for-each select="marc:subfield">
2085           <xslo:if test="position() &gt; 1">
2086             <xslo:value-of select="substring(' ', 1, 1)"/>
2087           </xslo:if>
2088           <xslo:value-of select="."/>
2089         </xslo:for-each>
2090       </xslo:variable>
2091       <xslo:value-of select="normalize-space($raw_heading)"/>
2092     </z:index>
2093   </xslo:template>
2094   <xslo:template mode="index_data_field" match="marc:datafield[@tag='590']">
2095     <z:index name="Note:w Note:p">
2096       <xslo:variable name="raw_heading">
2097         <xslo:for-each select="marc:subfield">
2098           <xslo:if test="position() &gt; 1">
2099             <xslo:value-of select="substring(' ', 1, 1)"/>
2100           </xslo:if>
2101           <xslo:value-of select="."/>
2102         </xslo:for-each>
2103       </xslo:variable>
2104       <xslo:value-of select="normalize-space($raw_heading)"/>
2105     </z:index>
2106   </xslo:template>
2107   <xslo:template mode="index_data_field" match="marc:datafield[@tag='600']">
2108     <z:index name="Name:w Personal-name:w Subject-name-personal:w Subject:w Subject:p">
2109       <xslo:variable name="raw_heading">
2110         <xslo:for-each select="marc:subfield">
2111           <xslo:if test="position() &gt; 1">
2112             <xslo:value-of select="substring(' ', 1, 1)"/>
2113           </xslo:if>
2114           <xslo:value-of select="."/>
2115         </xslo:for-each>
2116       </xslo:variable>
2117       <xslo:value-of select="normalize-space($raw_heading)"/>
2118     </z:index>
2119   </xslo:template>
2120   <xslo:template mode="index_data_field" match="marc:datafield[@tag='610']">
2121     <z:index name="Name:w Subject:w Subject:p Corporate-name:w">
2122       <xslo:variable name="raw_heading">
2123         <xslo:for-each select="marc:subfield">
2124           <xslo:if test="position() &gt; 1">
2125             <xslo:value-of select="substring(' ', 1, 1)"/>
2126           </xslo:if>
2127           <xslo:value-of select="."/>
2128         </xslo:for-each>
2129       </xslo:variable>
2130       <xslo:value-of select="normalize-space($raw_heading)"/>
2131     </z:index>
2132   </xslo:template>
2133   <xslo:template mode="index_data_field" match="marc:datafield[@tag='611']">
2134     <z:index name="Conference-name:w Name:w Subject:w Subject:p">
2135       <xslo:variable name="raw_heading">
2136         <xslo:for-each select="marc:subfield">
2137           <xslo:if test="position() &gt; 1">
2138             <xslo:value-of select="substring(' ', 1, 1)"/>
2139           </xslo:if>
2140           <xslo:value-of select="."/>
2141         </xslo:for-each>
2142       </xslo:variable>
2143       <xslo:value-of select="normalize-space($raw_heading)"/>
2144     </z:index>
2145   </xslo:template>
2146   <xslo:template mode="index_data_field" match="marc:datafield[@tag='630']">
2147     <z:index name="Subject:w Subject:p">
2148       <xslo:variable name="raw_heading">
2149         <xslo:for-each select="marc:subfield">
2150           <xslo:if test="position() &gt; 1">
2151             <xslo:value-of select="substring(' ', 1, 1)"/>
2152           </xslo:if>
2153           <xslo:value-of select="."/>
2154         </xslo:for-each>
2155       </xslo:variable>
2156       <xslo:value-of select="normalize-space($raw_heading)"/>
2157     </z:index>
2158   </xslo:template>
2159   <xslo:template mode="index_data_field" match="marc:datafield[@tag='650']">
2160     <z:index name="Subject:w Subject:p">
2161       <xslo:variable name="raw_heading">
2162         <xslo:for-each select="marc:subfield">
2163           <xslo:if test="position() &gt; 1">
2164             <xslo:value-of select="substring(' ', 1, 1)"/>
2165           </xslo:if>
2166           <xslo:value-of select="."/>
2167         </xslo:for-each>
2168       </xslo:variable>
2169       <xslo:value-of select="normalize-space($raw_heading)"/>
2170     </z:index>
2171   </xslo:template>
2172   <xslo:template mode="index_data_field" match="marc:datafield[@tag='651']">
2173     <z:index name="Name-geographic:w Subject:w Subject:p">
2174       <xslo:variable name="raw_heading">
2175         <xslo:for-each select="marc:subfield">
2176           <xslo:if test="position() &gt; 1">
2177             <xslo:value-of select="substring(' ', 1, 1)"/>
2178           </xslo:if>
2179           <xslo:value-of select="."/>
2180         </xslo:for-each>
2181       </xslo:variable>
2182       <xslo:value-of select="normalize-space($raw_heading)"/>
2183     </z:index>
2184   </xslo:template>
2185   <xslo:template mode="index_data_field" match="marc:datafield[@tag='653']">
2186     <z:index name="Subject:w Subject:p">
2187       <xslo:variable name="raw_heading">
2188         <xslo:for-each select="marc:subfield">
2189           <xslo:if test="position() &gt; 1">
2190             <xslo:value-of select="substring(' ', 1, 1)"/>
2191           </xslo:if>
2192           <xslo:value-of select="."/>
2193         </xslo:for-each>
2194       </xslo:variable>
2195       <xslo:value-of select="normalize-space($raw_heading)"/>
2196     </z:index>
2197   </xslo:template>
2198   <xslo:template mode="index_data_field" match="marc:datafield[@tag='654']">
2199     <z:index name="Subject:w Subject:p">
2200       <xslo:variable name="raw_heading">
2201         <xslo:for-each select="marc:subfield">
2202           <xslo:if test="position() &gt; 1">
2203             <xslo:value-of select="substring(' ', 1, 1)"/>
2204           </xslo:if>
2205           <xslo:value-of select="."/>
2206         </xslo:for-each>
2207       </xslo:variable>
2208       <xslo:value-of select="normalize-space($raw_heading)"/>
2209     </z:index>
2210   </xslo:template>
2211   <xslo:template mode="index_data_field" match="marc:datafield[@tag='655']">
2212     <z:index name="Subject:w Subject:p">
2213       <xslo:variable name="raw_heading">
2214         <xslo:for-each select="marc:subfield">
2215           <xslo:if test="position() &gt; 1">
2216             <xslo:value-of select="substring(' ', 1, 1)"/>
2217           </xslo:if>
2218           <xslo:value-of select="."/>
2219         </xslo:for-each>
2220       </xslo:variable>
2221       <xslo:value-of select="normalize-space($raw_heading)"/>
2222     </z:index>
2223   </xslo:template>
2224   <xslo:template mode="index_data_field" match="marc:datafield[@tag='656']">
2225     <z:index name="Subject:w Subject:p">
2226       <xslo:variable name="raw_heading">
2227         <xslo:for-each select="marc:subfield">
2228           <xslo:if test="position() &gt; 1">
2229             <xslo:value-of select="substring(' ', 1, 1)"/>
2230           </xslo:if>
2231           <xslo:value-of select="."/>
2232         </xslo:for-each>
2233       </xslo:variable>
2234       <xslo:value-of select="normalize-space($raw_heading)"/>
2235     </z:index>
2236   </xslo:template>
2237   <xslo:template mode="index_data_field" match="marc:datafield[@tag='657']">
2238     <z:index name="Subject:w Subject:p">
2239       <xslo:variable name="raw_heading">
2240         <xslo:for-each select="marc:subfield">
2241           <xslo:if test="position() &gt; 1">
2242             <xslo:value-of select="substring(' ', 1, 1)"/>
2243           </xslo:if>
2244           <xslo:value-of select="."/>
2245         </xslo:for-each>
2246       </xslo:variable>
2247       <xslo:value-of select="normalize-space($raw_heading)"/>
2248     </z:index>
2249   </xslo:template>
2250   <xslo:template mode="index_data_field" match="marc:datafield[@tag='658']">
2251     <z:index name="Subject:w Subject:p">
2252       <xslo:variable name="raw_heading">
2253         <xslo:for-each select="marc:subfield">
2254           <xslo:if test="position() &gt; 1">
2255             <xslo:value-of select="substring(' ', 1, 1)"/>
2256           </xslo:if>
2257           <xslo:value-of select="."/>
2258         </xslo:for-each>
2259       </xslo:variable>
2260       <xslo:value-of select="normalize-space($raw_heading)"/>
2261     </z:index>
2262   </xslo:template>
2263   <xslo:template mode="index_data_field" match="marc:datafield[@tag='690']">
2264     <z:index name="Subject:w Subject:p">
2265       <xslo:variable name="raw_heading">
2266         <xslo:for-each select="marc:subfield">
2267           <xslo:if test="position() &gt; 1">
2268             <xslo:value-of select="substring(' ', 1, 1)"/>
2269           </xslo:if>
2270           <xslo:value-of select="."/>
2271         </xslo:for-each>
2272       </xslo:variable>
2273       <xslo:value-of select="normalize-space($raw_heading)"/>
2274     </z:index>
2275   </xslo:template>
2276   <xslo:template mode="index_data_field" match="marc:datafield[@tag='700']">
2277     <z:index name="Author:w Author:p Author-name-personal:w Name:w Editor:w Personal-name:w">
2278       <xslo:variable name="raw_heading">
2279         <xslo:for-each select="marc:subfield">
2280           <xslo:if test="position() &gt; 1">
2281             <xslo:value-of select="substring(' ', 1, 1)"/>
2282           </xslo:if>
2283           <xslo:value-of select="."/>
2284         </xslo:for-each>
2285       </xslo:variable>
2286       <xslo:value-of select="normalize-space($raw_heading)"/>
2287     </z:index>
2288   </xslo:template>
2289   <xslo:template mode="index_data_field" match="marc:datafield[@tag='710']">
2290     <z:index name="Author:w Author:p Corporate-name:w Name:w">
2291       <xslo:variable name="raw_heading">
2292         <xslo:for-each select="marc:subfield">
2293           <xslo:if test="position() &gt; 1">
2294             <xslo:value-of select="substring(' ', 1, 1)"/>
2295           </xslo:if>
2296           <xslo:value-of select="."/>
2297         </xslo:for-each>
2298       </xslo:variable>
2299       <xslo:value-of select="normalize-space($raw_heading)"/>
2300     </z:index>
2301   </xslo:template>
2302   <xslo:template mode="index_data_field" match="marc:datafield[@tag='711']">
2303     <z:index name="Author:w Author:p Author-name-corporate:w Name:w Conference-name:w">
2304       <xslo:variable name="raw_heading">
2305         <xslo:for-each select="marc:subfield">
2306           <xslo:if test="position() &gt; 1">
2307             <xslo:value-of select="substring(' ', 1, 1)"/>
2308           </xslo:if>
2309           <xslo:value-of select="."/>
2310         </xslo:for-each>
2311       </xslo:variable>
2312       <xslo:value-of select="normalize-space($raw_heading)"/>
2313     </z:index>
2314   </xslo:template>
2315   <xslo:template mode="index_data_field" match="marc:datafield[@tag='730']">
2316     <z:index name="Title:w Title:p Title-uniform:w">
2317       <xslo:variable name="raw_heading">
2318         <xslo:for-each select="marc:subfield">
2319           <xslo:if test="position() &gt; 1">
2320             <xslo:value-of select="substring(' ', 1, 1)"/>
2321           </xslo:if>
2322           <xslo:value-of select="."/>
2323         </xslo:for-each>
2324       </xslo:variable>
2325       <xslo:value-of select="normalize-space($raw_heading)"/>
2326     </z:index>
2327   </xslo:template>
2328   <xslo:template mode="index_data_field" match="marc:datafield[@tag='740']">
2329     <z:index name="Title:w Title:p Title-other-variant:w">
2330       <xslo:variable name="raw_heading">
2331         <xslo:for-each select="marc:subfield">
2332           <xslo:if test="position() &gt; 1">
2333             <xslo:value-of select="substring(' ', 1, 1)"/>
2334           </xslo:if>
2335           <xslo:value-of select="."/>
2336         </xslo:for-each>
2337       </xslo:variable>
2338       <xslo:value-of select="normalize-space($raw_heading)"/>
2339     </z:index>
2340   </xslo:template>
2341   <xslo:template mode="index_data_field" match="marc:datafield[@tag='751']">
2342     <z:index name="Name-geographic:w">
2343       <xslo:variable name="raw_heading">
2344         <xslo:for-each select="marc:subfield">
2345           <xslo:if test="position() &gt; 1">
2346             <xslo:value-of select="substring(' ', 1, 1)"/>
2347           </xslo:if>
2348           <xslo:value-of select="."/>
2349         </xslo:for-each>
2350       </xslo:variable>
2351       <xslo:value-of select="normalize-space($raw_heading)"/>
2352     </z:index>
2353   </xslo:template>
2354   <xslo:template mode="index_data_field" match="marc:datafield[@tag='780']">
2355     <z:index name="Title:w Title:p Title-former:w Related-periodical:w">
2356       <xslo:variable name="raw_heading">
2357         <xslo:for-each select="marc:subfield">
2358           <xslo:if test="position() &gt; 1">
2359             <xslo:value-of select="substring(' ', 1, 1)"/>
2360           </xslo:if>
2361           <xslo:value-of select="."/>
2362         </xslo:for-each>
2363       </xslo:variable>
2364       <xslo:value-of select="normalize-space($raw_heading)"/>
2365     </z:index>
2366   </xslo:template>
2367   <xslo:template mode="index_data_field" match="marc:datafield[@tag='785']">
2368     <z:index name="Title:w Title:p Title-later:w Related-periodical:w">
2369       <xslo:variable name="raw_heading">
2370         <xslo:for-each select="marc:subfield">
2371           <xslo:if test="position() &gt; 1">
2372             <xslo:value-of select="substring(' ', 1, 1)"/>
2373           </xslo:if>
2374           <xslo:value-of select="."/>
2375         </xslo:for-each>
2376       </xslo:variable>
2377       <xslo:value-of select="normalize-space($raw_heading)"/>
2378     </z:index>
2379   </xslo:template>
2380   <xslo:template mode="index_data_field" match="marc:datafield[@tag='800']">
2381     <z:index name="Author:w Author-name-personal:w Name:w Personal-name:w">
2382       <xslo:variable name="raw_heading">
2383         <xslo:for-each select="marc:subfield">
2384           <xslo:if test="position() &gt; 1">
2385             <xslo:value-of select="substring(' ', 1, 1)"/>
2386           </xslo:if>
2387           <xslo:value-of select="."/>
2388         </xslo:for-each>
2389       </xslo:variable>
2390       <xslo:value-of select="normalize-space($raw_heading)"/>
2391     </z:index>
2392   </xslo:template>
2393   <xslo:template mode="index_data_field" match="marc:datafield[@tag='810']">
2394     <z:index name="Author:w Corporate-name:w Author-name-corporate:w Name:w">
2395       <xslo:variable name="raw_heading">
2396         <xslo:for-each select="marc:subfield">
2397           <xslo:if test="position() &gt; 1">
2398             <xslo:value-of select="substring(' ', 1, 1)"/>
2399           </xslo:if>
2400           <xslo:value-of select="."/>
2401         </xslo:for-each>
2402       </xslo:variable>
2403       <xslo:value-of select="normalize-space($raw_heading)"/>
2404     </z:index>
2405   </xslo:template>
2406   <xslo:template mode="index_data_field" match="marc:datafield[@tag='811']">
2407     <z:index name="Author:w Author-name-corporate:w Name:w Conference-name:w">
2408       <xslo:variable name="raw_heading">
2409         <xslo:for-each select="marc:subfield">
2410           <xslo:if test="position() &gt; 1">
2411             <xslo:value-of select="substring(' ', 1, 1)"/>
2412           </xslo:if>
2413           <xslo:value-of select="."/>
2414         </xslo:for-each>
2415       </xslo:variable>
2416       <xslo:value-of select="normalize-space($raw_heading)"/>
2417     </z:index>
2418   </xslo:template>
2419   <xslo:template mode="index_data_field" match="marc:datafield[@tag='830']">
2420     <z:index name="Title:w Title-series:w Title-series:p">
2421       <xslo:variable name="raw_heading">
2422         <xslo:for-each select="marc:subfield">
2423           <xslo:if test="position() &gt; 1">
2424             <xslo:value-of select="substring(' ', 1, 1)"/>
2425           </xslo:if>
2426           <xslo:value-of select="."/>
2427         </xslo:for-each>
2428       </xslo:variable>
2429       <xslo:value-of select="normalize-space($raw_heading)"/>
2430     </z:index>
2431   </xslo:template>
2432   <xslo:template mode="index_data_field" match="marc:datafield[@tag='840']">
2433     <z:index name="Title:w Title-series:w Title-series:p">
2434       <xslo:variable name="raw_heading">
2435         <xslo:for-each select="marc:subfield">
2436           <xslo:if test="position() &gt; 1">
2437             <xslo:value-of select="substring(' ', 1, 1)"/>
2438           </xslo:if>
2439           <xslo:value-of select="."/>
2440         </xslo:for-each>
2441       </xslo:variable>
2442       <xslo:value-of select="normalize-space($raw_heading)"/>
2443     </z:index>
2444   </xslo:template>
2445   <xslo:template mode="index_facets" match="marc:datafield[@tag='100']">
2446     <xslo:if test="not(@ind1='z')">
2447       <z:index name="au:0">
2448         <xslo:value-of select="marc:subfield[@code='a']"/>
2449       </z:index>
2450     </xslo:if>
2451   </xslo:template>
2452   <xslo:template mode="index_facets" match="marc:datafield[@tag='110']">
2453     <xslo:if test="not(@ind1='z')">
2454       <z:index name="au:0">
2455         <xslo:value-of select="marc:subfield[@code='a']"/>
2456       </z:index>
2457     </xslo:if>
2458   </xslo:template>
2459   <xslo:template mode="index_facets" match="marc:datafield[@tag='440']">
2460     <xslo:if test="not(@ind1='z')">
2461       <z:index name="se:0">
2462         <xslo:value-of select="marc:subfield[@code='a']"/>
2463       </z:index>
2464     </xslo:if>
2465   </xslo:template>
2466   <xslo:template mode="index_facets" match="marc:datafield[@tag='490']">
2467     <xslo:if test="not(@ind1='z')">
2468       <z:index name="se:0">
2469         <xslo:value-of select="marc:subfield[@code='a']"/>
2470       </z:index>
2471     </xslo:if>
2472   </xslo:template>
2473   <xslo:template mode="index_facets" match="marc:datafield[@tag='630']">
2474     <xslo:if test="not(@ind1='z')">
2475       <z:index name="su-ut:0">
2476         <xslo:value-of select="marc:subfield[@code='a']"/>
2477       </z:index>
2478     </xslo:if>
2479   </xslo:template>
2480   <xslo:template mode="index_facets" match="marc:datafield[@tag='650']">
2481     <xslo:if test="not(@ind1='z')">
2482       <z:index name="su-to:0">
2483         <xslo:value-of select="marc:subfield[@code='a']"/>
2484       </z:index>
2485     </xslo:if>
2486   </xslo:template>
2487   <xslo:template mode="index_facets" match="marc:datafield[@tag='651']">
2488     <xslo:if test="not(@ind1='z')">
2489       <z:index name="su-geo:0">
2490         <xslo:value-of select="marc:subfield[@code='a']"/>
2491       </z:index>
2492     </xslo:if>
2493   </xslo:template>
2494   <xslo:template mode="index_facets" match="marc:datafield[@tag='700']">
2495     <xslo:if test="not(@ind1='z')">
2496       <z:index name="au:0">
2497         <xslo:value-of select="marc:subfield[@code='a']"/>
2498       </z:index>
2499     </xslo:if>
2500   </xslo:template>
2501   <xslo:template mode="index_facets" match="marc:datafield[@tag='942']">
2502     <xslo:if test="not(@ind1='z')">
2503       <z:index name="itype:0">
2504         <xslo:value-of select="marc:subfield[@code='c']"/>
2505       </z:index>
2506     </xslo:if>
2507   </xslo:template>
2508   <xslo:template mode="index_facets" match="marc:datafield[@tag='952']">
2509     <xslo:if test="not(@ind1='z')">
2510       <z:index name="homebranch:0">
2511         <xslo:value-of select="marc:subfield[@code='a']"/>
2512       </z:index>
2513       <z:index name="holdingbranch:0">
2514         <xslo:value-of select="marc:subfield[@code='b']"/>
2515       </z:index>
2516       <z:index name="location:0">
2517         <xslo:value-of select="marc:subfield[@code='c']"/>
2518       </z:index>
2519       <z:index name="itype:0">
2520         <xslo:value-of select="marc:subfield[@code='y']"/>
2521       </z:index>
2522     </xslo:if>
2523   </xslo:template>
2524   <xslo:template mode="index_all" match="text()">
2525     <z:index name="Any:w Any:p">
2526       <xslo:value-of select="."/>
2527     </z:index>
2528   </xslo:template>
2529   <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
2530     <xslo:variable name="chop">
2531       <xslo:choose>
2532         <xslo:when test="not(number(@ind2))">0</xslo:when>
2533         <xslo:otherwise>
2534           <xslo:value-of select="number(@ind2)"/>
2535         </xslo:otherwise>
2536       </xslo:choose>
2537     </xslo:variable>
2538     <z:index name="Title:s">
2539       <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
2540     </z:index>
2541   </xslo:template>
2542   <xslo:template name="chopPunctuation">
2543     <xslo:param name="chopString"/>
2544     <xslo:variable name="length" select="string-length($chopString)"/>
2545     <xslo:choose>
2546       <xslo:when test="$length=0"/>
2547       <xslo:when test="contains('-,.:=;!%/', substring($chopString,$length,1))">
2548         <xslo:call-template name="chopPunctuation">
2549           <xslo:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
2550         </xslo:call-template>
2551       </xslo:when>
2552       <xslo:when test="not($chopString)"/>
2553       <xslo:otherwise>
2554         <xslo:value-of select="$chopString"/>
2555       </xslo:otherwise>
2556     </xslo:choose>
2557     <xslo:text/>
2558   </xslo:template>
2559 </xslo:stylesheet>