Bug 14453: (followup) Fix shipped XSLT files
[koha.git] / etc / zebradb / marc_defs / unimarc / authorities / authority-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="/">
21     <xslo:if test="marc:collection">
22       <collection>
23         <xslo:apply-templates select="marc:collection/marc:record"/>
24       </collection>
25     </xslo:if>
26     <xslo:if test="marc:record">
27       <xslo:apply-templates select="marc:record"/>
28     </xslo:if>
29   </xslo:template>
30   <xslo:template match="marc:record">
31     <xslo:variable name="idfield" select="normalize-space(marc:controlfield[@tag='001'])"/>
32     <z:record type="update">
33       <xslo:attribute name="z:id">
34         <xslo:value-of select="$idfield"/>
35       </xslo:attribute>
36       <xslo:apply-templates/>
37       <xslo:apply-templates mode="index_subfields"/>
38       <xslo:apply-templates mode="index_data_field"/>
39       <xslo:apply-templates mode="index_facets"/>
40       <xslo:apply-templates mode="index_heading"/>
41       <xslo:apply-templates mode="index_heading_conditional"/>
42       <xslo:apply-templates mode="index_match_heading"/>
43       <xslo:apply-templates mode="index_subject_thesaurus"/>
44       <xslo:apply-templates mode="index_all"/>
45     </z:record>
46   </xslo:template>
47   <xslo:template match="marc:controlfield[@tag='001']">
48     <z:index name="Local-Number:w Local-Number:s Local-Number:n">
49       <xslo:value-of select="."/>
50     </z:index>
51   </xslo:template>
52   <xslo:template mode="index_subfields" match="marc:datafield[@tag='200']">
53     <xslo:for-each select="marc:subfield">
54       <xslo:if test="contains('abcdfgjxyz', @code)">
55         <z:index name="Personal-name:w Personal-name:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
56           <xslo:value-of select="."/>
57         </z:index>
58       </xslo:if>
59     </xslo:for-each>
60     <xslo:for-each select="marc:subfield">
61       <xslo:if test="contains('a', @code)">
62         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Personal-name-heading:w Personal-name-heading:p Personal-name-heading:s">
63           <xslo:value-of select="."/>
64         </z:index>
65       </xslo:if>
66     </xslo:for-each>
67   </xslo:template>
68   <xslo:template mode="index_subfields" match="marc:datafield[@tag='400']">
69     <xslo:for-each select="marc:subfield">
70       <xslo:if test="contains('abcdfgjxyz', @code)">
71         <z:index name="Personal-name-see:w Personal-name-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
72           <xslo:value-of select="."/>
73         </z:index>
74       </xslo:if>
75     </xslo:for-each>
76   </xslo:template>
77   <xslo:template mode="index_subfields" match="marc:datafield[@tag='500']">
78     <xslo:for-each select="marc:subfield">
79       <xslo:if test="contains('abcdfgjxyz', @code)">
80         <z:index name="Personal-name-see-also:w Personal-name-see-also:p See-also:w See-also:p Match:w Match:p">
81           <xslo:value-of select="."/>
82         </z:index>
83       </xslo:if>
84     </xslo:for-each>
85   </xslo:template>
86   <xslo:template mode="index_subfields" match="marc:datafield[@tag='700']">
87     <xslo:for-each select="marc:subfield">
88       <xslo:if test="contains('a', @code)">
89         <z:index name="Personal-name-parallel:w Personal-name-parallel:s Parallel:w Parallel:p Match:w Match:p">
90           <xslo:value-of select="."/>
91         </z:index>
92       </xslo:if>
93     </xslo:for-each>
94   </xslo:template>
95   <xslo:template mode="index_subfields" match="marc:datafield[@tag='210']">
96     <xslo:for-each select="marc:subfield">
97       <xslo:if test="contains('abcdefgjxyz', @code)">
98         <z:index name="Corporate-name:w Corporate-name:p Conference-name:w Conference-name:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
99           <xslo:value-of select="."/>
100         </z:index>
101       </xslo:if>
102     </xslo:for-each>
103     <xslo:for-each select="marc:subfield">
104       <xslo:if test="contains('a', @code)">
105         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Corporate-name-heading:w Corporate-name-heading:p Corporate-name-heading:s Conference-name-heading:w Conference-name-heading:p Conference-name-heading:s">
106           <xslo:value-of select="."/>
107         </z:index>
108       </xslo:if>
109     </xslo:for-each>
110   </xslo:template>
111   <xslo:template mode="index_subfields" match="marc:datafield[@tag='410']">
112     <xslo:for-each select="marc:subfield">
113       <xslo:if test="contains('abcdefgjxyz', @code)">
114         <z:index name="Corporate-name-see:w Corporate-name-see:p Conference-name-see:w Conference-name-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
115           <xslo:value-of select="."/>
116         </z:index>
117       </xslo:if>
118     </xslo:for-each>
119   </xslo:template>
120   <xslo:template mode="index_subfields" match="marc:datafield[@tag='510']">
121     <xslo:for-each select="marc:subfield">
122       <xslo:if test="contains('abcdefgjxyz', @code)">
123         <z:index name="Corporate-name-see-also:w Corporate-name-see-also:p Conference-name-see-also:w Conference-name-see-also:p See-also:w See-also:p Match:w Match:p">
124           <xslo:value-of select="."/>
125         </z:index>
126       </xslo:if>
127     </xslo:for-each>
128   </xslo:template>
129   <xslo:template mode="index_subfields" match="marc:datafield[@tag='710']">
130     <xslo:for-each select="marc:subfield">
131       <xslo:if test="contains('abcdefgjxyz', @code)">
132         <z:index name="Corporate-name-parallel:w Corporate-name-parallel:s Conference-name-parallel:w Conference-name-parallel:s Parallel:w Parallel:p Match:w Match:p">
133           <xslo:value-of select="."/>
134         </z:index>
135       </xslo:if>
136     </xslo:for-each>
137   </xslo:template>
138   <xslo:template mode="index_subfields" match="marc:datafield[@tag='215']">
139     <xslo:for-each select="marc:subfield">
140       <xslo:if test="contains('ajxyz', @code)">
141         <z:index name="Name-geographic:w Name-geographic:p Name-geographic:s Term-geographic:w Term-geographic:p Term-geographic:s Heading:w Heading:p Heading:s Match:w Match:p Match-heading:w Match-heading:p">
142           <xslo:value-of select="."/>
143         </z:index>
144       </xslo:if>
145     </xslo:for-each>
146     <xslo:for-each select="marc:subfield">
147       <xslo:if test="contains('a', @code)">
148         <z:index name="Heading-Main:w Heading-Main:p Heading-Main:s Name-geographic-heading:w Name-geographic-heading:p Name-geographic-heading:s Term-geographic-heading:w Term-geographic-heading:p Term-geographic-heading:s">
149           <xslo:value-of select="."/>
150         </z:index>
151       </xslo:if>
152     </xslo:for-each>
153   </xslo:template>
154   <xslo:template mode="index_subfields" match="marc:datafield[@tag='415']">
155     <xslo:for-each select="marc:subfield">
156       <xslo:if test="contains('ajxyz', @code)">
157         <z:index name="Name-geographic-see:w Name-geographic-see:p Term-geographic-see:w Term-geographic-see:p Term-geographic-see:s See:w See:p See:s Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
158           <xslo:value-of select="."/>
159         </z:index>
160       </xslo:if>
161     </xslo:for-each>
162   </xslo:template>
163   <xslo:template mode="index_subfields" match="marc:datafield[@tag='515']">
164     <xslo:for-each select="marc:subfield">
165       <xslo:if test="contains('ajxyz', @code)">
166         <z:index name="Name-geographic-see-also:w Name-geographic-see-also:p Term-geographic-see-also:w Term-geographic-see-also:p Term-geographic-see-also:s See-also:w See-also:p Match:w Match:p">
167           <xslo:value-of select="."/>
168         </z:index>
169       </xslo:if>
170     </xslo:for-each>
171   </xslo:template>
172   <xslo:template mode="index_subfields" match="marc:datafield[@tag='715']">
173     <xslo:for-each select="marc:subfield">
174       <xslo:if test="contains('ajxyz', @code)">
175         <z:index name="Name-geographic-parallel:w Name-geographic-parallel:s Term-geographic-parallel:w Term-geographic-parallel:s Term-geographic-parallel:p Parallel:w Parallel:p Match:w Match:p">
176           <xslo:value-of select="."/>
177         </z:index>
178       </xslo:if>
179     </xslo:for-each>
180   </xslo:template>
181   <xslo:template mode="index_subfields" match="marc:datafield[@tag='216']">
182     <xslo:for-each select="marc:subfield">
183       <xslo:if test="contains('afcjxyz', @code)">
184         <z:index name="Trademark:w Trademark:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
185           <xslo:value-of select="."/>
186         </z:index>
187       </xslo:if>
188     </xslo:for-each>
189     <xslo:for-each select="marc:subfield">
190       <xslo:if test="contains('a', @code)">
191         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Trademark-heading:w Trademark-heading:p Trademark-heading:s">
192           <xslo:value-of select="."/>
193         </z:index>
194       </xslo:if>
195     </xslo:for-each>
196   </xslo:template>
197   <xslo:template mode="index_subfields" match="marc:datafield[@tag='416']">
198     <xslo:for-each select="marc:subfield">
199       <xslo:if test="contains('afcjxyz', @code)">
200         <z:index name="Trademark-see:w Trademark-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
201           <xslo:value-of select="."/>
202         </z:index>
203       </xslo:if>
204     </xslo:for-each>
205   </xslo:template>
206   <xslo:template mode="index_subfields" match="marc:datafield[@tag='516']">
207     <xslo:for-each select="marc:subfield">
208       <xslo:if test="contains('afcjxyz', @code)">
209         <z:index name="Trademark-see-also:w Trademark-see-also:p See-also:w See-also:p Match:w Match:p">
210           <xslo:value-of select="."/>
211         </z:index>
212       </xslo:if>
213     </xslo:for-each>
214   </xslo:template>
215   <xslo:template mode="index_subfields" match="marc:datafield[@tag='716']">
216     <xslo:for-each select="marc:subfield">
217       <xslo:if test="contains('afcjxyz', @code)">
218         <z:index name="Trademark-parallel:w Trademark-parallel:s Parallel:w Parallel:p Match:w Match:p">
219           <xslo:value-of select="."/>
220         </z:index>
221       </xslo:if>
222     </xslo:for-each>
223   </xslo:template>
224   <xslo:template mode="index_subfields" match="marc:datafield[@tag='220']">
225     <xslo:for-each select="marc:subfield">
226       <xslo:if test="contains('afjxyz', @code)">
227         <z:index name="Name:w Name:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
228           <xslo:value-of select="."/>
229         </z:index>
230       </xslo:if>
231     </xslo:for-each>
232     <xslo:for-each select="marc:subfield">
233       <xslo:if test="contains('a', @code)">
234         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Name-heading:w Name-heading:p Name-heading: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='420']">
241     <xslo:for-each select="marc:subfield">
242       <xslo:if test="contains('afjxyz', @code)">
243         <z:index name="Name-see:w Name-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
244           <xslo:value-of select="."/>
245         </z:index>
246       </xslo:if>
247     </xslo:for-each>
248   </xslo:template>
249   <xslo:template mode="index_subfields" match="marc:datafield[@tag='520']">
250     <xslo:for-each select="marc:subfield">
251       <xslo:if test="contains('afjxyz', @code)">
252         <z:index name="Name-see-also:w Name-see-also:p See-also:w See-also:p Match:w Match:p">
253           <xslo:value-of select="."/>
254         </z:index>
255       </xslo:if>
256     </xslo:for-each>
257   </xslo:template>
258   <xslo:template mode="index_subfields" match="marc:datafield[@tag='720']">
259     <xslo:for-each select="marc:subfield">
260       <xslo:if test="contains('afjxyz', @code)">
261         <z:index name="Name-parallel:w Name-parallel:s Parallel:w Parallel:p Match:w Match:p">
262           <xslo:value-of select="."/>
263         </z:index>
264       </xslo:if>
265     </xslo:for-each>
266   </xslo:template>
267   <xslo:template mode="index_subfields" match="marc:datafield[@tag='230']">
268     <xslo:for-each select="marc:subfield">
269       <xslo:if test="contains('abhiklmnqrsuwjxyz', @code)">
270         <z:index name="Title-uniform:w Title-uniform:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
271           <xslo:value-of select="."/>
272         </z:index>
273       </xslo:if>
274     </xslo:for-each>
275     <xslo:for-each select="marc:subfield">
276       <xslo:if test="contains('a', @code)">
277         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Title-uniform-heading:w Title-uniform-heading:p Title-uniform-heading:s">
278           <xslo:value-of select="."/>
279         </z:index>
280       </xslo:if>
281     </xslo:for-each>
282   </xslo:template>
283   <xslo:template mode="index_subfields" match="marc:datafield[@tag='430']">
284     <xslo:for-each select="marc:subfield">
285       <xslo:if test="contains('abhiklmnqrsuwjxyz', @code)">
286         <z:index name="Title-uniform-see:w Title-uniform-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
287           <xslo:value-of select="."/>
288         </z:index>
289       </xslo:if>
290     </xslo:for-each>
291   </xslo:template>
292   <xslo:template mode="index_subfields" match="marc:datafield[@tag='530']">
293     <xslo:for-each select="marc:subfield">
294       <xslo:if test="contains('abhiklmnqrsuwjxyz', @code)">
295         <z:index name="Title-uniform-see-also:w Title-uniform-see-also:p See-also:w See-also:p Match:w Match:p">
296           <xslo:value-of select="."/>
297         </z:index>
298       </xslo:if>
299     </xslo:for-each>
300   </xslo:template>
301   <xslo:template mode="index_subfields" match="marc:datafield[@tag='730']">
302     <xslo:for-each select="marc:subfield">
303       <xslo:if test="contains('a', @code)">
304         <z:index name="Title-uniform-parallel:w Title-uniform-parallel:s Parallel:w Parallel:p Match:w Match:p">
305           <xslo:value-of select="."/>
306         </z:index>
307       </xslo:if>
308     </xslo:for-each>
309   </xslo:template>
310   <xslo:template mode="index_subfields" match="marc:datafield[@tag='235']">
311     <xslo:for-each select="marc:subfield">
312       <xslo:if test="contains('abekmrsuwjxyz', @code)">
313         <z:index name="Title-uniform:w Title-uniform:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
314           <xslo:value-of select="."/>
315         </z:index>
316       </xslo:if>
317     </xslo:for-each>
318     <xslo:for-each select="marc:subfield">
319       <xslo:if test="contains('a', @code)">
320         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Title-uniform-heading:w Title-uniform-heading:p Title-uniform-heading:s">
321           <xslo:value-of select="."/>
322         </z:index>
323       </xslo:if>
324     </xslo:for-each>
325   </xslo:template>
326   <xslo:template mode="index_subfields" match="marc:datafield[@tag='435']">
327     <xslo:for-each select="marc:subfield">
328       <xslo:if test="contains('abekmrsuwjxyz', @code)">
329         <z:index name="Title-uniform-see:w Title-uniform-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
330           <xslo:value-of select="."/>
331         </z:index>
332       </xslo:if>
333     </xslo:for-each>
334   </xslo:template>
335   <xslo:template mode="index_subfields" match="marc:datafield[@tag='535']">
336     <xslo:for-each select="marc:subfield">
337       <xslo:if test="contains('abekmrsuwjxyz', @code)">
338         <z:index name="Title-uniform-see-also:w Title-uniform-see-also:p See-also:w See-also:p Match:w Match:p">
339           <xslo:value-of select="."/>
340         </z:index>
341       </xslo:if>
342     </xslo:for-each>
343   </xslo:template>
344   <xslo:template mode="index_subfields" match="marc:datafield[@tag='735']">
345     <xslo:for-each select="marc:subfield">
346       <xslo:if test="contains('a', @code)">
347         <z:index name="Title-uniform-parallel:w Title-uniform-parallel:s Parallel:w Parallel:p Match:w Match:p">
348           <xslo:value-of select="."/>
349         </z:index>
350       </xslo:if>
351     </xslo:for-each>
352   </xslo:template>
353   <xslo:template mode="index_subfields" match="marc:datafield[@tag='240']">
354     <xslo:for-each select="marc:subfield">
355       <xslo:if test="contains('atjxyz', @code)">
356         <z:index name="Name-Title:w Name-Title:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
357           <xslo:value-of select="."/>
358         </z:index>
359       </xslo:if>
360     </xslo:for-each>
361     <xslo:for-each select="marc:subfield">
362       <xslo:if test="contains('a', @code)">
363         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Name-Title-heading:w Name-Title-heading:p Name-Title-heading:s">
364           <xslo:value-of select="."/>
365         </z:index>
366       </xslo:if>
367     </xslo:for-each>
368   </xslo:template>
369   <xslo:template mode="index_subfields" match="marc:datafield[@tag='440']">
370     <xslo:for-each select="marc:subfield">
371       <xslo:if test="contains('atjxyz', @code)">
372         <z:index name="Name-Title-see:w Name-Title-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
373           <xslo:value-of select="."/>
374         </z:index>
375       </xslo:if>
376     </xslo:for-each>
377   </xslo:template>
378   <xslo:template mode="index_subfields" match="marc:datafield[@tag='540']">
379     <xslo:for-each select="marc:subfield">
380       <xslo:if test="contains('atjxyz', @code)">
381         <z:index name="Name-Title-see-also:w Name-Title-see-also:p See-also:w See-also:p Match:w Match:p">
382           <xslo:value-of select="."/>
383         </z:index>
384       </xslo:if>
385     </xslo:for-each>
386   </xslo:template>
387   <xslo:template mode="index_subfields" match="marc:datafield[@tag='740']">
388     <xslo:for-each select="marc:subfield">
389       <xslo:if test="contains('a', @code)">
390         <z:index name="Name-Title-parallel:w Name-Title-parallel:s Parallel:w Parallel:p Match:w Match:p">
391           <xslo:value-of select="."/>
392         </z:index>
393       </xslo:if>
394     </xslo:for-each>
395   </xslo:template>
396   <xslo:template mode="index_subfields" match="marc:datafield[@tag='245']">
397     <xslo:for-each select="marc:subfield">
398       <xslo:if test="contains('atjxyz', @code)">
399         <z:index name="Title-uniform:w Title-uniform:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
400           <xslo:value-of select="."/>
401         </z:index>
402       </xslo:if>
403     </xslo:for-each>
404     <xslo:for-each select="marc:subfield">
405       <xslo:if test="contains('a', @code)">
406         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s Title-uniform-heading:w Title-uniform-heading:p Title-uniform-heading:s">
407           <xslo:value-of select="."/>
408         </z:index>
409       </xslo:if>
410     </xslo:for-each>
411   </xslo:template>
412   <xslo:template mode="index_subfields" match="marc:datafield[@tag='445']">
413     <xslo:for-each select="marc:subfield">
414       <xslo:if test="contains('atjxyz', @code)">
415         <z:index name="Title-uniform-see:w Title-uniform-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
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='545']">
422     <xslo:for-each select="marc:subfield">
423       <xslo:if test="contains('atjxyz', @code)">
424         <z:index name="Title-uniform-see-also:w Title-uniform-see-also:p See-also:w See-also:p Match:w Match:p">
425           <xslo:value-of select="."/>
426         </z:index>
427       </xslo:if>
428     </xslo:for-each>
429   </xslo:template>
430   <xslo:template mode="index_subfields" match="marc:datafield[@tag='745']">
431     <xslo:for-each select="marc:subfield">
432       <xslo:if test="contains('a', @code)">
433         <z:index name="Title-uniform-parallel:w Title-uniform-parallel:s Parallel:w Parallel:p Match:w Match:p">
434           <xslo:value-of select="."/>
435         </z:index>
436       </xslo:if>
437     </xslo:for-each>
438   </xslo:template>
439   <xslo:template mode="index_subfields" match="marc:datafield[@tag='250']">
440     <xslo:for-each select="marc:subfield">
441       <xslo:if test="contains('ajxyz', @code)">
442         <z:index name="Subject:w Subject:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p Subject-heading:w Subject-heading:p Subject-heading:s">
443           <xslo:value-of select="."/>
444         </z:index>
445       </xslo:if>
446     </xslo:for-each>
447     <xslo:for-each select="marc:subfield">
448       <xslo:if test="contains('a', @code)">
449         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s">
450           <xslo:value-of select="."/>
451         </z:index>
452       </xslo:if>
453     </xslo:for-each>
454   </xslo:template>
455   <xslo:template mode="index_subfields" match="marc:datafield[@tag='450']">
456     <xslo:for-each select="marc:subfield">
457       <xslo:if test="contains('ajxyz', @code)">
458         <z:index name="Subject-see:w Subject-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
459           <xslo:value-of select="."/>
460         </z:index>
461       </xslo:if>
462     </xslo:for-each>
463   </xslo:template>
464   <xslo:template mode="index_subfields" match="marc:datafield[@tag='550']">
465     <xslo:for-each select="marc:subfield">
466       <xslo:if test="contains('ajxyz', @code)">
467         <z:index name="Subject-see-also:w Subject-see-also:p See-also:w See-also:p Match:w Match:p">
468           <xslo:value-of select="."/>
469         </z:index>
470       </xslo:if>
471     </xslo:for-each>
472   </xslo:template>
473   <xslo:template mode="index_subfields" match="marc:datafield[@tag='750']">
474     <xslo:for-each select="marc:subfield">
475       <xslo:if test="contains('a', @code)">
476         <z:index name="Subject-parallel:w Subject-parallel:s Parallel:w Parallel:p Match:w Match:p">
477           <xslo:value-of select="."/>
478         </z:index>
479       </xslo:if>
480     </xslo:for-each>
481   </xslo:template>
482   <xslo:template mode="index_subfields" match="marc:datafield[@tag='260']">
483     <xslo:for-each select="marc:subfield">
484       <xslo:if test="contains('abcdjxyz', @code)">
485         <z:index name="Place:w Place:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p Place-heading:w Place-heading:p Place-heading:s">
486           <xslo:value-of select="."/>
487         </z:index>
488       </xslo:if>
489     </xslo:for-each>
490     <xslo:for-each select="marc:subfield">
491       <xslo:if test="contains('a', @code)">
492         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s">
493           <xslo:value-of select="."/>
494         </z:index>
495       </xslo:if>
496     </xslo:for-each>
497   </xslo:template>
498   <xslo:template mode="index_subfields" match="marc:datafield[@tag='460']">
499     <xslo:for-each select="marc:subfield">
500       <xslo:if test="contains('abcdjxyz', @code)">
501         <z:index name="Place-see:w Place-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
502           <xslo:value-of select="."/>
503         </z:index>
504       </xslo:if>
505     </xslo:for-each>
506   </xslo:template>
507   <xslo:template mode="index_subfields" match="marc:datafield[@tag='560']">
508     <xslo:for-each select="marc:subfield">
509       <xslo:if test="contains('abcdjxyz', @code)">
510         <z:index name="Place-see-also:w Place-see-also:p See-also:w See-also:p Match:w Match:p">
511           <xslo:value-of select="."/>
512         </z:index>
513       </xslo:if>
514     </xslo:for-each>
515   </xslo:template>
516   <xslo:template mode="index_subfields" match="marc:datafield[@tag='760']">
517     <xslo:for-each select="marc:subfield">
518       <xslo:if test="contains('a', @code)">
519         <z:index name="Place-parallel:w Place-parallel:s Parallel:w Parallel:p Match:w Match:p">
520           <xslo:value-of select="."/>
521         </z:index>
522       </xslo:if>
523     </xslo:for-each>
524   </xslo:template>
525   <xslo:template mode="index_subfields" match="marc:datafield[@tag='280']">
526     <xslo:for-each select="marc:subfield">
527       <xslo:if test="contains('ajxyz', @code)">
528         <z:index name="Form:w Form:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p Form-heading:w Form-heading:p Form-heading:s">
529           <xslo:value-of select="."/>
530         </z:index>
531       </xslo:if>
532     </xslo:for-each>
533     <xslo:for-each select="marc:subfield">
534       <xslo:if test="contains('a', @code)">
535         <z:index name="Heading:s Heading-Main:w Heading-Main:p Heading-Main:s">
536           <xslo:value-of select="."/>
537         </z:index>
538       </xslo:if>
539     </xslo:for-each>
540   </xslo:template>
541   <xslo:template mode="index_subfields" match="marc:datafield[@tag='480']">
542     <xslo:for-each select="marc:subfield">
543       <xslo:if test="contains('ajxyz', @code)">
544         <z:index name="Form-see:w Form-see:p See:w See:p Match:w Match:p Match-heading-see-form:w Match-heading-see-form:p">
545           <xslo:value-of select="."/>
546         </z:index>
547       </xslo:if>
548     </xslo:for-each>
549   </xslo:template>
550   <xslo:template mode="index_subfields" match="marc:datafield[@tag='580']">
551     <xslo:for-each select="marc:subfield">
552       <xslo:if test="contains('ajxyz', @code)">
553         <z:index name="Form-see-also:w Form-see-also:p See-also:w See-also:p Match:w Match:p">
554           <xslo:value-of select="."/>
555         </z:index>
556       </xslo:if>
557     </xslo:for-each>
558   </xslo:template>
559   <xslo:template mode="index_subfields" match="marc:datafield[@tag='780']">
560     <xslo:for-each select="marc:subfield">
561       <xslo:if test="contains('a', @code)">
562         <z:index name="Form-parallel:w Form-parallel:s Parallel:w Parallel:p Match:w Match:p">
563           <xslo:value-of select="."/>
564         </z:index>
565       </xslo:if>
566     </xslo:for-each>
567   </xslo:template>
568   <xslo:template mode="index_subfields" match="marc:datafield[@tag='300']">
569     <xslo:for-each select="marc:subfield">
570       <xslo:if test="contains('a', @code)">
571         <z:index name="Note:w Note:p">
572           <xslo:value-of select="."/>
573         </z:index>
574       </xslo:if>
575     </xslo:for-each>
576   </xslo:template>
577   <xslo:template mode="index_subfields" match="marc:datafield[@tag='305']">
578     <xslo:for-each select="marc:subfield">
579       <xslo:if test="contains('a', @code)">
580         <z:index name="Note:w Note:p">
581           <xslo:value-of select="."/>
582         </z:index>
583       </xslo:if>
584     </xslo:for-each>
585   </xslo:template>
586   <xslo:template mode="index_subfields" match="marc:datafield[@tag='310']">
587     <xslo:for-each select="marc:subfield">
588       <xslo:if test="contains('a', @code)">
589         <z:index name="Note:w Note:p">
590           <xslo:value-of select="."/>
591         </z:index>
592       </xslo:if>
593     </xslo:for-each>
594   </xslo:template>
595   <xslo:template mode="index_subfields" match="marc:datafield[@tag='320']">
596     <xslo:for-each select="marc:subfield">
597       <xslo:if test="contains('a', @code)">
598         <z:index name="Note:w Note:p">
599           <xslo:value-of select="."/>
600         </z:index>
601       </xslo:if>
602     </xslo:for-each>
603   </xslo:template>
604   <xslo:template mode="index_subfields" match="marc:datafield[@tag='330']">
605     <xslo:for-each select="marc:subfield">
606       <xslo:if test="contains('a', @code)">
607         <z:index name="Note:w Note:p">
608           <xslo:value-of select="."/>
609         </z:index>
610       </xslo:if>
611     </xslo:for-each>
612   </xslo:template>
613   <xslo:template mode="index_subfields" match="marc:datafield[@tag='340']">
614     <xslo:for-each select="marc:subfield">
615       <xslo:if test="contains('a', @code)">
616         <z:index name="Note:w Note:p">
617           <xslo:value-of select="."/>
618         </z:index>
619       </xslo:if>
620     </xslo:for-each>
621   </xslo:template>
622   <xslo:template mode="index_subfields" match="marc:datafield[@tag='356']">
623     <xslo:for-each select="marc:subfield">
624       <xslo:if test="contains('a', @code)">
625         <z:index name="Note:w Note:p">
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='152']">
632     <xslo:for-each select="marc:subfield">
633       <xslo:if test="contains('b', @code)">
634         <z:index name="authtype:w authtype:p">
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='942']">
641     <xslo:for-each select="marc:subfield">
642       <xslo:if test="contains('a', @code)">
643         <z:index name="authtype:w">
644           <xslo:value-of select="."/>
645         </z:index>
646       </xslo:if>
647     </xslo:for-each>
648   </xslo:template>
649   <xslo:template mode="index_all" match="text()">
650     <z:index name="Any:w Any:p">
651       <xslo:value-of select="."/>
652     </z:index>
653   </xslo:template>
654   <xslo:template name="chopPunctuation">
655     <xslo:param name="chopString"/>
656     <xslo:variable name="length" select="string-length($chopString)"/>
657     <xslo:choose>
658       <xslo:when test="$length=0"/>
659       <xslo:when test="contains('-,.:=;!%/', substring($chopString,$length,1))">
660         <xslo:call-template name="chopPunctuation">
661           <xslo:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
662         </xslo:call-template>
663       </xslo:when>
664       <xslo:when test="not($chopString)"/>
665       <xslo:otherwise>
666         <xslo:value-of select="$chopString"/>
667       </xslo:otherwise>
668     </xslo:choose>
669     <xslo:text/>
670   </xslo:template>
671 </xslo:stylesheet>