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