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