Bug 13164: Incorrect ISSN visualization on the normal view if invalid/cancelled ISSN...
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / xslt / MARC21slim2OPACDetail.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
4 <xsl:stylesheet version="1.0"
5   xmlns:marc="http://www.loc.gov/MARC21/slim"
6   xmlns:items="http://www.koha-community.org/items"
7   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8   exclude-result-prefixes="marc items">
9     <xsl:import href="MARC21slimUtils.xsl"/>
10     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11
12     <xsl:template match="/">
13             <xsl:apply-templates/>
14     </xsl:template>
15
16     <xsl:template match="marc:record">
17
18         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
19         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
20
21     <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
22     <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
23     <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
24     <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
25
26     <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
27     <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
28     <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
29     <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
30     <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
31     <xsl:variable name="theme" select="marc:sysprefs/marc:syspref[@name='opacthemes']"/>
32     <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
33     <xsl:variable name="TracingQuotesLeft">
34       <xsl:choose>
35         <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
36         <xsl:otherwise>"</xsl:otherwise>
37       </xsl:choose>
38     </xsl:variable>
39     <xsl:variable name="TracingQuotesRight">
40       <xsl:choose>
41         <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
42         <xsl:otherwise>"</xsl:otherwise>
43       </xsl:choose>
44     </xsl:variable>
45         <xsl:variable name="leader" select="marc:leader"/>
46         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
47         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
48         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
49         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
50         <xsl:variable name="materialTypeCode">
51             <xsl:choose>
52                 <xsl:when test="$leader19='a'">ST</xsl:when>
53                 <xsl:when test="$leader6='a'">
54                     <xsl:choose>
55                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
56                         <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
57                         <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
58                     </xsl:choose>
59                 </xsl:when>
60                 <xsl:when test="$leader6='t'">BK</xsl:when>
61                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
62                 <xsl:when test="$leader6='m'">CF</xsl:when>
63                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
64                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
65                 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
66                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
67             </xsl:choose>
68         </xsl:variable>
69         <xsl:variable name="materialTypeLabel">
70             <xsl:choose>
71                 <xsl:when test="$leader19='a'">Set</xsl:when>
72                 <xsl:when test="$leader6='a'">
73                     <xsl:choose>
74                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
75                         <xsl:when test="$leader7='i' or $leader7='s'">
76                             <xsl:choose>
77                                 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
78                                 <xsl:otherwise>Series</xsl:otherwise>
79                             </xsl:choose>
80                         </xsl:when>
81                         <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
82                     </xsl:choose>
83                 </xsl:when>
84                 <xsl:when test="$leader6='t'">Book</xsl:when>
85                                 <xsl:when test="$leader6='o'">Kit</xsl:when>
86                 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
87                 <xsl:when test="$leader6='m'">Computer file</xsl:when>
88                 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
89                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual material</xsl:when>
90                 <xsl:when test="$leader6='j'">Music</xsl:when>
91                 <xsl:when test="$leader6='i'">Sound</xsl:when>
92                 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
93             </xsl:choose>
94         </xsl:variable>
95
96         <!-- Schema.org type -->
97         <xsl:variable name="schemaOrgType">
98             <xsl:choose>
99                 <xsl:when test="$materialTypeLabel='Book'">Book</xsl:when>
100                 <xsl:when test="$materialTypeLabel='Map'">Map</xsl:when>
101                 <xsl:when test="$materialTypeLabel='Music'">MusicAlbum</xsl:when>
102                 <xsl:otherwise>CreativeWork</xsl:otherwise>
103             </xsl:choose>
104         </xsl:variable>
105
106         <!-- Wrapper div for our schema.org object -->
107         <xsl:element name="div">
108             <xsl:attribute name="class">record</xsl:attribute>
109             <xsl:attribute name="vocab">http://schema.org/</xsl:attribute>
110             <xsl:attribute name="typeof"><xsl:value-of select='$schemaOrgType' /> Product</xsl:attribute>
111             <xsl:attribute name="resource">#record</xsl:attribute>
112
113         <!-- Title Statement -->
114         <!-- Alternate Graphic Representation (MARC 880) -->
115         <xsl:if test="$display880">
116             <h1 class="title" property="alternateName">
117                 <xsl:call-template name="m880Select">
118                     <xsl:with-param name="basetags">245</xsl:with-param>
119                     <xsl:with-param name="codes">abhfgknps</xsl:with-param>
120                 </xsl:call-template>
121             </h1>
122         </xsl:if>
123
124         <xsl:if test="marc:datafield[@tag=245]">
125         <h1 class="title" property="name">
126             <xsl:for-each select="marc:datafield[@tag=245]">
127                     <xsl:call-template name="subfieldSelect">
128                         <xsl:with-param name="codes">a</xsl:with-param>
129                     </xsl:call-template>
130                     <xsl:if test="marc:subfield[@code='h']">
131                         <xsl:text> </xsl:text>
132                         <xsl:call-template name="subfieldSelect">
133                             <xsl:with-param name="codes">h</xsl:with-param>
134                         </xsl:call-template>
135                     </xsl:if>
136                     <xsl:if test="marc:subfield[@code='b']">
137                         <xsl:text> </xsl:text>
138                         <xsl:call-template name="subfieldSelect">
139                             <xsl:with-param name="codes">b</xsl:with-param>
140                         </xsl:call-template>
141                     </xsl:if>
142                 <xsl:text> </xsl:text>
143                     <xsl:call-template name="subfieldSelect">
144                         <xsl:with-param name="codes">fgknps</xsl:with-param>
145                     </xsl:call-template>
146             </xsl:for-each>
147         </h1>
148         </xsl:if>
149
150         <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
151         <xsl:if test="$display880">
152             <h5 class="author">
153                 <xsl:call-template name="m880Select">
154                     <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
155                     <xsl:with-param name="codes">abc</xsl:with-param>
156                     <xsl:with-param name="index">au</xsl:with-param>
157                     <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
158                 </xsl:call-template>
159             </h5>
160         </xsl:if>
161         <xsl:choose>
162             <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
163                 <h5 class="author">by
164                     <xsl:call-template name="showAuthor">
165                         <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111 or @tag=700 or @tag=710 or @tag=711]"/>
166                         <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
167                         <xsl:with-param name="materialTypeLabel" select="$materialTypeLabel"/>
168                         <xsl:with-param name="theme" select="$theme"/>
169                     </xsl:call-template>
170                 </h5>
171             </xsl:when>
172         </xsl:choose>
173
174    <xsl:if test="$DisplayOPACiconsXSLT!='0'">
175         <xsl:if test="$materialTypeCode!=''">
176         <span class="results_summary type"><span class="label">Material type: </span>
177         <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element>
178         <xsl:value-of select="$materialTypeLabel"/>
179         </span>
180         </xsl:if>
181    </xsl:if>
182
183         <!--Series: Alternate Graphic Representation (MARC 880) -->
184         <xsl:if test="$display880">
185             <xsl:call-template name="m880Select">
186                 <xsl:with-param name="basetags">440,490</xsl:with-param>
187                 <xsl:with-param name="codes">av</xsl:with-param>
188                 <xsl:with-param name="class">results_summary series</xsl:with-param>
189                 <xsl:with-param name="label">Series: </xsl:with-param>
190                 <xsl:with-param name="index">se</xsl:with-param>
191             </xsl:call-template>
192         </xsl:if>
193
194         <!-- Series -->
195         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
196         <span class="results_summary series"><span class="label">Series: </span>
197         <!-- 440 -->
198         <xsl:for-each select="marc:datafield[@tag=440]">
199             <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
200             <xsl:call-template name="chopPunctuation">
201                             <xsl:with-param name="chopString">
202                                 <xsl:call-template name="subfieldSelect">
203                                     <xsl:with-param name="codes">av</xsl:with-param>
204                                 </xsl:call-template>
205                             </xsl:with-param>
206                         </xsl:call-template>
207             </a>
208             <xsl:call-template name="part"/>
209             <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
210         </xsl:for-each>
211
212         <!-- 490 Series not traced, Ind1 = 0 -->
213         <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
214             <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
215                         <xsl:call-template name="chopPunctuation">
216                             <xsl:with-param name="chopString">
217                                 <xsl:call-template name="subfieldSelect">
218                                     <xsl:with-param name="codes">av</xsl:with-param>
219                                 </xsl:call-template>
220                             </xsl:with-param>
221                         </xsl:call-template>
222             </a>
223                     <xsl:call-template name="part"/>
224         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
225         </xsl:for-each>
226         <!-- 490 Series traced, Ind1 = 1 -->
227         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
228             <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
229                 <xsl:choose>
230                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
231                         <a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
232                             <xsl:call-template name="chopPunctuation">
233                                 <xsl:with-param name="chopString">
234                                     <xsl:call-template name="subfieldSelect">
235                                         <xsl:with-param name="codes">a_t</xsl:with-param>
236                                     </xsl:call-template>
237                                 </xsl:with-param>
238                             </xsl:call-template>
239                         </a>
240                     </xsl:when>
241                     <xsl:otherwise>
242                         <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
243                             <xsl:call-template name="chopPunctuation">
244                                 <xsl:with-param name="chopString">
245                                     <xsl:call-template name="subfieldSelect">
246                                         <xsl:with-param name="codes">a_t</xsl:with-param>
247                                     </xsl:call-template>
248                                 </xsl:with-param>
249                             </xsl:call-template>
250                         </a>
251                         <xsl:call-template name="part"/>
252                     </xsl:otherwise>
253                 </xsl:choose>
254                 <xsl:text>: </xsl:text>
255                 <xsl:value-of  select="marc:subfield[@code='v']" />
256             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
257             </xsl:for-each>
258         </xsl:if>
259         </span>
260         </xsl:if>
261
262         <!-- Analytics -->
263         <xsl:if test="$leader7='s'">
264         <span class="results_summary analytics"><span class="label">Analytics: </span>
265             <a>
266             <xsl:choose>
267             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
268                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
269             </xsl:when>
270             <xsl:otherwise>
271                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
272             </xsl:otherwise>
273             </xsl:choose>
274             <xsl:text>Show analytics</xsl:text>
275             </a>
276         </span>
277         </xsl:if>
278
279         <!-- Volumes of sets and traced series -->
280         <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
281         <span class="results_summary volumes"><span class="label">Volumes: </span>
282             <a>
283             <xsl:choose>
284             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
285                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
286             </xsl:when>
287             <xsl:otherwise>
288                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
289             </xsl:otherwise>
290             </xsl:choose>
291             <xsl:text>Show volumes</xsl:text>
292             </a>
293         </span>
294         </xsl:if>
295
296         <!-- Set -->
297         <xsl:if test="$leader19='c'">
298         <span class="results_summary set"><span class="label">Set: </span>
299         <xsl:for-each select="marc:datafield[@tag=773]">
300             <a>
301             <xsl:choose>
302             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
303                 <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>
304             </xsl:when>
305             <xsl:otherwise>
306                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
307             </xsl:otherwise>
308             </xsl:choose>
309             <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
310             </a>
311             <xsl:choose>
312                 <xsl:when test="position()=last()"></xsl:when>
313                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
314             </xsl:choose>
315         </xsl:for-each>
316         </span>
317         </xsl:if>
318
319         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
320         <xsl:if test="$display880">
321             <xsl:call-template name="m880Select">
322                 <xsl:with-param name="basetags">260</xsl:with-param>
323                 <xsl:with-param name="codes">abcg</xsl:with-param>
324                 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
325                 <xsl:with-param name="label">Publisher: </xsl:with-param>
326             </xsl:call-template>
327         </xsl:if>
328
329         <!-- Publisher info and RDA related info from tags 260, 264 -->
330         <xsl:choose>
331         <xsl:when test="marc:datafield[@tag=260]">
332         <span class="results_summary publisher"><span class="label">Publisher: </span>
333             <xsl:for-each select="marc:datafield[@tag=260]">
334                 <span property="publisher" typeof="Organization">
335                 <xsl:if test="marc:subfield[@code='a']">
336                     <span property="location">
337                     <xsl:call-template name="subfieldSelect">
338                         <xsl:with-param name="codes">a</xsl:with-param>
339                     </xsl:call-template>
340                     </span>
341                 </xsl:if>
342                 <xsl:text> </xsl:text>
343                 <xsl:if test="marc:subfield[@code='b']">
344                 <span property="name"><a href="/cgi-bin/koha/opac-search.pl?q=pb:{marc:subfield[@code='b']}">
345                     <xsl:call-template name="subfieldSelect">
346                         <xsl:with-param name="codes">b</xsl:with-param>
347                     </xsl:call-template>
348                 </a></span>
349                 </xsl:if>
350                 </span>
351                 <xsl:text> </xsl:text>
352                 <xsl:if test="marc:subfield[@code='c' or @code='g']">
353                 <span property="datePublished">
354                     <xsl:call-template name="chopPunctuation">
355                       <xsl:with-param name="chopString">
356                         <xsl:call-template name="subfieldSelect">
357                             <xsl:with-param name="codes">cg</xsl:with-param>
358                         </xsl:call-template>
359                        </xsl:with-param>
360                    </xsl:call-template>
361                 </span>
362                 </xsl:if>
363                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
364             </xsl:for-each>
365             <xsl:if test="marc:datafield[@tag=264]">
366                 <xsl:text>; </xsl:text>
367                 <xsl:call-template name="showRDAtag264"/>
368             </xsl:if>
369         </span>
370         </xsl:when>
371         <xsl:when test="marc:datafield[@tag=264]">
372             <span class="results_summary">
373                 <xsl:call-template name="showRDAtag264"/>
374             </span>
375         </xsl:when>
376         </xsl:choose>
377
378         <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
379         <xsl:if test="$display880">
380             <xsl:call-template name="m880Select">
381                 <xsl:with-param name="basetags">250</xsl:with-param>
382                 <xsl:with-param name="codes">ab</xsl:with-param>
383                 <xsl:with-param name="class">results_summary edition</xsl:with-param>
384                 <xsl:with-param name="label">Edition: </xsl:with-param>
385             </xsl:call-template>
386         </xsl:if>
387
388         <xsl:if test="marc:datafield[@tag=250]">
389         <span class="results_summary edition"><span class="label">Edition: </span>
390             <xsl:for-each select="marc:datafield[@tag=250]">
391                 <span property="bookEdition">
392                 <xsl:call-template name="chopPunctuation">
393                   <xsl:with-param name="chopString">
394                     <xsl:call-template name="subfieldSelect">
395                         <xsl:with-param name="codes">ab</xsl:with-param>
396                     </xsl:call-template>
397                    </xsl:with-param>
398                </xsl:call-template>
399                 </span>
400                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
401             </xsl:for-each>
402         </span>
403         </xsl:if>
404
405         <!-- Description: Alternate Graphic Representation (MARC 880) -->
406         <xsl:if test="$display880">
407             <xsl:call-template name="m880Select">
408                 <xsl:with-param name="basetags">300</xsl:with-param>
409                 <xsl:with-param name="codes">abceg</xsl:with-param>
410                 <xsl:with-param name="class">results_summary description</xsl:with-param>
411                 <xsl:with-param name="label">Description: </xsl:with-param>
412             </xsl:call-template>
413         </xsl:if>
414
415         <xsl:if test="marc:datafield[@tag=300]">
416         <span class="results_summary description"><span class="label">Description: </span>
417             <xsl:for-each select="marc:datafield[@tag=300]">
418                 <span property="description">
419                 <xsl:call-template name="chopPunctuation">
420                   <xsl:with-param name="chopString">
421                     <xsl:call-template name="subfieldSelect">
422                         <xsl:with-param name="codes">abceg</xsl:with-param>
423                     </xsl:call-template>
424                    </xsl:with-param>
425                </xsl:call-template>
426                 </span>
427                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
428             </xsl:for-each>
429         </span>
430        </xsl:if>
431
432        <xsl:if test="marc:datafield[@tag=020]">
433         <span class="results_summary isbn"><span class="label">ISBN: </span>
434         <xsl:for-each select="marc:datafield[@tag=020]">
435         <span property="isbn">
436         <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
437                 <xsl:value-of select="marc:subfield[@code='a']"/>
438                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
439         </span>
440         </xsl:for-each>
441         </span>
442         </xsl:if>
443
444         <!-- Build ISSN -->
445         <xsl:if test="marc:datafield[@tag=022]/marc:subfield[@code='a']">
446           <span class="results_summary issn"><span class="label">ISSN: </span>
447             <xsl:for-each select="marc:datafield[@tag=022]/marc:subfield[@code='a']">
448               <span property="issn">
449                 <xsl:value-of select="."/>
450                 <xsl:choose>
451                   <xsl:when test="position()=last()">
452                     <xsl:text>.</xsl:text>
453                   </xsl:when>
454                   <xsl:otherwise>
455                     <xsl:text>; </xsl:text>
456                   </xsl:otherwise>
457                 </xsl:choose>
458               </span>
459             </xsl:for-each>
460           </span>
461         </xsl:if>
462
463         <xsl:if test="marc:datafield[@tag=013]">
464             <span class="results_summary patent_info">
465                 <span class="label">Patent information: </span>
466                 <xsl:for-each select="marc:datafield[@tag=013]">
467                     <xsl:call-template name="subfieldSelect">
468                         <xsl:with-param name="codes">acdef</xsl:with-param>
469                         <xsl:with-param name="delimeter">, </xsl:with-param>
470                     </xsl:call-template>
471                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
472                 </xsl:for-each>
473             </span>
474         </xsl:if>
475
476         <xsl:if test="marc:datafield[@tag=088]">
477             <span class="results_summary report_number">
478                 <span class="label">Report number: </span>
479                 <xsl:for-each select="marc:datafield[@tag=088]">
480                     <xsl:call-template name="subfieldSelect">
481                         <xsl:with-param name="codes">a</xsl:with-param>
482                     </xsl:call-template>
483                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
484                 </xsl:for-each>
485             </span>
486         </xsl:if>
487
488         <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
489         <xsl:if test="$display880">
490             <xsl:call-template name="m880Select">
491                 <xsl:with-param name="basetags">246</xsl:with-param>
492                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
493                 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
494                 <xsl:with-param name="label">Other title: </xsl:with-param>
495             </xsl:call-template>
496         </xsl:if>
497
498         <xsl:if test="marc:datafield[@tag=246]">
499         <span class="results_summary other_title"><span class="label">Other title: </span>
500             <xsl:for-each select="marc:datafield[@tag=246]">
501                 <span property="alternateName">
502                 <xsl:call-template name="chopPunctuation">
503                   <xsl:with-param name="chopString">
504                     <xsl:call-template name="subfieldSelect">
505                         <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
506                     </xsl:call-template>
507                    </xsl:with-param>
508                </xsl:call-template>
509                 </span>
510                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
511             </xsl:for-each>
512         </span>
513        </xsl:if>
514
515
516         <xsl:if test="marc:datafield[@tag=242]">
517         <span class="results_summary translated_title"><span class="label">Title translated: </span>
518             <xsl:for-each select="marc:datafield[@tag=242]">
519                 <span property="alternateName">
520                 <xsl:call-template name="chopPunctuation">
521                   <xsl:with-param name="chopString">
522                     <xsl:call-template name="subfieldSelect">
523                         <xsl:with-param name="codes">abchnp</xsl:with-param>
524                     </xsl:call-template>
525                    </xsl:with-param>
526                </xsl:call-template>
527                 </span>
528                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
529             </xsl:for-each>
530         </span>
531        </xsl:if>
532
533         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
534         <xsl:if test="$display880">
535             <span property="alternateName">
536             <xsl:call-template name="m880Select">
537                 <xsl:with-param name="basetags">130,240</xsl:with-param>
538                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
539                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
540                 <xsl:with-param name="label">Uniform titles: </xsl:with-param>
541             </xsl:call-template>
542             </span>
543         </xsl:if>
544
545         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
546         <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span>
547         <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
548             <span property="alternateName">
549             <xsl:variable name="str">
550                 <xsl:for-each select="marc:subfield">
551                     <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
552                         <xsl:value-of select="text()"/>
553                         <xsl:text> </xsl:text>
554                      </xsl:if>
555                 </xsl:for-each>
556             </xsl:variable>
557             <xsl:call-template name="chopPunctuation">
558                 <xsl:with-param name="chopString">
559                     <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
560
561                 </xsl:with-param>
562             </xsl:call-template>
563             </span>
564             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
565         </xsl:for-each>
566         </span>
567         </xsl:if>
568
569         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
570             <span class="results_summary subjects"><span class="label">Subject(s): </span>
571             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
572             <span property="keywords">
573             <a>
574             <xsl:choose>
575             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
576                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
577             </xsl:when>
578             <xsl:when test="$TraceSubjectSubdivisions='1'">
579                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
580                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
581                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
582                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
583                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
584                     </xsl:call-template>
585                 </xsl:attribute>
586             </xsl:when>
587             <xsl:otherwise>
588                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
589             </xsl:otherwise>
590             </xsl:choose>
591             <xsl:call-template name="chopPunctuation">
592                 <xsl:with-param name="chopString">
593                     <xsl:call-template name="subfieldSelect">
594                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
595                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
596                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
597                     </xsl:call-template>
598                 </xsl:with-param>
599             </xsl:call-template>
600             </a>
601             </span>
602             <xsl:if test="marc:subfield[@code=9]">
603                 <a class='authlink'>
604                     <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
605                     <xsl:element name="img">
606                         <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute>
607                         <xsl:attribute name="style">vertical-align:middle</xsl:attribute>
608                         <xsl:attribute name="height">15</xsl:attribute>
609                         <xsl:attribute name="width">15</xsl:attribute>
610                     </xsl:element>
611                 </a>
612             </xsl:if>
613             <xsl:choose>
614             <xsl:when test="position()=last()"></xsl:when>
615             <xsl:otherwise> | </xsl:otherwise>
616             </xsl:choose>
617
618             </xsl:for-each>
619             </span>
620         </xsl:if>
621
622 <!-- Image processing code added here, takes precedence over text links including y3z text   -->
623         <xsl:if test="marc:datafield[@tag=856]">
624         <span class="results_summary online_resources"><span class="label">Online resources: </span>
625         <xsl:for-each select="marc:datafield[@tag=856]">
626             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
627             <a property="url">
628             <xsl:choose>
629               <xsl:when test="$OPACTrackClicks='track'">
630                 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
631               </xsl:when>
632               <xsl:when test="$OPACTrackClicks='anonymous'">
633                 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
634               </xsl:when>
635               <xsl:otherwise>
636                 <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
637               </xsl:otherwise>
638             </xsl:choose>
639             <xsl:if test="$OPACURLOpenInNewWindow='1'">
640                 <xsl:attribute name="target">_blank</xsl:attribute>
641             </xsl:if>
642             <xsl:choose>
643             <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')">
644                 <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text>
645             </xsl:when>
646             <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
647                 <xsl:call-template name="subfieldSelect">
648                     <xsl:with-param name="codes">y3z</xsl:with-param>
649                 </xsl:call-template>
650             </xsl:when>
651             <xsl:when test="$URLLinkText!=''">
652                 <xsl:value-of select="$URLLinkText"/>
653             </xsl:when>
654             <xsl:otherwise>
655                 <xsl:text>Click here to access online</xsl:text>
656             </xsl:otherwise>
657             </xsl:choose>
658             </a>
659             <xsl:choose>
660             <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
661             <xsl:otherwise> | </xsl:otherwise>
662             </xsl:choose>
663         </xsl:for-each>
664         </span>
665         </xsl:if>
666
667         <!-- 530 -->
668         <xsl:if test="marc:datafield[@tag=530]">
669         <xsl:for-each select="marc:datafield[@tag=530]">
670         <span class="results_summary additionalforms">
671             <xsl:call-template name="subfieldSelect">
672                 <xsl:with-param name="codes">abcd</xsl:with-param>
673             </xsl:call-template>
674             <xsl:for-each select="marc:subfield[@code='u']">
675                 <a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
676                 <xsl:if test="$OPACURLOpenInNewWindow='1'">
677                     <xsl:attribute name="target">_blank</xsl:attribute>
678                 </xsl:if>
679                 <xsl:value-of select="text()"/>
680                 </a>
681             </xsl:for-each>
682         </span>
683         </xsl:for-each>
684         </xsl:if>
685
686         <!-- 505 -->
687         <xsl:if test="marc:datafield[@tag=505]">
688         <div class="results_summary contents">
689         <xsl:for-each select="marc:datafield[@tag=505]">
690         <xsl:if test="position()=1">
691             <xsl:choose>
692             <xsl:when test="@ind1=1">
693                 <span class="label">Incomplete contents:</span>
694             </xsl:when>
695             <xsl:when test="@ind1=2">
696                 <span class="label">Partial contents:</span>
697             </xsl:when>
698             <xsl:otherwise>
699                 <span class="label">Contents:</span>
700             </xsl:otherwise>
701             </xsl:choose>
702         </xsl:if>
703         <div class='contentblock' property='description'>
704         <xsl:choose>
705         <xsl:when test="@ind2=0">
706             <xsl:call-template name="subfieldSelectSpan">
707                 <xsl:with-param name="codes">tru</xsl:with-param>
708             </xsl:call-template>
709         </xsl:when>
710         <xsl:otherwise>
711             <xsl:call-template name="subfieldSelectSpan">
712                 <xsl:with-param name="codes">atru</xsl:with-param>
713             </xsl:call-template>
714         </xsl:otherwise>
715         </xsl:choose>
716         </div>
717         </xsl:for-each>
718         </div>
719         </xsl:if>
720
721         <!-- 583 -->
722         <xsl:if test="marc:datafield[@tag=583]">
723         <xsl:for-each select="marc:datafield[@tag=583]">
724             <xsl:if test="@ind1=1 or @ind1=' '">
725             <span class="results_summary actionnote">
726                 <xsl:choose>
727                 <xsl:when test="marc:subfield[@code='z']">
728                     <xsl:value-of select="marc:subfield[@code='z']"/>
729                 </xsl:when>
730                 <xsl:otherwise>
731                     <xsl:call-template name="subfieldSelect">
732                         <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
733                     </xsl:call-template>
734                 </xsl:otherwise>
735                 </xsl:choose>
736             </span>
737             </xsl:if>
738         </xsl:for-each>
739         </xsl:if>
740
741         <!-- 586 -->
742         <xsl:if test="marc:datafield[@tag=586]">
743         <xsl:for-each select="marc:datafield[@tag=586]">
744             <span class="results_summary awardsnote">
745                 <xsl:if test="@ind1=' '">
746                 <span class="label">Awards: </span>
747                 </xsl:if>
748                 <xsl:value-of select="marc:subfield[@code='a']"/>
749             </span>
750         </xsl:for-each>
751         </xsl:if>
752
753         <!-- 773 -->
754         <xsl:if test="marc:datafield[@tag=773]">
755         <xsl:for-each select="marc:datafield[@tag=773]">
756         <xsl:if test="@ind1=0">
757         <span class="results_summary in"><span class="label">
758         <xsl:choose>
759         <xsl:when test="@ind2=' '">
760             In:
761         </xsl:when>
762         <xsl:when test="@ind2=8">
763             <xsl:if test="marc:subfield[@code='i']">
764                 <xsl:value-of select="marc:subfield[@code='i']"/>
765             </xsl:if>
766         </xsl:when>
767         </xsl:choose>
768         </span>
769                 <xsl:variable name="f773">
770                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
771                         <xsl:with-param name="codes">a_t</xsl:with-param>
772                     </xsl:call-template></xsl:with-param></xsl:call-template>
773                 </xsl:variable>
774             <xsl:choose>
775                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
776                     <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>
777                         <xsl:value-of select="translate($f773, '()', '')"/>
778                     </a>
779                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
780                 </xsl:when>
781                 <xsl:when test="marc:subfield[@code='0']">
782                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
783                         <xsl:value-of select="$f773"/>
784                     </a>
785                 </xsl:when>
786                 <xsl:otherwise>
787                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
788                         <xsl:value-of select="$f773"/>
789                     </a>
790                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
791                 </xsl:otherwise>
792             </xsl:choose>
793         </span>
794
795         <xsl:if test="marc:subfield[@code='n']">
796             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
797         </xsl:if>
798
799         </xsl:if>
800         </xsl:for-each>
801         </xsl:if>
802
803         <xsl:for-each select="marc:datafield[@tag=511]">
804             <span class="results_summary perf_note">
805                 <span class="label">
806                     <xsl:if test="@ind1=1"><xsl:text>Cast: </xsl:text></xsl:if>
807                 </span>
808                 <xsl:call-template name="subfieldSelect">
809                     <xsl:with-param name="codes">a</xsl:with-param>
810                 </xsl:call-template>
811             </span>
812         </xsl:for-each>
813
814         <xsl:if test="marc:datafield[@tag=502]">
815             <span class="results_summary diss_note">
816                 <span class="label">Dissertation note: </span>
817                 <xsl:for-each select="marc:datafield[@tag=502]">
818                     <xsl:call-template name="subfieldSelect">
819                         <xsl:with-param name="codes">abcdgo</xsl:with-param>
820                     </xsl:call-template>
821                 </xsl:for-each>
822                 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
823             </span>
824         </xsl:if>
825
826         <xsl:for-each select="marc:datafield[@tag=520]">
827         <span class="results_summary summary"><span class="label">
828         <xsl:choose>
829           <xsl:when test="@ind1=0"><xsl:text>Subject: </xsl:text></xsl:when>
830           <xsl:when test="@ind1=1"><xsl:text>Review: </xsl:text></xsl:when>
831           <xsl:when test="@ind1=2"><xsl:text>Scope and content: </xsl:text></xsl:when>
832           <xsl:when test="@ind1=3"><xsl:text>Abstract: </xsl:text></xsl:when>
833           <xsl:when test="@ind1=4"><xsl:text>Content advice: </xsl:text></xsl:when>
834           <xsl:otherwise><xsl:text>Summary: </xsl:text></xsl:otherwise>
835         </xsl:choose>
836         </span>
837         <xsl:call-template name="subfieldSelect">
838           <xsl:with-param name="codes">abcu</xsl:with-param>
839         </xsl:call-template>
840         </span>
841         </xsl:for-each>
842
843         <!-- 866 textual holdings -->
844         <xsl:if test="marc:datafield[@tag=866]">
845             <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
846                 <xsl:for-each select="marc:datafield[@tag=866]">
847                     <xsl:call-template name="subfieldSelect">
848                         <xsl:with-param name="codes">az</xsl:with-param>
849                     </xsl:call-template>
850                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
851                 </xsl:for-each>
852             </span>
853         </xsl:if>
854
855         <!--  775 Other Edition  -->
856         <xsl:if test="marc:datafield[@tag=775]">
857         <span class="results_summary other_editions"><span class="label">Other editions: </span>
858         <xsl:for-each select="marc:datafield[@tag=775]">
859             <xsl:variable name="f775">
860                 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
861                 <xsl:with-param name="codes">a_t</xsl:with-param>
862                 </xsl:call-template></xsl:with-param></xsl:call-template>
863             </xsl:variable>
864             <xsl:if test="marc:subfield[@code='i']">
865                 <xsl:call-template name="subfieldSelect">
866                     <xsl:with-param name="codes">i</xsl:with-param>
867                 </xsl:call-template>
868                 <xsl:text>: </xsl:text>
869             </xsl:if>
870             <a>
871             <xsl:choose>
872             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
873                 <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>
874             </xsl:when>
875             <xsl:otherwise>
876                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
877             </xsl:otherwise>
878             </xsl:choose>
879             <xsl:call-template name="subfieldSelect">
880                 <xsl:with-param name="codes">a_t</xsl:with-param>
881             </xsl:call-template>
882             </a>
883             <xsl:choose>
884                 <xsl:when test="position()=last()"></xsl:when>
885                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
886             </xsl:choose>
887         </xsl:for-each>
888         </span>
889         </xsl:if>
890
891         <!-- 780 -->
892         <xsl:if test="marc:datafield[@tag=780]">
893         <xsl:for-each select="marc:datafield[@tag=780]">
894         <xsl:if test="@ind1=0">
895         <span class="results_summary preceeding_entry">
896         <xsl:choose>
897         <xsl:when test="@ind2=0">
898             <span class="label">Continues:</span>
899         </xsl:when>
900         <xsl:when test="@ind2=1">
901             <span class="label">Continues in part:</span>
902         </xsl:when>
903         <xsl:when test="@ind2=2">
904             <span class="label">Supersedes:</span>
905         </xsl:when>
906         <xsl:when test="@ind2=3">
907             <span class="label">Supersedes in part:</span>
908         </xsl:when>
909         <xsl:when test="@ind2=4">
910             <span class="label">Formed by the union: ... and: ...</span>
911         </xsl:when>
912         <xsl:when test="@ind2=5">
913             <span class="label">Absorbed:</span>
914         </xsl:when>
915         <xsl:when test="@ind2=6">
916             <span class="label">Absorbed in part:</span>
917         </xsl:when>
918         <xsl:when test="@ind2=7">
919             <span class="label">Separated from:</span>
920         </xsl:when>
921         </xsl:choose>
922         <xsl:text> </xsl:text>
923                 <xsl:variable name="f780">
924                     <xsl:call-template name="subfieldSelect">
925                         <xsl:with-param name="codes">a_t</xsl:with-param>
926                     </xsl:call-template>
927                 </xsl:variable>
928             <xsl:choose>
929                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
930                     <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>
931                         <xsl:value-of select="translate($f780, '()', '')"/>
932                     </a>
933                 </xsl:when>
934                 <xsl:otherwise>
935                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
936                         <xsl:value-of select="translate($f780, '()', '')"/>
937                     </a>
938                 </xsl:otherwise>
939             </xsl:choose>
940         </span>
941
942         <xsl:if test="marc:subfield[@code='n']">
943             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
944         </xsl:if>
945
946         </xsl:if>
947         </xsl:for-each>
948         </xsl:if>
949
950         <!-- 785 -->
951         <xsl:if test="marc:datafield[@tag=785]">
952         <xsl:for-each select="marc:datafield[@tag=785]">
953         <xsl:if test="@ind1=0">
954         <span class="results_summary succeeding_entry">
955         <xsl:choose>
956         <xsl:when test="@ind2=0">
957             <span class="label">Continued by:</span>
958         </xsl:when>
959         <xsl:when test="@ind2=1">
960             <span class="label">Continued in part by:</span>
961         </xsl:when>
962         <xsl:when test="@ind2=2">
963             <span class="label">Superseded by:</span>
964         </xsl:when>
965         <xsl:when test="@ind2=3">
966             <span class="label">Superseded in part by:</span>
967         </xsl:when>
968         <xsl:when test="@ind2=4">
969             <span class="label">Absorbed by:</span>
970         </xsl:when>
971         <xsl:when test="@ind2=5">
972             <span class="label">Absorbed in part by:</span>
973         </xsl:when>
974         <xsl:when test="@ind2=6">
975             <span class="label">Split into .. and ...:</span>
976         </xsl:when>
977         <xsl:when test="@ind2=7">
978             <span class="label">Merged with ... to form ...</span>
979         </xsl:when>
980         <xsl:when test="@ind2=8">
981             <span class="label">Changed back to:</span>
982         </xsl:when>
983         </xsl:choose>
984         <xsl:text> </xsl:text>
985                    <xsl:variable name="f785">
986                     <xsl:call-template name="subfieldSelect">
987                         <xsl:with-param name="codes">a_t</xsl:with-param>
988                     </xsl:call-template>
989                 </xsl:variable>
990
991             <xsl:choose>
992                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
993                     <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>
994                         <xsl:value-of select="translate($f785, '()', '')"/>
995                     </a>
996                 </xsl:when>
997                 <xsl:otherwise>
998                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
999                         <xsl:value-of select="translate($f785, '()', '')"/>
1000                     </a>
1001                 </xsl:otherwise>
1002             </xsl:choose>
1003
1004         </span>
1005
1006         <xsl:if test="marc:subfield[@code='n']">
1007             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1008         </xsl:if>
1009
1010         </xsl:if>
1011         </xsl:for-each>
1012         </xsl:if>
1013
1014     </xsl:element>
1015     </xsl:template>
1016
1017     <xsl:template name="showAuthor">
1018         <xsl:param name="authorfield" />
1019         <xsl:param name="UseAuthoritiesForTracings" />
1020         <xsl:param name="materialTypeLabel" />
1021         <xsl:param name="theme" />
1022         <xsl:for-each select="$authorfield">
1023             <xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose>
1024             <xsl:choose>
1025                 <xsl:when test="not(@tag=111 or @tag=711)" />
1026                 <xsl:when test="marc:subfield[@code='n']">
1027                     <xsl:text> </xsl:text>
1028                     <xsl:call-template name="subfieldSelect">
1029                         <xsl:with-param name="codes">n</xsl:with-param>
1030                     </xsl:call-template>
1031                     <xsl:text> </xsl:text>
1032                 </xsl:when>
1033             </xsl:choose>
1034             <a>
1035                 <xsl:choose>
1036                     <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1037                         <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:"<xsl:value-of select="marc:subfield[@code=9]"/>"</xsl:attribute>
1038                     </xsl:when>
1039                     <xsl:otherwise>
1040                         <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
1041                     </xsl:otherwise>
1042                 </xsl:choose>
1043                 <span resource="#record"><span>
1044                     <xsl:choose>
1045                         <xsl:when test="substring(@tag, 1, 1)='1'">
1046                             <xsl:choose>
1047                                 <xsl:when test="$materialTypeLabel='Music'"><xsl:attribute name="property">byArtist</xsl:attribute></xsl:when>
1048                                 <xsl:otherwise><xsl:attribute name="property">author</xsl:attribute></xsl:otherwise>
1049                             </xsl:choose>
1050                         </xsl:when>
1051                         <xsl:otherwise><xsl:attribute name="property">contributor</xsl:attribute></xsl:otherwise>
1052                     </xsl:choose>
1053                     <xsl:choose>
1054                         <xsl:when test="substring(@tag, 2, 1)='0'">
1055                             <xsl:choose>
1056                                 <xsl:when test="$materialTypeLabel='Music'"><xsl:attribute name="typeof">MusicGroup</xsl:attribute></xsl:when>
1057                                 <xsl:otherwise><xsl:attribute name="typeof">Person</xsl:attribute></xsl:otherwise>
1058                             </xsl:choose>
1059                         </xsl:when>
1060                         <xsl:otherwise><xsl:attribute name="typeof">Organization</xsl:attribute></xsl:otherwise>
1061                     </xsl:choose>
1062                 <span property="name">
1063                 <xsl:choose>
1064                     <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCQ"/></xsl:when>
1065                     <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
1066                     <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
1067                 </xsl:choose>
1068                 </span></span></span>
1069                 <!-- add relator code too between brackets-->
1070                 <xsl:if test="marc:subfield[@code='4' or @code='e']">
1071                     <span class="relatorcode">
1072                     <xsl:text> [</xsl:text>
1073                     <xsl:choose>
1074                         <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
1075                         <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
1076                     </xsl:choose>
1077                     <xsl:text>]</xsl:text>
1078                     </span>
1079                 </xsl:if>
1080             </a>
1081             <xsl:if test="marc:subfield[@code=9]">
1082                 <a class='authlink'>
1083                     <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
1084                     <xsl:element name="img">
1085                         <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute>
1086                         <xsl:attribute name="style">vertical-align:middle</xsl:attribute>
1087                         <xsl:attribute name="height">15</xsl:attribute>
1088                         <xsl:attribute name="width">15</xsl:attribute>
1089                     </xsl:element>
1090                 </a>
1091             </xsl:if>
1092         </xsl:for-each>
1093         <xsl:text>.</xsl:text>
1094     </xsl:template>
1095
1096     <xsl:template name="nameABCQ">
1097             <xsl:call-template name="chopPunctuation">
1098                 <xsl:with-param name="chopString">
1099                     <xsl:call-template name="subfieldSelect">
1100                         <xsl:with-param name="codes">abcq</xsl:with-param>
1101                     </xsl:call-template>
1102                 </xsl:with-param>
1103                 <xsl:with-param name="punctuation">
1104                     <xsl:text>:,;/ </xsl:text>
1105                 </xsl:with-param>
1106             </xsl:call-template>
1107     </xsl:template>
1108
1109     <xsl:template name="nameABCDN">
1110             <xsl:call-template name="chopPunctuation">
1111                 <xsl:with-param name="chopString">
1112                     <xsl:call-template name="subfieldSelect">
1113                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1114                     </xsl:call-template>
1115                 </xsl:with-param>
1116                 <xsl:with-param name="punctuation">
1117                     <xsl:text>:,;/ </xsl:text>
1118                 </xsl:with-param>
1119             </xsl:call-template>
1120     </xsl:template>
1121
1122     <xsl:template name="nameACDEQ">
1123             <xsl:call-template name="subfieldSelect">
1124                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1125             </xsl:call-template>
1126     </xsl:template>
1127
1128     <xsl:template name="part">
1129         <xsl:variable name="partNumber">
1130             <xsl:call-template name="specialSubfieldSelect">
1131                 <xsl:with-param name="axis">n</xsl:with-param>
1132                 <xsl:with-param name="anyCodes">n</xsl:with-param>
1133                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1134             </xsl:call-template>
1135         </xsl:variable>
1136         <xsl:variable name="partName">
1137             <xsl:call-template name="specialSubfieldSelect">
1138                 <xsl:with-param name="axis">p</xsl:with-param>
1139                 <xsl:with-param name="anyCodes">p</xsl:with-param>
1140                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1141             </xsl:call-template>
1142         </xsl:variable>
1143         <xsl:if test="string-length(normalize-space($partNumber))">
1144                 <xsl:call-template name="chopPunctuation">
1145                     <xsl:with-param name="chopString" select="$partNumber"/>
1146                 </xsl:call-template>
1147         </xsl:if>
1148         <xsl:if test="string-length(normalize-space($partName))">
1149                 <xsl:call-template name="chopPunctuation">
1150                     <xsl:with-param name="chopString" select="$partName"/>
1151                 </xsl:call-template>
1152         </xsl:if>
1153     </xsl:template>
1154
1155     <xsl:template name="specialSubfieldSelect">
1156         <xsl:param name="anyCodes"/>
1157         <xsl:param name="axis"/>
1158         <xsl:param name="beforeCodes"/>
1159         <xsl:param name="afterCodes"/>
1160         <xsl:variable name="str">
1161             <xsl:for-each select="marc:subfield">
1162                 <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])">
1163                     <xsl:value-of select="text()"/>
1164                     <xsl:text> </xsl:text>
1165                 </xsl:if>
1166             </xsl:for-each>
1167         </xsl:variable>
1168         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1169     </xsl:template>
1170 </xsl:stylesheet>