Bug 27022: Publisher number 028 does not display according to framework settings
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / MARC21slim2intranetDetail.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE stylesheet>
4
5 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
6 <!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com  -->
7 <xsl:stylesheet version="1.0"
8   xmlns:marc="http://www.loc.gov/MARC21/slim"
9   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10   xmlns:str="http://exslt.org/strings"
11   exclude-result-prefixes="marc str">
12     <xsl:import href="MARC21slimUtils.xsl"/>
13     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14     <xsl:template match="/">
15             <xsl:apply-templates/>
16     </xsl:template>
17
18     <xsl:template match="marc:record">
19
20         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22         <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
23         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
24         <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
25         <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
26         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
27         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
28         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
29         <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
30         <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
31         <xsl:variable name="TracingQuotesLeft">
32            <xsl:choose>
33              <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
34              <xsl:otherwise>"</xsl:otherwise>
35            </xsl:choose>
36         </xsl:variable>
37         <xsl:variable name="TracingQuotesRight">
38           <xsl:choose>
39             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
40             <xsl:otherwise>"</xsl:otherwise>
41           </xsl:choose>
42         </xsl:variable>
43
44         <xsl:variable name="leader" select="marc:leader"/>
45         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
46         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
47         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
48         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
49         <xsl:variable name="materialTypeCode">
50             <xsl:choose>
51                 <xsl:when test="$leader19='a'">ST</xsl:when>
52                 <xsl:when test="$leader6='a'">
53                     <xsl:choose>
54                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
55                         <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
56                         <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
57                     </xsl:choose>
58                 </xsl:when>
59                 <xsl:when test="$leader6='t'">BK</xsl:when>
60                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
61                 <xsl:when test="$leader6='m'">CF</xsl:when>
62                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
63                 <xsl:when test="$leader6='g'">VM</xsl:when>
64                 <xsl:when test="$leader6='k'">PK</xsl:when>
65                 <xsl:when test="$leader6='r'">OB</xsl:when>
66                 <xsl:when test="$leader6='i'">MU</xsl:when>
67                 <xsl:when test="$leader6='j'">MU</xsl:when>
68                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
69             </xsl:choose>
70         </xsl:variable>
71         <xsl:variable name="materialTypeLabel">
72             <xsl:choose>
73                 <xsl:when test="$leader19='a'">Set</xsl:when>
74                 <xsl:when test="$leader6='a'">
75                     <xsl:choose>
76                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Text</xsl:when>
77                         <xsl:when test="$leader7='i' or $leader7='s'">
78                             <xsl:choose>
79                                 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing resource</xsl:when>
80                                 <xsl:otherwise>Series</xsl:otherwise>
81                             </xsl:choose>
82                         </xsl:when>
83                         <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
84                     </xsl:choose>
85                 </xsl:when>
86                 <xsl:when test="$leader6='t'">Text</xsl:when>
87                 <xsl:when test="$leader6='o'">Kit</xsl:when>
88                 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
89                 <xsl:when test="$leader6='m'">Computer file</xsl:when>
90                 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
91                 <xsl:when test="$leader6='g'">Film</xsl:when>
92                 <xsl:when test="$leader6='k'">Picture</xsl:when>
93                 <xsl:when test="$leader6='r'">Object</xsl:when>
94                 <xsl:when test="$leader6='j'">Music</xsl:when>
95                 <xsl:when test="$leader6='i'">Sound</xsl:when>
96                 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
97             </xsl:choose>
98         </xsl:variable>
99
100         <!-- Indicate if record is suppressed in OPAC -->
101         <xsl:if test="$OpacSuppression = 1">
102             <xsl:if test="marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']">
103                 <span class="results_summary suppressed_opac">Suppressed in OPAC</span>
104             </xsl:if>
105         </xsl:if>
106
107         <!-- Title Statement -->
108         <!-- Alternate Graphic Representation (MARC 880) -->
109         <xsl:if test="$display880">
110             <h1 class="title">
111                 <xsl:call-template name="m880Select">
112                     <xsl:with-param name="basetags">245</xsl:with-param>
113                     <xsl:with-param name="codes">abhfgknps</xsl:with-param>
114                 </xsl:call-template>
115             </h1>
116         </xsl:if>
117
118         <!--Bug 13381 -->
119         <xsl:if test="marc:datafield[@tag=245]">
120             <h1 class="title" property="name">
121                 <xsl:for-each select="marc:datafield[@tag=245]">
122                     <xsl:call-template name="subfieldSelect">
123                         <xsl:with-param name="codes">a</xsl:with-param>
124                     </xsl:call-template>
125                     <xsl:text> </xsl:text>
126                     <!-- 13381 add additional subfields-->
127                     <!-- bz 17625 adding subfields f and g -->
128                     <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
129                         <xsl:choose>
130                             <xsl:when test="@code='h'">
131                                 <!--  13381 Span class around subfield h so it can be suppressed via css -->
132                                 <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
133                             </xsl:when>
134                             <xsl:when test="@code='c'">
135                                 <!--  13381 Span class around subfield c so it can be suppressed via css -->
136                                 <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
137                             </xsl:when>
138                             <xsl:otherwise>
139                                 <xsl:apply-templates/>
140                                 <xsl:text> </xsl:text>
141                             </xsl:otherwise>
142                         </xsl:choose>
143                     </xsl:for-each>
144                 </xsl:for-each>
145             </h1>
146         </xsl:if>
147
148         <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
149         <xsl:if test="$display880">
150             <h5 class="author">
151                 <xsl:call-template name="m880Select">
152                     <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
153                     <xsl:with-param name="codes">abc</xsl:with-param>
154                     <xsl:with-param name="index">au</xsl:with-param>
155                     <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
156                     <!-- do not use label 'by ' here, it would be repeated for every occurrence of 100,110,111,700,710,711 -->
157                 </xsl:call-template>
158             </h5>
159         </xsl:if>
160
161         <!-- Author Statement -->
162         <xsl:call-template name="showAuthor">
163             <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/>
164             <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
165         </xsl:call-template>
166
167         <!-- #13382 Suppress 700$i and 7xx/@ind2=2 -->
168         <xsl:call-template name="showAuthor">
169             <xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
170             <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
171         </xsl:call-template>
172
173     <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
174         <span class="results_summary type"><span class="label">Material type: </span>
175     <xsl:element name="img"><xsl:attribute name="class">materialtype mt_icon_<xsl:value-of select="$materialTypeCode"/></xsl:attribute><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>
176         <xsl:text> </xsl:text>
177         <xsl:value-of select="$materialTypeLabel"/>
178         </span>
179     </xsl:if>
180
181     <xsl:call-template name="show-lang-041"/>
182
183         <!--Series: Alternate Graphic Representation (MARC 880) -->
184         <xsl:if test="$display880">
185             <xsl:call-template name="m880Select">
186                 <xsl:with-param name="basetags">440,490</xsl:with-param>
187                 <xsl:with-param name="codes">av</xsl:with-param>
188                 <xsl:with-param name="class">results_summary series</xsl:with-param>
189                 <xsl:with-param name="label">Series: </xsl:with-param>
190                 <xsl:with-param name="index">se</xsl:with-param>
191             </xsl:call-template>
192         </xsl:if>
193
194     <xsl:call-template name="show-series">
195         <xsl:with-param name="searchurl">/cgi-bin/koha/catalogue/search.pl</xsl:with-param>
196         <xsl:with-param name="UseControlNumber" select="$UseControlNumber"/>
197         <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
198     </xsl:call-template>
199
200         <!-- Analytics information -->
201         <xsl:variable name="leader7_class">
202             <xsl:choose>
203                 <!--xsl:when test="$leader7='a'">analytic_mcp</xsl:when-->
204                 <!--xsl:when test="$leader7='b'">analytic_scp</xsl:when-->
205                 <xsl:when test="$leader7='c'">analytic_collection</xsl:when>
206                 <xsl:when test="$leader7='d'">analytic_subunit</xsl:when>
207                 <xsl:when test="$leader7='i'">analytic_ires</xsl:when>
208                 <xsl:when test="$leader7='m'">analytic_monograph</xsl:when>
209                 <xsl:when test="$leader7='s'">analytic_serial</xsl:when>
210                 <xsl:otherwise>analytic_undefined</xsl:otherwise>
211             </xsl:choose>
212         </xsl:variable>
213
214         <xsl:variable name="show_analytics_link" select="marc:variables/marc:variable[@name='show_analytics_link']" />
215         <xsl:if test="$show_analytics_link='1'">
216             <xsl:element name="span">
217                 <xsl:attribute name="class">results_summary analytics <xsl:value-of select="$leader7_class"/></xsl:attribute>
218                 <span class="label">Analytics: </span>
219                 <a>
220                 <xsl:choose>
221                     <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
222                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+AND+(bib-level:a+OR+bib-level:b)</xsl:attribute>
223                     </xsl:when>
224                     <xsl:otherwise>
225                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
226                     </xsl:otherwise>
227                 </xsl:choose>
228                 <xsl:text>Show analytics</xsl:text>
229                 </a>
230             </xsl:element>
231         </xsl:if>
232
233         <!-- Volumes of sets and traced series -->
234         <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
235         <span class="results_summary volumes"><span class="label">Volumes: </span>
236             <a>
237             <xsl:choose>
238             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
239                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+NOT+(bib-level:a+OR+bib-level:b)</xsl:attribute>
240             </xsl:when>
241             <xsl:otherwise>
242                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute>
243             </xsl:otherwise>
244             </xsl:choose>
245             <xsl:text>Show volumes</xsl:text>
246             </a>
247         </span>
248         </xsl:if>
249
250         <!-- Set -->
251         <xsl:if test="$leader19='c'">
252         <span class="results_summary set"><span class="label">Set: </span>
253         <xsl:for-each select="marc:datafield[@tag=773]">
254             <a>
255             <xsl:choose>
256             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
257                 <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>
258             </xsl:when>
259             <xsl:otherwise>
260                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', ''), true())"/></xsl:attribute>
261             </xsl:otherwise>
262             </xsl:choose>
263             <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
264             </a>
265             <xsl:choose>
266                 <xsl:when test="position()=last()"></xsl:when>
267                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
268             </xsl:choose>
269         </xsl:for-each>
270         </span>
271         </xsl:if>
272
273         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
274         <xsl:if test="$display880">
275             <xsl:call-template name="m880Select">
276                 <xsl:with-param name="basetags">260</xsl:with-param>
277                 <xsl:with-param name="codes">abcg</xsl:with-param>
278                 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
279                 <xsl:with-param name="label">Publication details: </xsl:with-param>
280             </xsl:call-template>
281         </xsl:if>
282
283         <!-- Publisher info and RDA related info from tags 260, 264 -->
284         <xsl:choose>
285             <xsl:when test="marc:datafield[@tag=264]">
286                 <xsl:call-template name="showRDAtag264">
287                    <xsl:with-param name="show_url">1</xsl:with-param>
288                 </xsl:call-template>
289             </xsl:when>
290             <xsl:when test="marc:datafield[@tag=260]">
291                 <span class="results_summary publisher"><span class="label">Publication details: </span>
292                     <xsl:for-each select="marc:datafield[@tag=260]">
293                         <xsl:if test="marc:subfield[@code='a']">
294                             <xsl:call-template name="subfieldSelect">
295                                 <xsl:with-param name="codes">a</xsl:with-param>
296                             </xsl:call-template>
297                         </xsl:if>
298                         <xsl:text> </xsl:text>
299                         <xsl:if test="marc:subfield[@code='b']">
300                         <a>
301                             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/>"</xsl:attribute>
302                             <xsl:call-template name="subfieldSelect">
303                                 <xsl:with-param name="codes">b</xsl:with-param>
304                             </xsl:call-template>
305                        </a>
306                        </xsl:if>
307                        <xsl:text> </xsl:text>
308                         <xsl:call-template name="chopPunctuation">
309                           <xsl:with-param name="chopString">
310                             <xsl:call-template name="subfieldSelect">
311                                 <xsl:with-param name="codes">cg</xsl:with-param>
312                             </xsl:call-template>
313                            </xsl:with-param>
314                        </xsl:call-template>
315                             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
316                     </xsl:for-each>
317                 </span>
318             </xsl:when>
319         </xsl:choose>
320
321         <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
322         <xsl:if test="$display880">
323             <xsl:call-template name="m880Select">
324                 <xsl:with-param name="basetags">250</xsl:with-param>
325                 <xsl:with-param name="codes">ab</xsl:with-param>
326                 <xsl:with-param name="class">results_summary edition</xsl:with-param>
327                 <xsl:with-param name="label">Edition: </xsl:with-param>
328             </xsl:call-template>
329         </xsl:if>
330         
331         <xsl:if test="marc:datafield[@tag=250]">
332         <span class="results_summary edition"><span class="label">Edition: </span>
333             <xsl:for-each select="marc:datafield[@tag=250]">
334                 <xsl:call-template name="chopPunctuation">
335                   <xsl:with-param name="chopString">
336                     <xsl:call-template name="subfieldSelect">
337                         <xsl:with-param name="codes">ab</xsl:with-param>
338                     </xsl:call-template>
339                    </xsl:with-param>
340                </xsl:call-template>
341                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
342             </xsl:for-each>
343         </span>
344         </xsl:if>
345
346         <!-- Description: Alternate Graphic Representation (MARC 880) -->
347         <xsl:if test="$display880">
348             <xsl:call-template name="m880Select">
349                 <xsl:with-param name="basetags">300</xsl:with-param>
350                 <xsl:with-param name="codes">abceg</xsl:with-param>
351                 <xsl:with-param name="class">results_summary description</xsl:with-param>
352                 <xsl:with-param name="label">Description: </xsl:with-param>
353             </xsl:call-template>
354         </xsl:if>
355         
356         <xsl:if test="marc:datafield[@tag=300]">
357         <span class="results_summary description"><span class="label">Description: </span>
358             <xsl:for-each select="marc:datafield[@tag=300]">
359                 <xsl:call-template name="chopPunctuation">
360                   <xsl:with-param name="chopString">
361                     <xsl:call-template name="subfieldSelect">
362                         <xsl:with-param name="codes">abcefg</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         <!-- Content Type -->
372         <xsl:if test="marc:datafield[@tag=336] or marc:datafield[@tag=337] or marc:datafield[@tag=338]">
373             <span class="results_summary" id="content_type">
374                 <xsl:if test="marc:datafield[@tag=336]">
375                     <span class="label">Content type: </span>
376                     <xsl:for-each select="marc:datafield[@tag=336]">
377                         <xsl:call-template name="subfieldSelect">
378                             <xsl:with-param name="codes">a</xsl:with-param>
379                             <xsl:with-param name="delimeter">, </xsl:with-param>
380                         </xsl:call-template>
381                         <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
382                     </xsl:for-each>
383                 </xsl:if>
384                 <xsl:text> </xsl:text>
385                 <!-- Media Type -->
386                 <xsl:if test="marc:datafield[@tag=337]">
387                     <span class="label">Media type: </span>
388                     <xsl:for-each select="marc:datafield[@tag=337]">
389                         <xsl:call-template name="subfieldSelect">
390                             <xsl:with-param name="codes">a</xsl:with-param>
391                             <xsl:with-param name="delimeter">, </xsl:with-param>
392                         </xsl:call-template>
393                         <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
394                     </xsl:for-each>
395                 </xsl:if>
396                 <xsl:text> </xsl:text>
397                 <!-- Media Type -->
398                 <xsl:if test="marc:datafield[@tag=338]">
399                     <span class="label">Carrier type: </span>
400                     <xsl:for-each select="marc:datafield[@tag=338]">
401                         <xsl:call-template name="subfieldSelect">
402                             <xsl:with-param name="codes">a</xsl:with-param>
403                             <xsl:with-param name="delimeter">, </xsl:with-param>
404                         </xsl:call-template>
405                         <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
406                     </xsl:for-each>
407                 </xsl:if>
408             </span>
409         </xsl:if>
410
411         <!-- 385 - Audience -->
412         <xsl:if test="marc:datafield[@tag=385]">
413             <span class="results_summary audience">
414                 <span class="label">Audience: </span>
415                 <xsl:for-each select="marc:datafield[@tag=385]">
416                     <xsl:if test="marc:subfield[@code='m']">
417                         <xsl:call-template name="chopPunctuation">
418                             <xsl:with-param name="chopString">
419                                 <xsl:call-template name="subfieldSelect">
420                                     <xsl:with-param name="codes">m</xsl:with-param>
421                                 </xsl:call-template>
422                             </xsl:with-param>
423                         </xsl:call-template>
424                         <xsl:text>: </xsl:text>
425                     </xsl:if>
426                         <xsl:call-template name="chopPunctuation">
427                             <xsl:with-param name="chopString">
428                                 <xsl:call-template name="subfieldSelect">
429                                     <xsl:with-param name="codes">a</xsl:with-param>
430                                     <xsl:with-param name="delimeter">, </xsl:with-param>
431                                 </xsl:call-template>
432                             </xsl:with-param>
433                         </xsl:call-template>
434                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> | </xsl:text></xsl:otherwise></xsl:choose>
435                 </xsl:for-each>
436             </span>
437         </xsl:if>
438
439         <xsl:call-template name="showISBNISSN"/>
440
441         <xsl:if test="marc:datafield[@tag=013]">
442             <span class="results_summary patent_info">
443                 <span class="label">Patent information: </span>
444                 <xsl:for-each select="marc:datafield[@tag=013]">
445                     <xsl:call-template name="subfieldSelect">
446                         <xsl:with-param name="codes">acdef</xsl:with-param>
447                         <xsl:with-param name="delimeter">, </xsl:with-param>
448                     </xsl:call-template>
449                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
450                 </xsl:for-each>
451             </span>
452         </xsl:if>
453
454         <xsl:if test="marc:datafield[@tag=088]">
455             <span class="results_summary report_number">
456                 <span class="label">Report number: </span>
457                 <xsl:for-each select="marc:datafield[@tag=088]">
458                     <xsl:call-template name="subfieldSelect">
459                         <xsl:with-param name="codes">a</xsl:with-param>
460                     </xsl:call-template>
461                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
462                 </xsl:for-each>
463             </span>
464         </xsl:if>
465
466         <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
467         <xsl:if test="$display880">
468             <xsl:call-template name="m880Select">
469                 <xsl:with-param name="basetags">246</xsl:with-param>
470                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
471                 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
472                 <xsl:with-param name="label">Other title: </xsl:with-param>
473             </xsl:call-template>
474         </xsl:if>
475
476         <xsl:if test="marc:datafield[@tag=246]">
477             <span class="results_summary other_title"><span class="label">Other title: </span>
478                 <xsl:for-each select="marc:datafield[@tag=246]">
479                     <xsl:if test="marc:subfield[@code='i']">
480                             <xsl:call-template name="subfieldSelect">
481                                     <xsl:with-param name="codes">i</xsl:with-param>
482                             </xsl:call-template>
483                     </xsl:if>
484                        <xsl:text> </xsl:text>
485                     <xsl:call-template name="chopPunctuation">
486                         <xsl:with-param name="chopString">
487                             <xsl:call-template name="subfieldSelect">
488                                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
489                             </xsl:call-template>
490                         </xsl:with-param>
491                     </xsl:call-template>
492                     <xsl:if test="@ind1=1 and not(marc:subfield[@code='i'])">
493                         <xsl:choose>
494                             <xsl:when test="@ind2=0"> [Portion of title]</xsl:when>
495                             <xsl:when test="@ind2=1"> [Parallel title]</xsl:when>
496                             <xsl:when test="@ind2=2"> [Distinctive title]</xsl:when>
497                             <xsl:when test="@ind2=3"> [Other title]</xsl:when>
498                             <xsl:when test="@ind2=4"> [Cover title]</xsl:when>
499                             <xsl:when test="@ind2=5"> [Added title page title]</xsl:when>
500                             <xsl:when test="@ind2=6"> [Caption title]</xsl:when>
501                             <xsl:when test="@ind2=7"> [Running title]</xsl:when>
502                             <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
503                         </xsl:choose>
504                     </xsl:if>
505                     <!-- #13386 added separator | -->
506                     <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>
507                 </xsl:for-each>
508             </span>
509         </xsl:if>
510
511         <xsl:if test="marc:datafield[@tag=242]">
512         <span class="results_summary translated_title"><span class="label">Title translated: </span>
513             <xsl:for-each select="marc:datafield[@tag=242]">
514                 <xsl:call-template name="chopPunctuation">
515                   <xsl:with-param name="chopString">
516                     <xsl:call-template name="subfieldSelect">
517                         <xsl:with-param name="codes">abchnp</xsl:with-param>
518                     </xsl:call-template>
519                    </xsl:with-param>
520                </xsl:call-template>
521                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
522             </xsl:for-each>
523         </span>
524        </xsl:if>
525
526         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
527         <xsl:if test="$display880">
528             <xsl:call-template name="m880Select">
529                 <xsl:with-param name="basetags">130,240</xsl:with-param>
530                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
531                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
532                 <xsl:with-param name="label">Uniform title: </xsl:with-param>
533             </xsl:call-template>
534         </xsl:if>
535
536         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
537             <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
538                 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
539                     <xsl:if test="marc:subfield[@code='i']">
540                             <xsl:call-template name="subfieldSelect">
541                                     <xsl:with-param name="codes">i</xsl:with-param>
542                             </xsl:call-template>
543                     </xsl:if>
544                     <xsl:text> </xsl:text>
545                     <xsl:for-each select="marc:subfield">
546                         <xsl:if test="contains('adfghklmnoprst',@code)">
547                             <xsl:value-of select="text()"/>
548                             <xsl:text> </xsl:text>
549                         </xsl:if>
550                     </xsl:for-each>
551                     <xsl:if test="position() != last()">
552                         <span class="separator"><xsl:text> | </xsl:text></span>
553                     </xsl:if>
554                 </xsl:for-each>
555             </span>
556         </xsl:if>
557
558         <!-- #13382 Added Related works 700$i -->
559         <xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
560             <span class="results_summary related_works"><span class="label">Related works: </span>
561                 <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
562                     <xsl:variable name="str">
563                         <xsl:call-template name="subfieldSelect">
564                             <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
565                         </xsl:call-template>
566                     </xsl:variable>
567                     <xsl:call-template name="chopPunctuation">
568                         <xsl:with-param name="chopString">
569                             <xsl:value-of select="$str"/>
570                         </xsl:with-param>
571                     </xsl:call-template>
572                     <!-- add relator code too between brackets-->
573                     <xsl:if test="marc:subfield[@code='4' or @code='e']">
574                         <span class="relatorcode">
575                             <xsl:text> [</xsl:text>
576                             <xsl:choose>
577                                 <xsl:when test="marc:subfield[@code='e']">
578                                     <xsl:for-each select="marc:subfield[@code='e']">
579                                         <xsl:value-of select="."/>
580                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
581                                     </xsl:for-each>
582                                 </xsl:when>
583                                 <xsl:otherwise>
584                                     <xsl:for-each select="marc:subfield[@code='4']">
585                                         <xsl:value-of select="."/>
586                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
587                                     </xsl:for-each>
588                                 </xsl:otherwise>
589                             </xsl:choose>
590                             <xsl:text>]</xsl:text>
591                         </span>
592                     </xsl:if>
593                     <xsl:choose>
594                         <xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
595                     </xsl:choose>
596                 </xsl:for-each>
597             </span>
598         </xsl:if>
599
600         <!-- #13382 Added Contained Works 7xx@ind2=2 -->
601         <xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
602             <span class="results_summary contained_works"><span class="label">Contained works: </span>
603                 <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
604                     <xsl:variable name="str">
605                         <xsl:call-template name="subfieldSelect">
606                             <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
607                         </xsl:call-template>
608                     </xsl:variable>
609                     <xsl:call-template name="chopPunctuation">
610                         <xsl:with-param name="chopString">
611                             <xsl:value-of select="$str"/>
612                         </xsl:with-param>
613                     </xsl:call-template>
614                     <!-- add relator code too between brackets-->
615                     <xsl:if test="marc:subfield[@code='4' or @code='e']">
616                         <span class="relatorcode">
617                             <xsl:text> [</xsl:text>
618                             <xsl:choose>
619                                 <xsl:when test="marc:subfield[@code='e']">
620                                     <xsl:for-each select="marc:subfield[@code='e']">
621                                         <xsl:value-of select="."/>
622                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
623                                     </xsl:for-each>
624                                 </xsl:when>
625                                 <xsl:otherwise>
626                                     <xsl:for-each select="marc:subfield[@code='4']">
627                                         <xsl:value-of select="."/>
628                                         <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
629                                     </xsl:for-each>
630                                 </xsl:otherwise>
631                             </xsl:choose>
632                             <xsl:text>]</xsl:text>
633                         </span>
634                     </xsl:if>
635                     <xsl:choose>
636                         <xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
637                     </xsl:choose>
638                 </xsl:for-each>
639             </span>
640         </xsl:if>
641
642
643         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
644             <span class="results_summary subjects"><span class="label">Subject(s): </span>
645             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
646             <a>
647             <xsl:choose>
648             <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
649             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
650                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
651             </xsl:when>
652             <xsl:when test="$TraceSubjectSubdivisions='1'">
653                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject">
654                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
655                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
656                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
657                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
658                         <xsl:with-param name="urlencode">1</xsl:with-param>
659                     </xsl:call-template>
660                 </xsl:attribute>
661             </xsl:when>
662
663             <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
664             <xsl:otherwise>
665                 <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="str:encode-uri(translate(marc:subfield[@code='a'],'()',''), true())"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
666             </xsl:otherwise>
667             </xsl:choose>
668
669             <xsl:call-template name="chopPunctuation">
670                 <xsl:with-param name="chopString">
671                     <xsl:call-template name="subfieldSelect">
672                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
673                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
674                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
675                     </xsl:call-template>
676                 </xsl:with-param>
677             </xsl:call-template>
678             </a>
679
680             <xsl:if test="marc:subfield[@code=9]">
681                 <xsl:text> </xsl:text>
682                 <a class='authlink'>
683                     <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
684                     <xsl:element name="img">
685                         <xsl:attribute name="src">/intranet-tmpl/prog/img/filefind.png</xsl:attribute>
686                         <xsl:attribute name="alt"></xsl:attribute>
687                         <xsl:attribute name="height">15</xsl:attribute>
688                         <xsl:attribute name="width">15</xsl:attribute>
689                     </xsl:element>
690                 </a>
691             </xsl:if>
692
693             <xsl:choose>
694             <xsl:when test="position()=last()"></xsl:when>
695             <xsl:otherwise> | </xsl:otherwise>
696             </xsl:choose>
697
698             </xsl:for-each>
699             </span>
700         </xsl:if>
701
702         <!-- Genre/Form -->
703         <xsl:if test="marc:datafield[@tag=655]">
704             <span class="results_summary genre"><span class="label">Genre/Form: </span>
705                 <xsl:for-each select="marc:datafield[@tag=655]">
706                     <a>
707                         <xsl:choose>
708                             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
709                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
710                             </xsl:when>
711                             <xsl:when test="$TraceSubjectSubdivisions='1'">
712                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
713                                     <xsl:with-param name="codes">avxyz</xsl:with-param>
714                                     <xsl:with-param name="delimeter"> AND </xsl:with-param>
715                                     <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
716                                     <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
717                                     <xsl:with-param name="urlencode">1</xsl:with-param>
718                                 </xsl:call-template>
719                                 </xsl:attribute>
720                             </xsl:when>
721                             <xsl:otherwise>
722                                 <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>
723                             </xsl:otherwise>
724                         </xsl:choose>
725                     <xsl:call-template name="subfieldSelect">
726                         <xsl:with-param name="codes">avxyz</xsl:with-param>
727                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
728                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
729                     </xsl:call-template>
730                     </a>
731
732                     <xsl:if test="marc:subfield[@code=9]">
733                         <xsl:text> </xsl:text>
734                         <a class='authlink'>
735                             <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
736                             <xsl:element name="img">
737                                 <xsl:attribute name="src">/intranet-tmpl/prog/img/filefind.png</xsl:attribute>
738                                 <xsl:attribute name="alt"></xsl:attribute>
739                                 <xsl:attribute name="height">15</xsl:attribute>
740                                 <xsl:attribute name="width">15</xsl:attribute>
741                             </xsl:element>
742                         </a>
743                     </xsl:if>
744                     <xsl:if test="position()!=last()"><span class="separator"> | </span></xsl:if>
745                 </xsl:for-each>
746             </span>
747         </xsl:if>
748
749 <!-- MARC21 776 Additional Physical Form Entry -->
750     <xsl:if test="marc:datafield[@tag=776]">
751         <span class="results_summary add_physical_form">
752             <span class="label">Additional physical formats: </span>
753             <xsl:for-each select="marc:datafield[@tag=776]">
754                 <xsl:variable name="linktext">
755                     <xsl:choose>
756                     <xsl:when test="marc:subfield[@code='t']">
757                         <xsl:value-of select="marc:subfield[@code='t']"/>
758                     </xsl:when>
759                     <xsl:when test="marc:subfield[@code='a']">
760                         <xsl:value-of select="marc:subfield[@code='a']"/>
761                     </xsl:when>
762                     <xsl:otherwise>
763                         <xsl:text>No title</xsl:text>
764                     </xsl:otherwise>
765                     </xsl:choose>
766                 </xsl:variable>
767                 <xsl:if test="@ind2=8 and marc:subfield[@code='i']">
768                     <xsl:call-template name="subfieldSelect">
769                         <xsl:with-param name="codes">i</xsl:with-param>
770                     </xsl:call-template>
771                     <xsl:text>: </xsl:text>
772                 </xsl:if>
773                 <xsl:choose>
774                 <xsl:when test="marc:subfield[@code='w']">
775                     <a>
776                     <xsl:attribute name="href">
777                         <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=control-number:</xsl:text>
778                         <xsl:call-template name="extractControlNumber">
779                             <xsl:with-param name="subfieldW">
780                                 <xsl:value-of select="marc:subfield[@code='w']"/>
781                             </xsl:with-param>
782                         </xsl:call-template>
783                     </xsl:attribute>
784                     <xsl:value-of select="$linktext"/>
785                     </a>
786                 </xsl:when>
787                 <xsl:otherwise>
788                     <xsl:value-of select="$linktext"/>
789                 </xsl:otherwise>
790                 </xsl:choose>
791                 <xsl:if test="position() != last()">
792                     <xsl:text>; </xsl:text>
793                 </xsl:if>
794             </xsl:for-each>
795         </span>
796     </xsl:if>
797
798 <!-- MARC21 777 - Issued With Entry -->
799     <xsl:if test="marc:datafield[@tag=777]">
800         <xsl:for-each select="marc:datafield[@tag=777]">
801             <xsl:if test="@ind1 != 1">
802                 <span class="results_summary issued_with">
803                     <span class="label">
804                         <xsl:choose>
805                             <xsl:when test="@ind2=8 and marc:subfield[@code='i']">
806                                 <xsl:value-of select="marc:subfield[@code='i']"/>
807                             </xsl:when>
808                             <xsl:otherwise>
809                                 <xsl:text>Issued with:</xsl:text>
810                             </xsl:otherwise>
811                         </xsl:choose>
812                         <xsl:text> </xsl:text>
813                     </span>
814                     <xsl:variable name="f777">
815                         <xsl:call-template name="chopPunctuation">
816                             <xsl:with-param name="chopString">
817                                 <xsl:call-template name="subfieldSelect">
818                                     <xsl:with-param name="codes">a_t</xsl:with-param>
819                                 </xsl:call-template>
820                             </xsl:with-param>
821                         </xsl:call-template>
822                     </xsl:variable>
823                     <xsl:choose>
824                         <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
825                             <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>
826                             <xsl:value-of select="translate($f777, '()', '')"/>
827                             </a>
828                         </xsl:when>
829                         <xsl:otherwise>
830                             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/></xsl:attribute>
831                             <xsl:value-of select="$f777"/>
832                             </a>
833                         </xsl:otherwise>
834                     </xsl:choose>
835                     <xsl:if test="marc:subfield[@code='g']">
836                         <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/>
837                     </xsl:if>
838                 </span>
839                 <xsl:if test="marc:subfield[@code='n']">
840                     <xsl:text> </xsl:text><span class="results_summary in_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
841                 </xsl:if>
842             </xsl:if>
843         </xsl:for-each>
844     </xsl:if>
845
846 <!-- Publisher or Distributor Number -->
847     <xsl:if test="marc:datafield[@tag=028]">
848         <span class="results_summary publisher_number ">
849             <span class="label">Publisher number: </span>
850             <xsl:for-each select="marc:datafield[@tag=028]">
851                 <xsl:call-template name="subfieldSelect">
852                     <xsl:with-param name="codes">abq</xsl:with-param>
853                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
854                 </xsl:call-template>
855             </xsl:for-each>
856         </span>
857     </xsl:if>
858
859 <!-- DDC classification -->
860     <xsl:if test="marc:datafield[@tag=082]">
861         <span class="results_summary ddc">
862             <span class="label">DDC classification: </span>
863             <xsl:for-each select="marc:datafield[@tag=082]">
864                 <xsl:call-template name="subfieldSelect">
865                     <xsl:with-param name="codes">a</xsl:with-param>
866                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
867                 </xsl:call-template>
868                 <xsl:choose>
869                     <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
870                     <xsl:otherwise> | </xsl:otherwise>
871                 </xsl:choose>
872             </xsl:for-each>
873         </span>
874     </xsl:if>
875
876 <!-- LOC classification -->
877     <xsl:if test="marc:datafield[@tag=050]">
878         <span class="results_summary loc">
879             <span class="label">LOC classification: </span>
880             <xsl:for-each select="marc:datafield[@tag=050]">
881                 <xsl:call-template name="subfieldSelect">
882                     <xsl:with-param name="codes">ab</xsl:with-param>
883                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
884                 </xsl:call-template>
885             </xsl:for-each>
886         </span>
887     </xsl:if>
888
889 <!-- NLM classification -->
890     <xsl:if test="marc:datafield[@tag=060]">
891         <span class="results_summary nlm">
892             <span class="label">NLM classification: </span>
893             <xsl:for-each select="marc:datafield[@tag=060]">
894                 <xsl:call-template name="subfieldSelect">
895                     <xsl:with-param name="codes">a</xsl:with-param>
896                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
897                 </xsl:call-template>
898                 <xsl:if test="not(position()=last())"><xsl:text> | </xsl:text></xsl:if>
899             </xsl:for-each>
900         </span>
901     </xsl:if>
902
903 <!-- Other classification -->
904     <xsl:if test="marc:datafield[@tag=084]">
905        <span class="results_summary oc">
906            <span class="label">Other classification: </span>
907           <xsl:for-each select="marc:datafield[@tag=084]">
908                 <xsl:call-template name="subfieldSelect">
909                    <xsl:with-param name="codes">a</xsl:with-param>
910                    <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
911                 </xsl:call-template>
912                 <xsl:choose>
913                    <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
914                    <xsl:otherwise> | </xsl:otherwise>
915                 </xsl:choose>
916           </xsl:for-each>
917        </span>
918     </xsl:if>
919
920     <xsl:if test="marc:datafield[@tag=856]">
921         <span class="results_summary online_resources"><span class="label">Online resources: </span>
922         <xsl:for-each select="marc:datafield[@tag=856]">
923             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
924             <a>
925                 <xsl:attribute name="href">
926                     <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
927                         <xsl:choose>
928                             <xsl:when test="@ind1=7">
929                                 <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
930                             </xsl:when>
931                             <xsl:when test="@ind1=1">
932                                 <xsl:text>ftp://</xsl:text>
933                             </xsl:when>
934                             <xsl:otherwise>
935                                 <xsl:text>http://</xsl:text>
936                             </xsl:otherwise>
937                         </xsl:choose>
938                     </xsl:if>
939                     <xsl:value-of select="marc:subfield[@code='u']"/>
940                 </xsl:attribute>
941                 <xsl:choose>
942                     <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')">
943                         <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>
944                     </xsl:when>
945                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
946                         <xsl:call-template name="subfieldSelect">
947                             <xsl:with-param name="codes">y3z</xsl:with-param>
948                         </xsl:call-template>
949                     </xsl:when>
950                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
951                         <xsl:choose>
952                             <xsl:when test="$URLLinkText!=''">
953                                 <xsl:value-of select="$URLLinkText"/>
954                             </xsl:when>
955                             <xsl:otherwise>
956                                 <xsl:text>Click here to access online</xsl:text>
957                             </xsl:otherwise>
958                         </xsl:choose>
959                     </xsl:when>
960                 </xsl:choose>
961             </a>
962             <xsl:choose>
963                 <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
964                 <xsl:otherwise> | </xsl:otherwise>
965             </xsl:choose>
966
967         </xsl:for-each>
968         </span>
969     </xsl:if>
970
971         <!-- 505 - Formatted contents note -->
972         <xsl:if test="marc:datafield[@tag=505]">
973             <div class="results_summary contents">
974             <xsl:choose>
975                 <xsl:when test="marc:datafield[@tag=505]/@ind1=0">
976                     <span class="label">Contents:</span>
977                 </xsl:when>
978                 <xsl:when test="marc:datafield[@tag=505]/@ind1=1">
979                     <span class="label">Incomplete contents:</span>
980                 </xsl:when>
981                 <xsl:when test="marc:datafield[@tag=505]/@ind1=2">
982                     <span class="label">Partial contents:</span>
983                 </xsl:when>
984             </xsl:choose>
985                 <xsl:for-each select="marc:datafield[@tag=505]">
986                     <div class='contentblock'>
987                         <xsl:choose>
988                         <xsl:when test="@ind2=0">
989                             <xsl:call-template name="subfieldSelectSpan">
990                                 <xsl:with-param name="newline">1</xsl:with-param>
991                                 <xsl:with-param name="codes">trug</xsl:with-param>
992                             </xsl:call-template>
993                         </xsl:when>
994                         <xsl:otherwise>
995                             <xsl:call-template name="subfieldSelectSpan">
996                                 <xsl:with-param name="newline">1</xsl:with-param>
997                                 <xsl:with-param name="codes">atrug</xsl:with-param>
998                             </xsl:call-template>
999                         </xsl:otherwise>
1000                         </xsl:choose>
1001                     </div>
1002                 </xsl:for-each>
1003             </div>
1004         </xsl:if>
1005
1006         <!-- 586 -->
1007         <xsl:if test="marc:datafield[@tag=586]">
1008             <span class="results_summary awardsnote">
1009                 <xsl:if test="marc:datafield[@tag=586]/@ind1=' '">
1010                     <span class="label">Awards: </span>
1011                 </xsl:if>
1012                 <xsl:for-each select="marc:datafield[@tag=586]">
1013                     <xsl:value-of select="marc:subfield[@code='a']"/>
1014                     <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1015                 </xsl:for-each>
1016             </span>
1017         </xsl:if>
1018
1019         <!-- 508 -->
1020         <xsl:if test="marc:datafield[@tag=508]">
1021             <span class="results_summary prod_credits">
1022                 <span class="label">Production credits: </span>
1023                 <xsl:for-each select="marc:datafield[@tag=508]">
1024                     <xsl:call-template name="subfieldSelectSpan">
1025                         <xsl:with-param name="codes">a</xsl:with-param>
1026                     </xsl:call-template>
1027                     <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1028                 </xsl:for-each>
1029             </span>
1030         </xsl:if>
1031
1032          <!-- 583 -->
1033          <xsl:if test="marc:datafield[@tag=583]">
1034             <span class="results_summary actionnote">
1035                 <span class="label">Action note: </span>
1036                 <xsl:for-each select="marc:datafield[@tag=583]">
1037                     <xsl:choose>
1038                         <xsl:when test="marc:subfield[@code='z']">
1039                             <xsl:value-of select="marc:subfield[@code='z']"/><xsl:text> </xsl:text>
1040                         </xsl:when>
1041                         <xsl:otherwise>
1042                             <xsl:call-template name="subfieldSelect">
1043                                 <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
1044                             </xsl:call-template>
1045                         </xsl:otherwise>
1046                     </xsl:choose>
1047                     <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
1048                 </xsl:for-each>
1049             </span>
1050          </xsl:if>
1051
1052         <!-- 773 -->
1053         <xsl:if test="marc:datafield[@tag=773]">
1054             <xsl:for-each select="marc:datafield[@tag=773]">
1055                 <xsl:if test="@ind1 !=1">
1056                     <span class="results_summary in"><span class="label">
1057                     <xsl:choose>
1058                         <xsl:when test="@ind2=' '">
1059                             In:
1060                         </xsl:when>
1061                         <xsl:when test="@ind2=8">
1062                             <xsl:if test="marc:subfield[@code='i']">
1063                                 <xsl:value-of select="marc:subfield[@code='i']"/>
1064                             </xsl:if>
1065                         </xsl:when>
1066                     </xsl:choose>
1067                     </span>
1068                     <xsl:variable name="f773">
1069                         <xsl:call-template name="chopPunctuation">
1070                             <xsl:with-param name="chopString">
1071                                 <xsl:call-template name="subfieldSelect">
1072                                     <xsl:with-param name="codes">a_t</xsl:with-param>
1073                                 </xsl:call-template>
1074                             </xsl:with-param>
1075                         </xsl:call-template>
1076                     </xsl:variable>
1077                     <xsl:choose>
1078                         <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1079                             <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>
1080                             <xsl:value-of select="translate($f773, '()', '')"/>
1081                             </a>
1082                         </xsl:when>
1083                         <xsl:when test="marc:subfield[@code='0']">
1084                             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute>
1085                             <xsl:value-of select="$f773"/>
1086                             </a>
1087                         </xsl:when>
1088                         <xsl:otherwise>
1089                             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute>
1090                             <xsl:value-of select="$f773"/>
1091                             </a>
1092                         </xsl:otherwise>
1093                     </xsl:choose>
1094                     <xsl:if test="marc:subfield[@code='g']">
1095                         <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/>
1096                     </xsl:if>
1097                     </span>
1098
1099                     <xsl:if test="marc:subfield[@code='n']">
1100                         <span class="results_summary in_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1101                     </xsl:if>
1102
1103                 </xsl:if>
1104             </xsl:for-each>
1105         </xsl:if>
1106
1107         <xsl:if test="marc:datafield[@tag=502]">
1108             <span class="results_summary diss_note">
1109                 <span class="label">Dissertation note: </span>
1110                 <xsl:for-each select="marc:datafield[@tag=502]">
1111                     <xsl:call-template name="subfieldSelect">
1112                         <xsl:with-param name="codes">abcdgo</xsl:with-param>
1113                     </xsl:call-template>
1114                 </xsl:for-each>
1115                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
1116             </span>
1117         </xsl:if>
1118
1119         <!-- 866 textual holdings -->
1120         <xsl:if test="marc:datafield[@tag=866]">
1121             <span class="results_summary holdings_note basic_bibliographic_unit"><span class="label">Holdings: </span>
1122                 <xsl:for-each select="marc:datafield[@tag=866]">
1123                     <span class="holdings_note_data">
1124                         <xsl:call-template name="subfieldSelect">
1125                             <xsl:with-param name="codes">axz</xsl:with-param>
1126                         </xsl:call-template>
1127                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1128                     </span>
1129                 </xsl:for-each>
1130             </span>
1131         </xsl:if>
1132
1133         <!-- 867 textual holdings -->
1134         <xsl:if test="marc:datafield[@tag=867]">
1135             <span class="results_summary holdings_note supplementary_material"><span class="label">Supplements: </span>
1136                 <xsl:for-each select="marc:datafield[@tag=867]">
1137                     <span class="holdings_note_data">
1138                         <xsl:call-template name="subfieldSelect">
1139                             <xsl:with-param name="codes">axz</xsl:with-param>
1140                         </xsl:call-template>
1141                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1142                     </span>
1143                 </xsl:for-each>
1144             </span>
1145         </xsl:if>
1146
1147         <!-- 868 textual holdings -->
1148         <xsl:if test="marc:datafield[@tag=868]">
1149             <span class="results_summary holdings_note indexes"><span class="label">Indexes: </span>
1150                 <xsl:for-each select="marc:datafield[@tag=868]">
1151                     <span class="holdings_note_data">
1152                         <xsl:call-template name="subfieldSelect">
1153                             <xsl:with-param name="codes">axz</xsl:with-param>
1154                         </xsl:call-template>
1155                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text><br /></xsl:otherwise></xsl:choose>
1156                     </span>
1157                 </xsl:for-each>
1158             </span>
1159         </xsl:if>
1160
1161         <!-- 770 - Supplement/Special issue entry -->
1162         <xsl:if test="marc:datafield[@tag=770]">
1163             <span class="results_summary supplement"><span class="label">Supplement: </span>
1164                 <xsl:for-each select="marc:datafield[@tag=770]">
1165                     <xsl:if test="marc:subfield[@code='i']">
1166                         <span class="770_rel_info">
1167                             <xsl:call-template name="subfieldSelect">
1168                                 <xsl:with-param name="codes">i</xsl:with-param>
1169                             </xsl:call-template>
1170                             <xsl:text> </xsl:text>
1171                         </span>
1172                     </xsl:if>
1173                     <a>
1174                         <xsl:choose>
1175                             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1176                                 <xsl:attribute name="href">
1177                                     /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>
1178                                 </xsl:attribute>
1179                             </xsl:when>
1180                             <xsl:otherwise>
1181                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''),true())"/></xsl:attribute>
1182                             </xsl:otherwise>
1183                         </xsl:choose>
1184                         <xsl:choose>
1185                             <xsl:when test="marc:subfield[@code='a'] or marc:subfield[@code='t']">
1186                                 <xsl:call-template name="subfieldSelect">
1187                                     <xsl:with-param name="codes">a_t</xsl:with-param>
1188                                 </xsl:call-template>
1189                             </xsl:when>
1190                         </xsl:choose>
1191                     </a>
1192                     <xsl:text> </xsl:text>
1193                     <xsl:call-template name="subfieldSelect">
1194                         <xsl:with-param name="codes">bdghkmnr9usxyz</xsl:with-param>
1195                     </xsl:call-template>
1196                     <xsl:choose>
1197                         <xsl:when test="position()=last()"></xsl:when>
1198                         <xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
1199                     </xsl:choose>
1200                 </xsl:for-each>
1201             </span>
1202         </xsl:if>
1203
1204         <!-- 772 - Supplement parent entry -->
1205         <xsl:if test="marc:datafield[@tag=772]">
1206             <span class="results_summary supplement_parent"><span class="label">Supplement to: </span>
1207                 <xsl:for-each select="marc:datafield[@tag=772]">
1208                     <xsl:if test="marc:subfield[@code='i']">
1209                         <span class="772_rel_info">
1210                             <xsl:call-template name="subfieldSelect">
1211                                 <xsl:with-param name="codes">i</xsl:with-param>
1212                             </xsl:call-template>
1213                             <xsl:text> </xsl:text>
1214                         </span>
1215                     </xsl:if>
1216                     <a>
1217                         <xsl:choose>
1218                             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1219                                 <xsl:attribute name="href">
1220                                     /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>
1221                                 </xsl:attribute>
1222                             </xsl:when>
1223                             <xsl:otherwise>
1224                                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''),true())"/></xsl:attribute>
1225                             </xsl:otherwise>
1226                         </xsl:choose>
1227                         <xsl:choose>
1228                             <xsl:when test="marc:subfield[@code='a'] or marc:subfield[@code='t']">
1229                                 <xsl:call-template name="subfieldSelect">
1230                                     <xsl:with-param name="codes">a_t</xsl:with-param>
1231                                 </xsl:call-template>
1232                             </xsl:when>
1233                         </xsl:choose>
1234                     </a>
1235                     <xsl:call-template name="subfieldSelect">
1236                         <xsl:with-param name="codes">bdghkmnr9usxyz</xsl:with-param>
1237                     </xsl:call-template>
1238                     <xsl:choose>
1239                         <xsl:when test="position()=last()"></xsl:when>
1240                         <xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
1241                     </xsl:choose>
1242                 </xsl:for-each>
1243             </span>
1244         </xsl:if>
1245
1246         <!--  775 Other Edition  -->
1247         <xsl:if test="marc:datafield[@tag=775]">
1248         <span class="results_summary other_editions"><span class="label">Other editions: </span>
1249         <xsl:for-each select="marc:datafield[@tag=775]">
1250             <xsl:variable name="f775">
1251                 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
1252                 <xsl:with-param name="codes">a_t</xsl:with-param>
1253                 </xsl:call-template></xsl:with-param></xsl:call-template>
1254             </xsl:variable>
1255             <xsl:if test="marc:subfield[@code='i']">
1256                 <xsl:call-template name="subfieldSelect">
1257                     <xsl:with-param name="codes">i</xsl:with-param>
1258                 </xsl:call-template>
1259                 <xsl:text>: </xsl:text>
1260             </xsl:if>
1261             <a>
1262             <xsl:choose>
1263             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1264                 <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>
1265             </xsl:when>
1266             <xsl:otherwise>
1267                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f775, '()', ''), true())"/></xsl:attribute>
1268             </xsl:otherwise>
1269             </xsl:choose>
1270             <xsl:call-template name="subfieldSelect">
1271                 <xsl:with-param name="codes">a_t</xsl:with-param>
1272             </xsl:call-template>
1273             </a>
1274             <xsl:choose>
1275                 <xsl:when test="position()=last()"></xsl:when>
1276                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
1277             </xsl:choose>
1278         </xsl:for-each>
1279         </span>
1280         </xsl:if>
1281
1282         <!-- 780 -->
1283         <xsl:if test="marc:datafield[@tag=780]">
1284             <xsl:for-each select="marc:datafield[@tag=780]">
1285                 <xsl:if test="@ind1=0">
1286                     <span class="results_summary preceeding_entry">
1287                         <xsl:choose>
1288                             <xsl:when test="@ind2=0">
1289                                <span class="label">Continues:</span>
1290                             </xsl:when>
1291                             <xsl:when test="@ind2=1">
1292                                <span class="label">Continues in part:</span>
1293                             </xsl:when>
1294                             <xsl:when test="@ind2=2">
1295                                <span class="label">Supersedes:</span>
1296                             </xsl:when>
1297                             <xsl:when test="@ind2=3">
1298                                <span class="label">Supersedes in part:</span>
1299                             </xsl:when>
1300                             <xsl:when test="@ind2=4">
1301                                <span class="label">Formed by the union: ... and: ...</span>
1302                             </xsl:when>
1303                             <xsl:when test="@ind2=5">
1304                                <span class="label">Absorbed:</span>
1305                             </xsl:when>
1306                             <xsl:when test="@ind2=6">
1307                                <span class="label">Absorbed in part:</span>
1308                             </xsl:when>
1309                             <xsl:when test="@ind2=7">
1310                                <span class="label">Separated from:</span>
1311                             </xsl:when>
1312                         </xsl:choose>
1313                         <xsl:text> </xsl:text>
1314
1315                         <xsl:if test="marc:subfield[@code='i']">
1316                             <span class="780_rel_info">
1317                                 <xsl:value-of select="marc:subfield[@code='i']"/>
1318                                 <xsl:text> </xsl:text>
1319                             </span>
1320                         </xsl:if>
1321
1322                         <xsl:variable name="f780">
1323                             <xsl:call-template name="subfieldSelect">
1324                                 <xsl:with-param name="codes">a_t</xsl:with-param>
1325                             </xsl:call-template>
1326                         </xsl:variable>
1327                         <xsl:choose>
1328                             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1329                                 <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>
1330                                     <xsl:value-of select="$f780"/>
1331                                 </a>
1332                             </xsl:when>
1333                             <xsl:otherwise>
1334                                 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f780, '()', ''), true())"/></xsl:attribute>
1335                                     <xsl:value-of select="$f780"/>
1336                                 </a>
1337                             </xsl:otherwise>
1338                         </xsl:choose>
1339                     </span>
1340
1341                     <xsl:if test="marc:subfield[@code='n']">
1342                         <span class="results_summary preceeding_entry_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1343                     </xsl:if>
1344
1345                 </xsl:if>
1346             </xsl:for-each>
1347         </xsl:if>
1348
1349         <!-- 785 -->
1350         <xsl:if test="marc:datafield[@tag=785]">
1351             <xsl:for-each select="marc:datafield[@tag=785]">
1352                 <xsl:if test="@ind1=0">
1353                     <span class="results_summary succeeding_entry">
1354                         <xsl:choose>
1355                             <xsl:when test="@ind2=0">
1356                                 <span class="label">Continued by:</span>
1357                             </xsl:when>
1358                             <xsl:when test="@ind2=1">
1359                                 <span class="label">Continued in part by:</span>
1360                             </xsl:when>
1361                             <xsl:when test="@ind2=2">
1362                                 <span class="label">Superseded by:</span>
1363                             </xsl:when>
1364                             <xsl:when test="@ind2=3">
1365                                 <span class="label">Superseded in part by:</span>
1366                             </xsl:when>
1367                             <xsl:when test="@ind2=4">
1368                                 <span class="label">Absorbed by:</span>
1369                             </xsl:when>
1370                             <xsl:when test="@ind2=5">
1371                                 <span class="label">Absorbed in part by:</span>
1372                             </xsl:when>
1373                             <xsl:when test="@ind2=6">
1374                                 <span class="label">Split into .. and ...:</span>
1375                             </xsl:when>
1376                             <xsl:when test="@ind2=7">
1377                                 <span class="label">Merged with ... to form ...</span>
1378                             </xsl:when>
1379                             <xsl:when test="@ind2=8">
1380                                 <span class="label">Changed back to:</span>
1381                             </xsl:when>
1382                         </xsl:choose>
1383                         <xsl:text> </xsl:text>
1384
1385                         <xsl:if test="marc:subfield[@code='i']">
1386                             <span class="785_rel_info">
1387                                 <xsl:value-of select="marc:subfield[@code='i']"/>
1388                                 <xsl:text> </xsl:text>
1389                             </span>
1390                         </xsl:if>
1391
1392                         <xsl:variable name="f785">
1393                             <xsl:call-template name="subfieldSelect">
1394                                 <xsl:with-param name="codes">a_t</xsl:with-param>
1395                             </xsl:call-template>
1396                         </xsl:variable>
1397
1398                         <xsl:choose>
1399                             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1400                                 <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>
1401                                     <xsl:value-of select="$f785"/>
1402                                 </a>
1403                             </xsl:when>
1404                             <xsl:otherwise>
1405                                 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f785, '()', ''), true())"/></xsl:attribute>
1406                                     <xsl:value-of select="$f785"/>
1407                                 </a>
1408                             </xsl:otherwise>
1409                         </xsl:choose>
1410
1411                     </span>
1412                 </xsl:if>
1413             </xsl:for-each>
1414         </xsl:if>
1415
1416         <xsl:if test="$OPACBaseURL!=''">
1417         <span class="results_summary opac_view"><span class="label">OPAC view: </span>
1418             <a><xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:datafield[@tag=999]/marc:subfield[@code='c'], true())"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
1419         </span>
1420         </xsl:if>
1421
1422     </xsl:template>
1423
1424     <xsl:template name="nameABCQ">
1425             <xsl:call-template name="chopPunctuation">
1426                 <xsl:with-param name="chopString">
1427                     <xsl:call-template name="subfieldSelect">
1428                         <xsl:with-param name="codes">abcq</xsl:with-param>
1429                     </xsl:call-template>
1430                 </xsl:with-param>
1431                 <xsl:with-param name="punctuation">
1432                     <xsl:text>:,;/ </xsl:text>
1433                 </xsl:with-param>
1434             </xsl:call-template>
1435     </xsl:template>
1436
1437     <xsl:template name="nameABCDN">
1438             <xsl:call-template name="chopPunctuation">
1439                 <xsl:with-param name="chopString">
1440                     <xsl:call-template name="subfieldSelect">
1441                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1442                     </xsl:call-template>
1443                 </xsl:with-param>
1444                 <xsl:with-param name="punctuation">
1445                     <xsl:text>:,;/ </xsl:text>
1446                 </xsl:with-param>
1447             </xsl:call-template>
1448     </xsl:template>
1449
1450     <xsl:template name="nameACDEQ">
1451             <xsl:call-template name="subfieldSelect">
1452                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1453             </xsl:call-template>
1454     </xsl:template>
1455
1456     <xsl:template name="specialSubfieldSelect">
1457         <xsl:param name="anyCodes"/>
1458         <xsl:param name="axis"/>
1459         <xsl:param name="beforeCodes"/>
1460         <xsl:param name="afterCodes"/>
1461         <xsl:variable name="str">
1462             <xsl:for-each select="marc:subfield">
1463                 <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])">
1464                     <xsl:value-of select="text()"/>
1465                     <xsl:text> </xsl:text>
1466                 </xsl:if>
1467             </xsl:for-each>
1468         </xsl:variable>
1469         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1470     </xsl:template>
1471
1472     <xsl:template name="showAuthor">
1473         <xsl:param name="authorfield"/>
1474     <xsl:param name="UseAuthoritiesForTracings"/>
1475         <xsl:if test="count($authorfield)&gt;0">
1476         <h5 class="author">
1477         <xsl:for-each select="$authorfield">
1478         <xsl:choose>
1479           <xsl:when test="position()&gt;1"/>
1480           <!-- #13383 -->
1481           <xsl:when test="@tag&lt;700"><span class="byAuthor">By: </span></xsl:when>
1482           <!--#13382 Changed Additional author to contributor -->
1483           <xsl:otherwise>Contributor(s): </xsl:otherwise>
1484         </xsl:choose>
1485         <a>
1486         <xsl:choose>
1487             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1488                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
1489             </xsl:when>
1490             <xsl:otherwise>
1491             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
1492             </xsl:otherwise>
1493         </xsl:choose>
1494         <xsl:choose>
1495             <xsl:when test="@tag=100 or @tag=110 or @tag=111">
1496                 <!-- #13383 -->
1497                 <xsl:call-template name="chopPunctuation">
1498                     <xsl:with-param name="chopString">
1499                         <xsl:call-template name="subfieldSelect">
1500                             <xsl:with-param name="codes">
1501                                 <xsl:choose>
1502                                     <!-- #13383 include subfield e for field 111, Display only name portion in 1XX -->
1503                                     <xsl:when test="@tag=111">aeq</xsl:when>
1504                                     <xsl:when test="@tag=110">ab</xsl:when>
1505                                     <xsl:otherwise>abcjq</xsl:otherwise>
1506                                 </xsl:choose>
1507                             </xsl:with-param>
1508                         </xsl:call-template>
1509                     </xsl:with-param>
1510                     <xsl:with-param name="punctuation">
1511                         <xsl:text>:,;/ </xsl:text>
1512                     </xsl:with-param>
1513                 </xsl:call-template>
1514                     <!-- Display only name and title portion in 110 field -->
1515                     <xsl:if test="@tag=110 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1516                     <span class="titleportion">
1517                     <xsl:choose>
1518                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1519                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1520                     </xsl:choose>
1521                     <xsl:call-template name="chopPunctuation">
1522                         <xsl:with-param name="chopString">
1523                         <xsl:call-template name="subfieldSelect">
1524                             <xsl:with-param name="codes">cdnt</xsl:with-param>
1525                         </xsl:call-template>
1526                         </xsl:with-param>
1527                     </xsl:call-template>
1528                     </span>
1529                     </xsl:if>
1530                     <!-- Display only name and title portion in 111 field -->
1531             <xsl:if test="@tag=111 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1532                     <span class="titleportion">
1533                     <xsl:choose>
1534                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1535                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1536                     </xsl:choose>
1537
1538                     <xsl:call-template name="chopPunctuation">
1539                         <xsl:with-param name="chopString">
1540                         <xsl:call-template name="subfieldSelect">
1541                             <xsl:with-param name="codes">cdgnt</xsl:with-param>
1542                         </xsl:call-template>
1543                         </xsl:with-param>
1544                     </xsl:call-template>
1545                     </span>
1546             </xsl:if>
1547             <!-- Display only dates in 100 field -->
1548             <xsl:if test="@tag=100 and marc:subfield[@code='d']">
1549                 <span class="authordates">
1550                 <xsl:text>, </xsl:text>
1551                 <xsl:call-template name="chopPunctuation">
1552                     <xsl:with-param name="chopString">
1553                         <xsl:call-template name="subfieldSelect">
1554                            <xsl:with-param name="codes">d</xsl:with-param>
1555                         </xsl:call-template>
1556                         </xsl:with-param>
1557                     </xsl:call-template>
1558                     </span>
1559             </xsl:if>
1560
1561             </xsl:when>
1562             <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
1563             <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
1564             <xsl:when test="@tag=700 or @tag=710 or @tag=711">
1565                     <!-- Includes major changes for 7XX fields; display name portion in 710 and 711 fields -->
1566                     <xsl:if test="@tag=710 or @tag=711">
1567                     <xsl:call-template name="chopPunctuation">
1568                         <xsl:with-param name="chopString">
1569                             <xsl:call-template name="subfieldSelect">
1570                             <xsl:with-param name="codes">
1571                             <xsl:choose>
1572                                 <xsl:when test="@tag=711">aeq</xsl:when>
1573                                 <xsl:otherwise>ab</xsl:otherwise>
1574                             </xsl:choose>
1575                             </xsl:with-param>
1576                             </xsl:call-template>
1577                         </xsl:with-param>
1578                         <xsl:with-param name="punctuation">
1579                             <xsl:text>:,;/ </xsl:text>
1580                         </xsl:with-param>
1581                     </xsl:call-template>
1582                     <!-- Display only name and title portion in 711 field -->
1583                     <xsl:if test="@tag=711 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1584                     <span class="titleportion">
1585                     <xsl:choose>
1586                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1587                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1588                     </xsl:choose>
1589
1590                     <xsl:call-template name="chopPunctuation">
1591                         <xsl:with-param name="chopString">
1592                         <xsl:call-template name="subfieldSelect">
1593                             <xsl:with-param name="codes">cdgnt</xsl:with-param>
1594                         </xsl:call-template>
1595                         </xsl:with-param>
1596                     </xsl:call-template>
1597                     </span>
1598                     </xsl:if>
1599                     <!-- Display only name and title portion in 710 field -->
1600                     <xsl:if test="@tag=710 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1601                     <span class="titleportion">
1602                     <xsl:choose>
1603                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1604                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1605                     </xsl:choose>
1606                     <xsl:call-template name="chopPunctuation">
1607                         <xsl:with-param name="chopString">
1608                         <xsl:call-template name="subfieldSelect">
1609                             <xsl:with-param name="codes">cdnt</xsl:with-param>
1610                         </xsl:call-template>
1611                         </xsl:with-param>
1612                     </xsl:call-template>
1613                     </span>
1614                     </xsl:if>
1615
1616                     </xsl:if>
1617                         <!-- Display only name portion in 700 field -->
1618                         <xsl:if test="@tag=700">
1619                            <xsl:call-template name="chopPunctuation">
1620                                <xsl:with-param name="chopString">
1621                                <xsl:call-template name="subfieldSelect">
1622                                   <xsl:with-param name="codes">abcq</xsl:with-param>
1623                                </xsl:call-template>
1624                                </xsl:with-param>
1625                         </xsl:call-template>
1626                         </xsl:if>
1627                         <!-- Display class "authordates" in 700 field -->
1628                         <xsl:if test="@tag=700 and marc:subfield[@code='d']">
1629                         <span class="authordates">
1630                         <xsl:text>, </xsl:text>
1631                         <xsl:call-template name="chopPunctuation">
1632                             <xsl:with-param name="chopString">
1633                             <xsl:call-template name="subfieldSelect">
1634                                <xsl:with-param name="codes">d</xsl:with-param>
1635                             </xsl:call-template>
1636                             </xsl:with-param>
1637                         </xsl:call-template>
1638                         </span>
1639                         </xsl:if>
1640                         <!-- Display class "titleportion" in 700 field -->
1641                         <xsl:variable name="titleportionfields" select="boolean(marc:subfield[@code='t' or @code='j' or @code='k' or @code='u'])"/>
1642                         <xsl:if test="@tag=700 and $titleportionfields">
1643                         <span class="titleportion">
1644                         <xsl:text>. </xsl:text>
1645                         <xsl:call-template name="chopPunctuation">
1646                             <xsl:with-param name="chopString">
1647                             <xsl:call-template name="subfieldSelect">
1648                                 <xsl:with-param name="codes">fghjklmnoprstux</xsl:with-param>
1649                             </xsl:call-template>
1650                             </xsl:with-param>
1651                         </xsl:call-template>
1652                         </span>
1653                         </xsl:if>
1654
1655         </xsl:when>
1656         </xsl:choose>
1657
1658     <!-- add relator code too between brackets-->
1659     <!-- #13383 include relator code j for field 111 -->
1660             <xsl:if test="(@tag!=111 and @tag!=711 and marc:subfield[@code='4' or @code='e']) or ((@tag=111 or @tag=711) and marc:subfield[@code='4' or @code='j'])">
1661                 <span class="relatorcode">
1662                     <xsl:text> [</xsl:text>
1663                     <xsl:choose>
1664                         <xsl:when test="@tag=111 or @tag=711">
1665                             <xsl:choose>
1666                                 <!-- Prefer j over 4 for fields 111 and 711-->
1667                                 <xsl:when test="marc:subfield[@code='j']">
1668                                     <xsl:for-each select="marc:subfield[@code='j']">
1669                                         <xsl:value-of select="."/>
1670                                         <xsl:if test="position() != last()">, </xsl:if>
1671                                     </xsl:for-each>
1672                                 </xsl:when>
1673                                 <xsl:otherwise>
1674                                     <xsl:for-each select="marc:subfield[@code=4]">
1675                                         <xsl:value-of select="."/>
1676                                         <xsl:if test="position() != last()">, </xsl:if>
1677                                     </xsl:for-each>
1678                                 </xsl:otherwise>
1679                             </xsl:choose>
1680                         </xsl:when>
1681                         <!-- Prefer e over 4 for fields 111 and 711-->
1682                         <xsl:when test="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
1683                             <xsl:for-each select="marc:subfield[@code='e']">
1684                                 <xsl:value-of select="."/>
1685                                 <xsl:if test="position() != last()">, </xsl:if>
1686                             </xsl:for-each>
1687                         </xsl:when>
1688                         <xsl:otherwise>
1689                             <xsl:for-each select="marc:subfield[@code=4]">
1690                                 <xsl:value-of select="."/>
1691                                 <xsl:if test="position() != last()">, </xsl:if>
1692                             </xsl:for-each>
1693                         </xsl:otherwise>
1694                     </xsl:choose>
1695                     <xsl:text>]</xsl:text>
1696                 </span>
1697             </xsl:if>
1698         </a>
1699         <xsl:choose>
1700             <xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
1701         </xsl:choose>
1702         </xsl:for-each>
1703         </h5>
1704
1705         </xsl:if>
1706     </xsl:template>
1707
1708     <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
1709     <xsl:template name="subfieldSelectSubject">
1710         <xsl:param name="codes"/>
1711         <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
1712         <xsl:param name="subdivCodes"/>
1713         <xsl:param name="subdivDelimiter"/>
1714         <xsl:param name="prefix"/>
1715         <xsl:param name="suffix"/>
1716         <xsl:param name="urlencode"/>
1717         <xsl:variable name="str">
1718             <xsl:for-each select="marc:subfield">
1719                 <xsl:if test="contains($codes, @code)">
1720                     <xsl:if test="contains($subdivCodes, @code)">
1721                         <xsl:value-of select="$subdivDelimiter"/>
1722                     </xsl:if>
1723                     <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
1724                 </xsl:if>
1725             </xsl:for-each>
1726         </xsl:variable>
1727         <xsl:choose>
1728             <xsl:when test="$urlencode=1">
1729                 <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/>
1730             </xsl:when>
1731             <xsl:otherwise>
1732                 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
1733             </xsl:otherwise>
1734         </xsl:choose>
1735     </xsl:template>
1736
1737 </xsl:stylesheet>