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