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