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