custom xsl for MARC21slim2intranetDetailISBD.xsl
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / MARC21slim2intranetDetailISBD.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
4
5 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
6 <xsl:stylesheet version="1.0"
7   xmlns:marc="http://www.loc.gov/MARC21/slim"
8   xmlns:items="http://www.koha-community.org/items"
9   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10   exclude-result-prefixes="marc items">
11     <xsl:import href="MARC21slimUtils.xsl"/>
12     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13     <xsl:template match="/">
14             <xsl:apply-templates/>
15     </xsl:template>
16
17     <xsl:template match="marc:record">
18
19         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
20         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
21         <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
22         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
23         <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
24         <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
25         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
26         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
27         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
28         <xsl:variable name="TracingQuotesLeft">
29            <xsl:choose>
30              <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
31              <xsl:otherwise>"</xsl:otherwise>
32            </xsl:choose>
33         </xsl:variable>
34         <xsl:variable name="TracingQuotesRight">
35           <xsl:choose>
36             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
37             <xsl:otherwise>"</xsl:otherwise>
38           </xsl:choose>
39         </xsl:variable>
40         <xsl:variable name="leader" select="marc:leader"/>
41         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
42         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
43         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
44         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
45         <xsl:variable name="materialTypeCode">
46             <xsl:choose>
47                 <xsl:when test="$leader19='a'">ST</xsl:when>
48                 <xsl:when test="$leader6='a'">
49                     <xsl:choose>
50                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
51                         <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
52                         <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
53                     </xsl:choose>
54                 </xsl:when>
55                 <xsl:when test="$leader6='t'">BK</xsl:when>
56                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
57                 <xsl:when test="$leader6='m'">CF</xsl:when>
58                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
59                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
60                 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
61                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
62             </xsl:choose>
63         </xsl:variable>
64         <xsl:variable name="materialTypeLabel">
65             <xsl:choose>
66                 <xsl:when test="$leader19='a'">Set</xsl:when>
67                 <xsl:when test="$leader6='a'">
68                     <xsl:choose>
69                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
70                         <xsl:when test="$leader7='i' or $leader7='s'">
71                             <xsl:choose>
72                                 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
73                                 <xsl:otherwise>Series</xsl:otherwise>
74                             </xsl:choose>
75                         </xsl:when>
76                         <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
77                     </xsl:choose>
78                 </xsl:when>
79                 <xsl:when test="$leader6='t'">Book</xsl:when>
80                 <xsl:when test="$leader6='o'">Kit</xsl:when>
81                 <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
82                 <xsl:when test="$leader6='m'">Computer File</xsl:when>
83                 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
84                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual Material</xsl:when>
85                 <xsl:when test="$leader6='j'">Music</xsl:when>
86                 <xsl:when test="$leader6='i'">Sound</xsl:when>
87                 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
88             </xsl:choose>
89         </xsl:variable>
90
91         <!-- Title Statement -->
92         <!-- Alternate Graphic Representation (MARC 880) -->
93         <xsl:if test="$display880">
94             <h1 class="title">
95                 <xsl:call-template name="m880Select">
96                     <xsl:with-param name="basetags">245</xsl:with-param>
97                     <xsl:with-param name="codes">abhfgknps</xsl:with-param>
98                 </xsl:call-template>
99             </h1>
100         </xsl:if>
101
102         <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
103         <xsl:if test="$display880">
104             <xsl:call-template name="m880Select">
105                 <xsl:with-param name="basetags">250</xsl:with-param>
106                 <xsl:with-param name="codes">ab</xsl:with-param>
107                 <xsl:with-param name="class">results_summary edition</xsl:with-param>
108                 <xsl:with-param name="label">Edition: </xsl:with-param>
109             </xsl:call-template>
110         </xsl:if>
111
112         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
113         <xsl:if test="$display880">
114             <xsl:call-template name="m880Select">
115                 <xsl:with-param name="basetags">260</xsl:with-param>
116                 <xsl:with-param name="codes">abcg</xsl:with-param>
117                 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
118                 <xsl:with-param name="label">Publisher: </xsl:with-param>
119             </xsl:call-template>
120         </xsl:if>
121
122         <!--Series: Alternate Graphic Representation (MARC 880) -->
123         <xsl:if test="$display880">
124             <xsl:call-template name="m880Select">
125                 <xsl:with-param name="basetags">440,490</xsl:with-param>
126                 <xsl:with-param name="codes">av</xsl:with-param>
127                 <xsl:with-param name="class">results_summary series</xsl:with-param>
128                 <xsl:with-param name="label">Series: </xsl:with-param>
129                 <xsl:with-param name="index">se</xsl:with-param>
130             </xsl:call-template>
131         </xsl:if>
132
133         <!-- Description: Alternate Graphic Representation (MARC 880) -->
134         <xsl:if test="$display880">
135             <xsl:call-template name="m880Select">
136                 <xsl:with-param name="basetags">300</xsl:with-param>
137                 <xsl:with-param name="codes">abceg</xsl:with-param>
138                 <xsl:with-param name="class">results_summary description</xsl:with-param>
139                 <xsl:with-param name="label">Description: </xsl:with-param>
140             </xsl:call-template>
141         </xsl:if>
142
143    <xsl:if test="$materialTypeCode!=''">
144         <span class="results_summary type"><span class="label">Type: </span>
145         <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
146         <xsl:text> </xsl:text>
147         <xsl:value-of select="$materialTypeLabel"/>
148         </span>
149    </xsl:if>
150
151        <xsl:if test="marc:datafield[@tag=080]">
152         <span class="results_summary udc"><span class="label">UDC </span>
153         <xsl:for-each select="marc:datafield[@tag=080]">
154         <xsl:variable name="udc" select="marc:subfield[@code='a']"/>
155                 <xsl:value-of select="marc:subfield[@code='a']"/>
156                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
157         </xsl:for-each>
158         </span>
159         </xsl:if>
160
161        <xsl:if test="marc:datafield[@tag=084]">
162         <span class="results_summary othercc">
163         <xsl:for-each select="marc:datafield[@tag=084]">
164                     <xsl:call-template name="subfieldSelect">
165                         <xsl:with-param name="codes">2</xsl:with-param>
166                     </xsl:call-template>
167                     <xsl:text> </xsl:text>
168                     <xsl:call-template name="subfieldSelect">
169                         <xsl:with-param name="codes">a</xsl:with-param>
170                     </xsl:call-template>
171         </xsl:for-each>
172         </span>
173         </xsl:if>
174
175         <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
176         <xsl:if test="$display880">
177             <h5 class="author">
178                 <xsl:call-template name="m880Select">
179                     <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
180                     <xsl:with-param name="codes">abc</xsl:with-param>
181                     <xsl:with-param name="index">au</xsl:with-param>
182                     <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
183                     <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
184                 </xsl:call-template>
185             </h5>
186         </xsl:if>
187
188         <!-- Author Statement -->
189         <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
190         <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
191
192
193         <xsl:if test="marc:datafield[@tag=245]">
194         <span class="results_summary title">
195             <strong>
196             <xsl:for-each select="marc:datafield[@tag=245]">
197                     <xsl:call-template name="subfieldSelect">
198                         <xsl:with-param name="codes">a</xsl:with-param>
199                     </xsl:call-template>
200             </xsl:for-each>
201             </strong>
202             <xsl:for-each select="marc:datafield[@tag=245]">
203                     <xsl:if test="marc:subfield[@code='h']">
204                         <xsl:text> </xsl:text>
205                         <xsl:call-template name="subfieldSelect">
206                             <xsl:with-param name="codes">h</xsl:with-param>
207                         </xsl:call-template>
208                     </xsl:if>
209                     <xsl:if test="marc:subfield[@code='b']">
210                         <xsl:text> </xsl:text>
211                         <xsl:call-template name="subfieldSelect">
212                             <xsl:with-param name="codes">b</xsl:with-param>
213                         </xsl:call-template>
214                     </xsl:if>
215                     <xsl:text> </xsl:text>
216                     <xsl:call-template name="subfieldSelect">
217                         <xsl:with-param name="codes">cfgknps</xsl:with-param>
218                     </xsl:call-template>
219             </xsl:for-each>
220         </span>
221         </xsl:if>
222
223         <xsl:if test="marc:datafield[@tag=250]">
224         <span class="results_summary edition">
225         <xsl:text> - </xsl:text>
226             <xsl:for-each select="marc:datafield[@tag=250]">
227                 <xsl:call-template name="chopPunctuation">
228                   <xsl:with-param name="chopString">
229                     <xsl:call-template name="subfieldSelect">
230                         <xsl:with-param name="codes">ab</xsl:with-param>
231                     </xsl:call-template>
232                    </xsl:with-param>
233                </xsl:call-template>
234                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
235             </xsl:for-each>
236         </span>
237         </xsl:if>
238
239         <xsl:if test="marc:datafield[@tag=260]">
240         <span class="results_summary publisher">
241         <xsl:text> - </xsl:text>
242             <xsl:for-each select="marc:datafield[@tag=260]">
243                 <xsl:if test="marc:subfield[@code='a']">
244                     <xsl:call-template name="subfieldSelect">
245                         <xsl:with-param name="codes">a</xsl:with-param>
246                     </xsl:call-template>
247                 </xsl:if>
248                 <xsl:text> </xsl:text>
249                 <xsl:if test="marc:subfield[@code='b']">
250                 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
251                     <xsl:call-template name="subfieldSelect">
252                         <xsl:with-param name="codes">b</xsl:with-param>
253                     </xsl:call-template>
254                </a>
255                </xsl:if>
256                <xsl:text> </xsl:text>
257                 <xsl:call-template name="chopPunctuation">
258                   <xsl:with-param name="chopString">
259                     <xsl:call-template name="subfieldSelect">
260                         <xsl:with-param name="codes">cg</xsl:with-param>
261                     </xsl:call-template>
262                    </xsl:with-param>
263                </xsl:call-template>
264                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
265             </xsl:for-each>
266         </span>
267         </xsl:if>
268
269         <xsl:if test="marc:datafield[@tag=300]">
270         <span class="results_summary description">
271         <xsl:text> - </xsl:text>
272             <xsl:for-each select="marc:datafield[@tag=300]">
273                 <xsl:call-template name="chopPunctuation">
274                   <xsl:with-param name="chopString">
275                     <xsl:call-template name="subfieldSelect">
276                         <xsl:with-param name="codes">abceg</xsl:with-param>
277                     </xsl:call-template>
278                    </xsl:with-param>
279                </xsl:call-template>
280                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
281             </xsl:for-each>
282         </span>
283        </xsl:if>
284
285
286
287         <!-- Series -->
288         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
289         <span class="results_summary series">
290         <!-- 440 -->
291         <xsl:for-each select="marc:datafield[@tag=440]">
292         <xsl:text> - (</xsl:text>
293             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
294             <xsl:call-template name="chopPunctuation">
295                             <xsl:with-param name="chopString">
296                                 <xsl:call-template name="subfieldSelect">
297                                     <xsl:with-param name="codes">av</xsl:with-param>
298                                 </xsl:call-template>
299                             </xsl:with-param>
300                         </xsl:call-template>
301             </a>
302             <xsl:call-template name="part"/>
303             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
304         <xsl:text>)</xsl:text>
305         </xsl:for-each>
306
307         <!-- 490 Series not traced, Ind1 = 0 -->
308         <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
309         <xsl:text> - (</xsl:text>
310             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
311                         <xsl:call-template name="chopPunctuation">
312                             <xsl:with-param name="chopString">
313                                 <xsl:call-template name="subfieldSelect">
314                                     <xsl:with-param name="codes">av</xsl:with-param>
315                                 </xsl:call-template>
316                             </xsl:with-param>
317                         </xsl:call-template>
318             </a>
319                     <xsl:call-template name="part"/>
320         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
321         <xsl:text>)</xsl:text>
322         </xsl:for-each>
323         <!-- 490 Series traced, Ind1 = 1 -->
324         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
325             <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
326                 <xsl:choose>
327                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
328                         <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
329                             <xsl:call-template name="chopPunctuation">
330                                 <xsl:with-param name="chopString">
331                                     <xsl:call-template name="subfieldSelect">
332                                         <xsl:with-param name="codes">a_t</xsl:with-param>
333                                     </xsl:call-template>
334                                 </xsl:with-param>
335                             </xsl:call-template>
336                         </a>
337                     </xsl:when>
338                     <xsl:otherwise>
339                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
340                             <xsl:call-template name="chopPunctuation">
341                                 <xsl:with-param name="chopString">
342                                     <xsl:call-template name="subfieldSelect">
343                                         <xsl:with-param name="codes">a_t</xsl:with-param>
344                                     </xsl:call-template>
345                                 </xsl:with-param>
346                             </xsl:call-template>
347                         </a>
348                         <xsl:call-template name="part"/>
349                     </xsl:otherwise>
350                 </xsl:choose>
351                 <xsl:text>: </xsl:text>
352                 <xsl:value-of  select="marc:subfield[@code='v']" />
353             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
354             </xsl:for-each>
355         </xsl:if>
356
357         </span>
358         </xsl:if>
359
360
361
362         <!-- Analytics -->
363         <xsl:if test="$leader7='s'">
364         <span class="results_summary analytics"><span class="label">Analytics: </span>
365             <a>
366             <xsl:choose>
367             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
368                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
369             </xsl:when>
370             <xsl:otherwise>
371                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
372             </xsl:otherwise>
373             </xsl:choose>
374             <xsl:text>Show analytics</xsl:text>
375             </a>
376         </span>
377         </xsl:if>
378
379         <!-- Volumes of sets and traced series -->
380         <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
381         <span class="results_summary volumes"><span class="label">Volumes: </span>
382             <a>
383             <xsl:choose>
384             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
385                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
386             </xsl:when>
387             <xsl:otherwise>
388                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
389             </xsl:otherwise>
390             </xsl:choose>
391             <xsl:text>Show volumes</xsl:text>
392             </a>
393         </span>
394         </xsl:if>
395
396         <!-- Set -->
397         <xsl:if test="$leader19='c'">
398         <span class="results_summary set"><span class="label">Set: </span>
399         <xsl:for-each select="marc:datafield[@tag=773]">
400             <a>
401             <xsl:choose>
402             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
403                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
404             </xsl:when>
405             <xsl:otherwise>
406                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
407             </xsl:otherwise>
408             </xsl:choose>
409             <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
410             </a>
411             <xsl:choose>
412                 <xsl:when test="position()=last()"></xsl:when>
413                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
414             </xsl:choose>
415         </xsl:for-each>
416         </span>
417         </xsl:if>
418
419        <xsl:if test="marc:datafield[@tag=020]">
420         <span class="results_summary isbn"><span class="label">ISBN: </span>
421         <xsl:for-each select="marc:datafield[@tag=020]">
422         <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
423                 <xsl:value-of select="marc:subfield[@code='a']"/>
424                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
425         </xsl:for-each>
426         </span>
427         </xsl:if>
428
429         <xsl:if test="marc:datafield[@tag=022]">
430         <span class="results_summary issn"><span class="label">ISSN: </span>
431         <xsl:for-each select="marc:datafield[@tag=022]">
432                 <xsl:value-of select="marc:subfield[@code='a']"/>
433                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
434         </xsl:for-each>
435         </span>
436         </xsl:if>
437
438         <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
439         <xsl:if test="$display880">
440             <xsl:call-template name="m880Select">
441                 <xsl:with-param name="basetags">246</xsl:with-param>
442                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
443                 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
444                 <xsl:with-param name="label">Other Title: </xsl:with-param>
445             </xsl:call-template>
446         </xsl:if>
447
448         <xsl:if test="marc:datafield[@tag=246]">
449         <span class="results_summary other_title"><span class="label">Other Title: </span>
450             <xsl:for-each select="marc:datafield[@tag=246]">
451                 <xsl:call-template name="chopPunctuation">
452                   <xsl:with-param name="chopString">
453                     <xsl:call-template name="subfieldSelect">
454                         <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
455                     </xsl:call-template>
456                    </xsl:with-param>
457                </xsl:call-template>
458                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
459             </xsl:for-each>
460         </span>
461        </xsl:if>
462
463         <xsl:if test="marc:datafield[@tag=242]">
464         <span class="results_summary translated_title"><span class="label">Title translated: </span>
465             <xsl:for-each select="marc:datafield[@tag=242]">
466                 <xsl:call-template name="chopPunctuation">
467                   <xsl:with-param name="chopString">
468                     <xsl:call-template name="subfieldSelect">
469                         <xsl:with-param name="codes">abchnp</xsl:with-param>
470                     </xsl:call-template>
471                    </xsl:with-param>
472                </xsl:call-template>
473                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
474             </xsl:for-each>
475         </span>
476        </xsl:if>
477
478         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
479         <xsl:if test="$display880">
480             <xsl:call-template name="m880Select">
481                 <xsl:with-param name="basetags">130,240</xsl:with-param>
482                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
483                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
484                 <xsl:with-param name="label">Uniform Title: </xsl:with-param>
485             </xsl:call-template>
486         </xsl:if>
487
488         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
489         <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
490         <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
491             <xsl:variable name="str">
492                 <xsl:for-each select="marc:subfield">
493                     <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
494                         <xsl:value-of select="text()"/>
495                         <xsl:text> </xsl:text>
496                      </xsl:if>
497                 </xsl:for-each>
498             </xsl:variable>
499             <xsl:call-template name="chopPunctuation">
500                 <xsl:with-param name="chopString">
501                     <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
502
503                 </xsl:with-param>
504             </xsl:call-template>
505             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
506         </xsl:for-each>
507         </span>
508         </xsl:if>
509
510         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
511             <span class="results_summary subjects"><span class="label">Subject(s): </span>
512             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
513             <a>
514             <xsl:choose>
515             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
516                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
517             </xsl:when>
518             <xsl:when test="$TraceSubjectSubdivisions='1'">
519                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
520                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
521                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
522                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
523                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
524                     </xsl:call-template>
525                 </xsl:attribute>
526             </xsl:when>
527             <xsl:otherwise>
528                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
529             </xsl:otherwise>
530             </xsl:choose>
531             <xsl:call-template name="chopPunctuation">
532                 <xsl:with-param name="chopString">
533                     <xsl:call-template name="subfieldSelect">
534                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
535                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
536                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
537                     </xsl:call-template>
538                 </xsl:with-param>
539             </xsl:call-template>
540             </a>
541             <xsl:choose>
542             <xsl:when test="position()=last()"></xsl:when>
543             <xsl:otherwise> | </xsl:otherwise>
544             </xsl:choose>
545
546             </xsl:for-each>
547             </span>
548         </xsl:if>
549
550         <xsl:if test="marc:datafield[@tag=856]">
551         <span class="results_summary online_resources"><span class="label">Online Resources: </span>
552         <xsl:for-each select="marc:datafield[@tag=856]">
553                                    <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
554                                    <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
555                                     <xsl:choose>
556                                     <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')">
557                                         <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
558                                     </xsl:when>
559                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
560                                         <xsl:call-template name="subfieldSelect">
561                                         <xsl:with-param name="codes">y3z</xsl:with-param>
562                                         </xsl:call-template>
563                                     </xsl:when>
564                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
565                                         <xsl:choose>
566                                         <xsl:when test="$URLLinkText!=''">
567                                                 <xsl:value-of select="$URLLinkText"/>
568                                         </xsl:when>
569                                         <xsl:otherwise>
570                                                 <xsl:text>Click here to access online</xsl:text>
571                                         </xsl:otherwise>
572                                         </xsl:choose>
573                                     </xsl:when>
574                                     </xsl:choose>
575                                     </a>
576                                     <xsl:choose>
577                                     <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
578                                     <xsl:otherwise> | </xsl:otherwise>
579                                     </xsl:choose>
580
581         </xsl:for-each>
582         </span>
583         </xsl:if>
584         <xsl:if test="marc:datafield[@tag=505]">
585             <div class="results_summary contents">
586             <xsl:choose>
587             <xsl:when test="marc:datafield[@tag=505]/@ind1=0">
588                 <span class="label">Contents:</span>
589             </xsl:when>
590             <xsl:when test="marc:datafield[@tag=505]/@ind1=1">
591                 <span class="label">Incomplete contents:</span>
592             </xsl:when>
593             <xsl:when test="marc:datafield[@tag=505]/@ind1=2">
594                 <span class="label">Partial contents:</span>
595             </xsl:when>
596             </xsl:choose>
597                 <xsl:for-each select="marc:datafield[@tag=505]">
598                     <div class='contentblock'>
599                         <xsl:choose>
600                         <xsl:when test="@ind2=0">
601                             <xsl:call-template name="subfieldSelectSpan">
602                                 <xsl:with-param name="codes">tru</xsl:with-param>
603                             </xsl:call-template>
604                         </xsl:when>
605                         <xsl:otherwise>
606                             <xsl:call-template name="subfieldSelectSpan">
607                                 <xsl:with-param name="codes">atru</xsl:with-param>
608                             </xsl:call-template>
609                         </xsl:otherwise>
610                         </xsl:choose>
611                     </div>
612                 </xsl:for-each>
613             </div>
614         </xsl:if>
615
616         <!-- 773 -->
617         <xsl:if test="marc:datafield[@tag=773]">
618         <xsl:for-each select="marc:datafield[@tag=773]">
619         <xsl:if test="@ind1=0">
620         <span class="results_summary in"><span class="label">
621         <xsl:choose>
622         <xsl:when test="@ind2=' '">
623             In:
624         </xsl:when>
625         <xsl:when test="@ind2=8">
626             <xsl:if test="marc:subfield[@code='i']">
627                 <xsl:value-of select="marc:subfield[@code='i']"/>
628             </xsl:if>
629         </xsl:when>
630         </xsl:choose>
631         </span>
632                 <xsl:variable name="f773">
633                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
634                         <xsl:with-param name="codes">at</xsl:with-param>
635                     </xsl:call-template></xsl:with-param></xsl:call-template>
636                 </xsl:variable>
637             <xsl:choose>
638                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
639                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
640                         <xsl:value-of select="translate($f773, '()', '')"/>
641                     </a>
642                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
643                 </xsl:when>
644                 <xsl:when test="marc:subfield[@code='0']">
645                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
646                         <xsl:value-of select="$f773"/>
647                     </a>
648                 </xsl:when>
649                 <xsl:otherwise>
650                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
651                         <xsl:value-of select="$f773"/>
652                     </a>
653                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
654                 </xsl:otherwise>
655             </xsl:choose>
656         </span>
657
658         <xsl:if test="marc:subfield[@code='n']">
659             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
660         </xsl:if>
661
662         </xsl:if>
663         </xsl:for-each>
664         </xsl:if>
665
666         <!-- 866 textual holdings -->
667         <xsl:if test="marc:datafield[@tag=866]">
668             <span class="results_summary holdings_note"><span class="label">Holdings Note: </span>
669                 <xsl:for-each select="marc:datafield[@tag=866]">
670                     <xsl:call-template name="subfieldSelect">
671                         <xsl:with-param name="codes">axz</xsl:with-param>
672                     </xsl:call-template>
673                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
674                 </xsl:for-each>
675             </span>
676         </xsl:if>
677
678         <!--  775 Other Edition  -->
679         <xsl:if test="marc:datafield[@tag=775]">
680         <span class="results_summary other_editions"><span class="label">Other Editions: </span>
681         <xsl:for-each select="marc:datafield[@tag=775]">
682             <xsl:variable name="f775">
683                 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
684                 <xsl:with-param name="codes">a_t</xsl:with-param>
685                 </xsl:call-template></xsl:with-param></xsl:call-template>
686             </xsl:variable>
687             <xsl:if test="marc:subfield[@code='i']">
688                 <xsl:call-template name="subfieldSelect">
689                     <xsl:with-param name="codes">i</xsl:with-param>
690                 </xsl:call-template>
691                 <xsl:text>: </xsl:text>
692             </xsl:if>
693             <a>
694             <xsl:choose>
695             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
696                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
697             </xsl:when>
698             <xsl:otherwise>
699                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
700             </xsl:otherwise>
701             </xsl:choose>
702             <xsl:call-template name="subfieldSelect">
703                 <xsl:with-param name="codes">a_t</xsl:with-param>
704             </xsl:call-template>
705             </a>
706             <xsl:choose>
707                 <xsl:when test="position()=last()"></xsl:when>
708                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
709             </xsl:choose>
710         </xsl:for-each>
711         </span>
712         </xsl:if>
713
714         <!-- 780 -->
715         <xsl:if test="marc:datafield[@tag=780]">
716         <xsl:for-each select="marc:datafield[@tag=780]">
717         <xsl:if test="@ind1=0">
718         <span class="results_summary preceeding_entry">
719         <xsl:choose>
720         <xsl:when test="@ind2=0">
721             <span class="label">Continues:</span>
722         </xsl:when>
723         <xsl:when test="@ind2=1">
724             <span class="label">Continues in part:</span>
725         </xsl:when>
726         <xsl:when test="@ind2=2">
727             <span class="label">Supersedes:</span>
728         </xsl:when>
729         <xsl:when test="@ind2=3">
730             <span class="label">Supersedes in part:</span>
731         </xsl:when>
732         <xsl:when test="@ind2=4">
733             <span class="label">Formed by the union: ... and: ...</span>
734         </xsl:when>
735         <xsl:when test="@ind2=5">
736             <span class="label">Absorbed:</span>
737         </xsl:when>
738         <xsl:when test="@ind2=6">
739             <span class="label">Absorbed in part:</span>
740         </xsl:when>
741         <xsl:when test="@ind2=7">
742             <span class="label">Separated from:</span>
743         </xsl:when>
744         </xsl:choose>
745                 <xsl:variable name="f780">
746                     <xsl:call-template name="subfieldSelect">
747                         <xsl:with-param name="codes">at</xsl:with-param>
748                     </xsl:call-template>
749                 </xsl:variable>
750             <xsl:choose>
751                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
752                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
753                         <xsl:value-of select="translate($f780, '()', '')"/>
754                     </a>
755                 </xsl:when>
756                 <xsl:otherwise>
757                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
758                         <xsl:value-of select="translate($f780, '()', '')"/>
759                     </a>
760                 </xsl:otherwise>
761             </xsl:choose>
762         </span>
763
764         <xsl:if test="marc:subfield[@code='n']">
765             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
766         </xsl:if>
767
768         </xsl:if>
769         </xsl:for-each>
770         </xsl:if>
771
772         <!-- 785 -->
773         <xsl:if test="marc:datafield[@tag=785]">
774         <xsl:for-each select="marc:datafield[@tag=785]">
775         <span class="results_summary succeeding_entry">
776         <xsl:choose>
777         <xsl:when test="@ind2=0">
778             <span class="label">Continued by:</span>
779         </xsl:when>
780         <xsl:when test="@ind2=1">
781             <span class="label">Continued in part by:</span>
782         </xsl:when>
783         <xsl:when test="@ind2=2">
784             <span class="label">Superseded by:</span>
785         </xsl:when>
786         <xsl:when test="@ind2=3">
787             <span class="label">Superseded in part by:</span>
788         </xsl:when>
789         <xsl:when test="@ind2=4">
790             <span class="label">Absorbed by:</span>
791         </xsl:when>
792         <xsl:when test="@ind2=5">
793             <span class="label">Absorbed in part by:</span>
794         </xsl:when>
795         <xsl:when test="@ind2=6">
796             <span class="label">Split into .. and ...:</span>
797         </xsl:when>
798         <xsl:when test="@ind2=7">
799             <span class="label">Merged with ... to form ...</span>
800         </xsl:when>
801         <xsl:when test="@ind2=8">
802             <span class="label">Changed back to:</span>
803         </xsl:when>
804
805         </xsl:choose>
806                    <xsl:variable name="f785">
807                     <xsl:call-template name="subfieldSelect">
808                         <xsl:with-param name="codes">at</xsl:with-param>
809                     </xsl:call-template>
810                 </xsl:variable>
811
812             <xsl:choose>
813                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
814                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
815                         <xsl:value-of select="translate($f785, '()', '')"/>
816                     </a>
817                 </xsl:when>
818                 <xsl:otherwise>
819                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
820                         <xsl:value-of select="translate($f785, '()', '')"/>
821                     </a>
822                 </xsl:otherwise>
823             </xsl:choose>
824
825         </span>
826         </xsl:for-each>
827         </xsl:if>
828
829         <xsl:if test="$OPACBaseURL!=''">
830         <span class="results_summary"><span class="label">OPAC view: </span>
831             <a><xsl:attribute name="href">http://<xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
832         </span>
833         </xsl:if>
834
835        <xsl:if test="marc:datafield[@tag=942]">
836         <span class="results_summary local"><span class="label">Old Callnumber: </span>
837         <xsl:for-each select="marc:datafield[@tag=942]">
838                     <xsl:if test="marc:subfield[@code='d']">
839                         <xsl:text> </xsl:text>
840                         <xsl:call-template name="subfieldSelect">
841                             <xsl:with-param name="codes">d</xsl:with-param>
842                         </xsl:call-template>
843                     </xsl:if>
844         </xsl:for-each>
845         </span>
846         </xsl:if>
847
848     </xsl:template>
849
850     <xsl:template name="nameABCDQ">
851             <xsl:call-template name="chopPunctuation">
852                 <xsl:with-param name="chopString">
853                     <xsl:call-template name="subfieldSelect">
854                         <xsl:with-param name="codes">aq</xsl:with-param>
855                     </xsl:call-template>
856                 </xsl:with-param>
857                 <xsl:with-param name="punctuation">
858                     <xsl:text>:,;/ </xsl:text>
859                 </xsl:with-param>
860             </xsl:call-template>
861         <xsl:call-template name="termsOfAddress"/>
862     </xsl:template>
863
864     <xsl:template name="nameABCDN">
865         <xsl:for-each select="marc:subfield[@code='a']">
866                 <xsl:call-template name="chopPunctuation">
867                     <xsl:with-param name="chopString" select="."/>
868                 </xsl:call-template>
869         </xsl:for-each>
870         <xsl:for-each select="marc:subfield[@code='b']">
871             <xsl:value-of select="."/>
872             <xsl:choose>
873                 <xsl:when test="position() != last()">
874                     <xsl:text> -- </xsl:text>
875                 </xsl:when>
876             </xsl:choose>
877         </xsl:for-each>
878         <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
879                 <xsl:call-template name="subfieldSelect">
880                     <xsl:with-param name="codes">cdn</xsl:with-param>
881                 </xsl:call-template>
882         </xsl:if>
883     </xsl:template>
884
885     <xsl:template name="nameACDEQ">
886             <xsl:call-template name="subfieldSelect">
887                 <xsl:with-param name="codes">acdeq</xsl:with-param>
888             </xsl:call-template>
889     </xsl:template>
890     <xsl:template name="termsOfAddress">
891         <xsl:if test="marc:subfield[@code='b' or @code='c']">
892             <xsl:call-template name="chopPunctuation">
893                 <xsl:with-param name="chopString">
894                     <xsl:call-template name="subfieldSelect">
895                         <xsl:with-param name="codes">bc</xsl:with-param>
896                     </xsl:call-template>
897                 </xsl:with-param>
898             </xsl:call-template>
899         </xsl:if>
900     </xsl:template>
901
902     <xsl:template name="part">
903         <xsl:variable name="partNumber">
904             <xsl:call-template name="specialSubfieldSelect">
905                 <xsl:with-param name="axis">n</xsl:with-param>
906                 <xsl:with-param name="anyCodes">n</xsl:with-param>
907                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
908             </xsl:call-template>
909         </xsl:variable>
910         <xsl:variable name="partName">
911             <xsl:call-template name="specialSubfieldSelect">
912                 <xsl:with-param name="axis">p</xsl:with-param>
913                 <xsl:with-param name="anyCodes">p</xsl:with-param>
914                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
915             </xsl:call-template>
916         </xsl:variable>
917         <xsl:if test="string-length(normalize-space($partNumber))">
918                 <xsl:call-template name="chopPunctuation">
919                     <xsl:with-param name="chopString" select="$partNumber"/>
920                 </xsl:call-template>
921         </xsl:if>
922         <xsl:if test="string-length(normalize-space($partName))">
923                 <xsl:call-template name="chopPunctuation">
924                     <xsl:with-param name="chopString" select="$partName"/>
925                 </xsl:call-template>
926         </xsl:if>
927     </xsl:template>
928
929     <xsl:template name="specialSubfieldSelect">
930         <xsl:param name="anyCodes"/>
931         <xsl:param name="axis"/>
932         <xsl:param name="beforeCodes"/>
933         <xsl:param name="afterCodes"/>
934         <xsl:variable name="str">
935             <xsl:for-each select="marc:subfield">
936                 <xsl:if test="contains($anyCodes, @code)      or (contains($beforeCodes,@code) and following-sibling::marc:subfield[@code=$axis])      or (contains($afterCodes,@code) and preceding-sibling::marc:subfield[@code=$axis])">
937                     <xsl:value-of select="text()"/>
938                     <xsl:text> </xsl:text>
939                 </xsl:if>
940             </xsl:for-each>
941         </xsl:variable>
942         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
943     </xsl:template>
944
945     <xsl:template name="showAuthor">
946         <xsl:param name="authorfield"/>
947     <xsl:param name="UseAuthoritiesForTracings"/>
948         <xsl:if test="count($authorfield)&gt;0">
949         <h5 class="author">
950         <xsl:for-each select="$authorfield">
951         <!--
952         <xsl:choose>
953           <xsl:when test="position()&gt;1"/>
954           <xsl:when test="@tag&lt;700">Author(s): </xsl:when>
955           <xsl:otherwise>Additional author(s): </xsl:otherwise>
956         </xsl:choose>
957         -->
958         <a>
959         <xsl:choose>
960             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
961                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
962             </xsl:when>
963             <xsl:otherwise>
964             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
965             </xsl:otherwise>
966         </xsl:choose>
967         <xsl:choose>
968           <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when>
969           <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
970           <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
971         </xsl:choose>
972         <!-- add relator code too between brackets-->
973         <xsl:if test="marc:subfield[@code='4' or @code='e']">
974       <span class="relatorcode">
975       <xsl:text> [</xsl:text>
976           <xsl:choose>
977             <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
978             <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
979           </xsl:choose>
980           <xsl:text>]</xsl:text>
981       </span>
982         </xsl:if>
983         </a>
984         <xsl:choose>
985           <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
986         </xsl:choose>
987         </xsl:for-each>
988         </h5>
989         </xsl:if>
990     </xsl:template>
991
992 </xsl:stylesheet>