Bug 28962: Add del-unv-selfreg to crontab
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / MARC21slim2intranetResults.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>
4 <xsl:stylesheet version="1.0"
5   xmlns:marc="http://www.loc.gov/MARC21/slim"
6   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7   xmlns:str="http://exslt.org/strings"
8   exclude-result-prefixes="marc str">
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     <xsl:template match="marc:record">
16
17         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
18         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
19         <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
20
21         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
22         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
23         <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
24         <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
25         <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
26         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
27         <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
28         <xsl:variable name="IntranetBiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='IntranetBiblioDefaultView']"/>
29         <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
30         <xsl:variable name="leader" select="marc:leader"/>
31         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
32         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
33         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
34         <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
35         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
36         <xsl:variable name="typeOf008">
37             <xsl:choose>
38                 <xsl:when test="$leader19='a'">ST</xsl:when>
39                 <xsl:when test="$leader6='a'">
40                     <xsl:choose>
41                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
42                         <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">CR</xsl:when>
43                     </xsl:choose>
44                 </xsl:when>
45                 <xsl:when test="$leader6='t'">BK</xsl:when>
46                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
47                 <xsl:when test="$leader6='m'">CF</xsl:when>
48                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
49                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
50                 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
51                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
52             </xsl:choose>
53         </xsl:variable>
54         <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
55         <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
56         <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
57         <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
58         <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
59         <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
60         <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
61         <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
62         <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
63
64         <xsl:variable name="physicalDescription">
65             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
66                 reformatted digital
67             </xsl:if>
68             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
69                 digitized microfilm
70             </xsl:if>
71             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
72                 digitized other analog
73             </xsl:if>
74
75             <xsl:variable name="check008-23">
76                 <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='CR' or $typeOf008='MX'">
77                     <xsl:value-of select="true()"></xsl:value-of>
78                 </xsl:if>
79             </xsl:variable>
80             <xsl:variable name="check008-29">
81                 <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
82                     <xsl:value-of select="true()"></xsl:value-of>
83                 </xsl:if>
84             </xsl:variable>
85             <xsl:choose>
86                 <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
87                     braille
88                 </xsl:when>
89                 <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='CR') and ($controlField008-23=' ' or $controlField008='r'))">
90                     print
91                 </xsl:when>
92                 <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
93                     electronic
94                 </xsl:when>
95                 <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
96                     microfiche
97                 </xsl:when>
98                 <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
99                     microfilm
100                 </xsl:when>
101                 <xsl:when test="($controlField008-23='d' and ($typeOf008='BK' or $typeOf008='CR'))">
102                     large print
103                 </xsl:when>
104             </xsl:choose>
105
106             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='b']">
107                 chip cartridge
108             </xsl:if>
109             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='j']">
110                 magnetic disc
111             </xsl:if>
112             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='m']">
113                 magneto-optical disc
114             </xsl:if>
115             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
116                 available online
117             </xsl:if>
118             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
119                 tape cartridge
120             </xsl:if>
121             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='f']">
122                 tape cassette
123             </xsl:if>
124             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='h']">
125                 tape reel
126             </xsl:if>
127
128             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
129                 kit
130             </xsl:if>
131
132             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
133                 atlas
134             </xsl:if>
135             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='g']">
136                 diagram
137             </xsl:if>
138             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
139                 map
140             </xsl:if>
141             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
142                 model
143             </xsl:if>
144             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='k']">
145                 profile
146             </xsl:if>
147             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
148                 remote-sensing image
149             </xsl:if>
150             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='s']">
151                 section
152             </xsl:if>
153             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='y']">
154                 view
155             </xsl:if>
156
157             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='a']">
158                 aperture card
159             </xsl:if>
160             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='e']">
161                 microfiche
162             </xsl:if>
163             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='f']">
164                 microfiche cassette
165             </xsl:if>
166             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='b']">
167                 microfilm cartridge
168             </xsl:if>
169             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='c']">
170                 microfilm cassette
171             </xsl:if>
172             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='d']">
173                 microfilm reel
174             </xsl:if>
175             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='g']">
176                 microopaque
177             </xsl:if>
178             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='c']">
179                 film cartridge
180             </xsl:if>
181             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='f']">
182                 film cassette
183             </xsl:if>
184             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='r']">
185                 film reel
186             </xsl:if>
187             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='c']">
188                 collage
189             </xsl:if>
190             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='f']">
191                 photomechanical print
192             </xsl:if>
193             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='g']">
194                 photonegative
195             </xsl:if>
196             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='h']">
197                 photoprint
198             </xsl:if>
199             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='j']">
200                 print
201             </xsl:if>
202             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='l']">
203                 technical drawing
204             </xsl:if>
205             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='d']">
206                 filmslip
207             </xsl:if>
208             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='c']">
209                 filmstrip cartridge
210             </xsl:if>
211             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='o']">
212                 filmstrip roll
213             </xsl:if>
214             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='f']">
215                 other filmstrip type
216             </xsl:if>
217             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='t']">
218                 transparency
219             </xsl:if>
220             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='r'][substring(text(),2,1)='r']">
221                 remote-sensing image
222             </xsl:if>
223             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='e']">
224                 cylinder
225             </xsl:if>
226             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='q']">
227                 roll
228             </xsl:if>
229             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='g']">
230                 sound cartridge
231             </xsl:if>
232             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='s']">
233                 sound cassette
234             </xsl:if>
235             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='t']">
236                 sound-tape reel
237             </xsl:if>
238             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='i']">
239                 sound-track film
240             </xsl:if>
241             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='w']">
242                 wire recording
243             </xsl:if>
244             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='c']">
245                 combination
246             </xsl:if>
247             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='b']">
248                 braille
249             </xsl:if>
250             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='a']">
251                 moon
252             </xsl:if>
253             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='d']">
254                 tactile, with no writing system
255             </xsl:if>
256             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='c']">
257                 braille
258             </xsl:if>
259             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='a']">
260                 regular print
261             </xsl:if>
262             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='d']">
263                 text in looseleaf binder
264             </xsl:if>
265             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='c']">
266                 videocartridge
267             </xsl:if>
268             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='f']">
269                 videocassette
270             </xsl:if>
271             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='r']">
272                 videoreel
273             </xsl:if>
274 <!--
275             <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
276                     <xsl:value-of select="."></xsl:value-of>
277             </xsl:for-each>
278             <xsl:for-each select="marc:datafield[@tag=300]">
279                     <xsl:call-template name="subfieldSelect">
280                         <xsl:with-param name="codes">abce</xsl:with-param>
281                     </xsl:call-template>
282             </xsl:for-each>
283 -->
284         </xsl:variable>
285
286         <!-- Indicate if record is suppressed in OPAC -->
287         <xsl:if test="$OpacSuppression = 1">
288             <xsl:if test="marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']">
289                 <span class="results_summary suppressed_opac">Suppressed in OPAC</span>
290             </xsl:if>
291         </xsl:if>
292
293         <!-- Title Statement: Alternate Graphic Representation (MARC 880) -->
294         <xsl:if test="$display880">
295            <xsl:call-template name="m880Select">
296               <xsl:with-param name="basetags">245</xsl:with-param>
297               <xsl:with-param name="codes">abhfgknps</xsl:with-param>
298               <xsl:with-param name="bibno"><xsl:value-of  select="$biblionumber"/></xsl:with-param>
299            </xsl:call-template>
300         </xsl:if>
301
302     <a>
303         <xsl:attribute name="href">
304             <xsl:call-template name="buildBiblioDefaultViewURL">
305                 <xsl:with-param name="IntranetBiblioDefaultView">
306                     <xsl:value-of select="$IntranetBiblioDefaultView"/>
307                 </xsl:with-param>
308             </xsl:call-template>
309             <xsl:value-of select="str:encode-uri($biblionumber, true())"/>
310         </xsl:attribute>
311         <xsl:attribute name="class">title</xsl:attribute>
312
313         <xsl:if test="marc:datafield[@tag=245]">
314             <xsl:for-each select="marc:datafield[@tag=245]">
315                 <xsl:call-template name="subfieldSelect">
316                     <xsl:with-param name="codes">a</xsl:with-param>
317                 </xsl:call-template>
318                 <xsl:text> </xsl:text>
319                 <!-- 13381 add additional subfields-->
320                 <!-- bz 17625 adding subfields f and g -->
321                 <xsl:for-each select="marc:subfield[contains('bcfghknps', @code)]">
322                     <xsl:choose>
323                         <xsl:when test="@code='h'">
324                             <!--  13381 Span class around subfield h so it can be suppressed via css -->
325                             <span class="title_medium"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
326                         </xsl:when>
327                         <xsl:when test="@code='c'">
328                             <!--  13381 Span class around subfield c so it can be suppressed via css -->
329                             <span class="title_resp_stmt"><xsl:apply-templates/> <xsl:text> </xsl:text> </span>
330                         </xsl:when>
331                         <xsl:otherwise>
332                             <xsl:apply-templates/>
333                             <xsl:text> </xsl:text>
334                         </xsl:otherwise>
335                     </xsl:choose>
336                 </xsl:for-each>
337             </xsl:for-each>
338         </xsl:if>
339     </a>
340
341     <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
342     <xsl:if test="$display880">
343       <xsl:call-template name="m880Select">
344       <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
345       <xsl:with-param name="codes">abc</xsl:with-param>
346       </xsl:call-template>
347     </xsl:if>
348
349     <xsl:choose>
350     <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]">
351     <p class="author"><span class="byAuthor">by </span>
352
353         <xsl:for-each select="marc:datafield[(@tag=100 or @tag=700 or @tag=110 or @tag=710 or @tag=111 or @tag=711) and @ind1!='z']">
354             <a>
355                 <xsl:choose>
356                     <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
357                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
358                     </xsl:when>
359                     <xsl:otherwise>
360                         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
361                     </xsl:otherwise>
362                 </xsl:choose>
363                 <xsl:call-template name="chopPunctuation">
364                     <xsl:with-param name="chopString">
365                         <xsl:call-template name="subfieldSelect">
366                             <xsl:with-param name="codes">
367                                 <xsl:choose>
368                                     <!-- #13383 include subfield e for field 111  -->
369                                     <xsl:when test="@tag=111 or @tag=711">aeq</xsl:when>
370                                     <xsl:when test="@tag=110 or @tag=710">ab</xsl:when>
371                                     <xsl:otherwise>abcjq</xsl:otherwise>
372                                 </xsl:choose>
373                             </xsl:with-param>
374                         </xsl:call-template>
375                     </xsl:with-param>
376                     <xsl:with-param name="punctuation">
377                         <xsl:text>:,;/ </xsl:text>
378                     </xsl:with-param>
379                 </xsl:call-template>
380             <!-- Display title portion for 110 and 710 fields -->
381             <xsl:if test="(@tag=110 or @tag=710) and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
382                 <span class="titleportion">
383                 <xsl:choose>
384                     <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
385                     <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
386                 </xsl:choose>
387                 <xsl:call-template name="chopPunctuation">
388                     <xsl:with-param name="chopString">
389                     <xsl:call-template name="subfieldSelect">
390                         <xsl:with-param name="codes">cdnt</xsl:with-param>
391                     </xsl:call-template>
392                     </xsl:with-param>
393                 </xsl:call-template>
394                 </span>
395             </xsl:if>
396             <!-- Display title portion for 111 and 711 fields -->
397             <xsl:if test="(@tag=111 or @tag=711) and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
398                     <span class="titleportion">
399                     <xsl:choose>
400                         <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
401                         <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
402                     </xsl:choose>
403
404                     <xsl:call-template name="chopPunctuation">
405                         <xsl:with-param name="chopString">
406                         <xsl:call-template name="subfieldSelect">
407                             <xsl:with-param name="codes">cdgnt</xsl:with-param>
408                         </xsl:call-template>
409                         </xsl:with-param>
410                     </xsl:call-template>
411                     </span>
412             </xsl:if>
413             <!-- Display dates for 100 and 700 fields -->
414             <xsl:if test="(@tag=100 or @tag=700) and marc:subfield[@code='d']">
415                 <span class="authordates">
416                 <xsl:text>, </xsl:text>
417                 <xsl:call-template name="chopPunctuation">
418                     <xsl:with-param name="chopString">
419                         <xsl:call-template name="subfieldSelect">
420                            <xsl:with-param name="codes">d</xsl:with-param>
421                         </xsl:call-template>
422                     </xsl:with-param>
423                 </xsl:call-template>
424                 </span>
425             </xsl:if>
426             <!-- Display title portion for 100 and 700 fields -->
427             <xsl:if test="@tag=700 and marc:subfield[@code='t']">
428                 <span class="titleportion">
429                 <xsl:text>. </xsl:text>
430                 <xsl:call-template name="chopPunctuation">
431                     <xsl:with-param name="chopString">
432                         <xsl:call-template name="subfieldSelect">
433                             <xsl:with-param name="codes">t</xsl:with-param>
434                         </xsl:call-template>
435                     </xsl:with-param>
436                 </xsl:call-template>
437                 </span>
438             </xsl:if>
439             </a>
440             <!-- Display relators for 1XX and 7XX fields -->
441             <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
442                 <span class="relatorcode">
443                     <xsl:text> [</xsl:text>
444                     <xsl:choose>
445                         <xsl:when test="@tag=111 or @tag=711">
446                             <xsl:choose>
447                                 <!-- Prefer j over 4 -->
448                                 <xsl:when test="marc:subfield[@code='j']">
449                                     <xsl:for-each select="marc:subfield[@code='j']">
450                                         <xsl:value-of select="."/>
451                                         <xsl:if test="position() != last()">, </xsl:if>
452                                     </xsl:for-each>
453                                 </xsl:when>
454                                 <xsl:otherwise>
455                                     <xsl:for-each select="marc:subfield[@code=4]">
456                                         <xsl:value-of select="."/>
457                                         <xsl:if test="position() != last()">, </xsl:if>
458                                     </xsl:for-each>
459                                 </xsl:otherwise>
460                             </xsl:choose>
461                         </xsl:when>
462                         <!-- Prefer e over 4 -->
463                         <xsl:when test="marc:subfield[@code='e']">
464                             <xsl:for-each select="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
465                                 <xsl:value-of select="."/>
466                                 <xsl:if test="position() != last()">, </xsl:if>
467                             </xsl:for-each>
468                         </xsl:when>
469                         <xsl:otherwise>
470                             <xsl:for-each select="marc:subfield[@code=4]">
471                                 <xsl:value-of select="."/>
472                                 <xsl:if test="position() != last()">, </xsl:if>
473                             </xsl:for-each>
474                         </xsl:otherwise>
475                     </xsl:choose>
476                     <xsl:text>]</xsl:text>
477                 </span>
478             </xsl:if>
479             <xsl:choose>
480                 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
481             </xsl:choose>
482         </xsl:for-each>
483     </p>
484     </xsl:when>
485     </xsl:choose>
486
487 <xsl:if test="$DisplayIconsXSLT!='0'">
488     <span class="results_summary">
489     <xsl:if test="$typeOf008!=''">
490         <span class="results_material_type">
491         <span class="label">Material type: </span>
492             <xsl:choose>
493                 <xsl:when test="$leader19='a'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
494                 <xsl:when test="$leader6='a'">
495                     <xsl:choose>
496                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book.png" alt="book" title="book" class="materialtype mt_icon_BK"/> Text</xsl:when>
497                         <xsl:when test="$leader7='i' or $leader7='s'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/newspaper.png" alt="serial" title="serial" class="materialtype mt_icon_CR"/> Continuing resource</xsl:when>
498                         <xsl:when test="$leader7='a' or $leader7='b'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book_open.png" alt="article" title="article" class="materialtype mt_icon_AR"/> Article</xsl:when>
499                     </xsl:choose>
500                 </xsl:when>
501                 <xsl:when test="$leader6='t'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/book.png" alt="book" title="book" class="materialtype mt_icon_BK"/> Text</xsl:when>
502                 <xsl:when test="$leader6='o'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype mt_icon_MX"/> Kit</xsl:when>
503                 <xsl:when test="$leader6='p'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials" class="materialtype mt_icon_MX"/>Mixed materials</xsl:when>
504                 <xsl:when test="$leader6='m'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/computer_link.png" alt="computer file" title="computer file" class="materialtype mt_icon_CF"/> Computer file</xsl:when>
505                 <xsl:when test="$leader6='e' or $leader6='f'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/map.png" alt="map" title="map" class="materialtype mt_icon_MP"/> Map</xsl:when>
506                 <xsl:when test="$leader6='g'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/film.png" alt="Film" class="materialtype mt_icon_VM"/> Film</xsl:when>
507                 <xsl:when test="$leader6='k'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/picture.png" alt="Picture" class="materialtype mt_icon_GR"/> Picture</xsl:when>
508                 <xsl:when test="$leader6='r'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/object.png" alt="Object" title="Object" class="materialtype mt_icon_OB"/> Object</xsl:when>
509                 <xsl:when test="$leader6='c' or $leader6='d'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/music.png" alt="score" title="score" class="materialtype mt_icon_PR"/> Score</xsl:when>
510                 <xsl:when test="$leader6='i'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype mt_icon_MU"/> Sound</xsl:when>
511                 <xsl:when test="$leader6='j'"><img src="/intranet-tmpl/prog/img/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype mt_icon_MU"/> Music</xsl:when>
512             </xsl:choose>
513         </span>
514     </xsl:if>
515
516     <xsl:if test="string-length(normalize-space($physicalDescription))">
517         <span class="results_format">
518             <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
519         </span>
520     </xsl:if>
521
522     <xsl:if test="$controlField008-21 or $controlField008-22 or $controlField008-24 or $controlField008-26 or $controlField008-29 or $controlField008-34 or $controlField008-33 or $controlField008-30-31 or $controlField008-33">
523
524         <xsl:if test="$typeOf008='CR'">
525         <span class="results_typeofcontinueing">
526         <xsl:if test="$controlField008-21 and $controlField008-21 !='|' and $controlField008-21 !=' '">
527             <span class="label">; Type of continuing resource: </span>
528         </xsl:if>
529             <xsl:choose>
530                 <xsl:when test="$controlField008-21='l'">
531                     loose-leaf
532                 </xsl:when>
533                 <xsl:when test="$controlField008-21='m'">
534                     series
535                 </xsl:when>
536                 <xsl:when test="$controlField008-21='n'">
537                     newspaper
538                 </xsl:when>
539                 <xsl:when test="$controlField008-21='p'">
540                     periodical
541                 </xsl:when>
542             </xsl:choose>
543         </span>
544         </xsl:if>
545         <xsl:if test="$typeOf008='BK' or $typeOf008='CR'">
546         <xsl:if test="contains($controlField008-24,'abcdefghijklmnopqrstvwxyz')">
547         <span class="results_natureofcontents">
548         <span class="label">; Nature of contents: </span>
549             <xsl:choose>
550                 <xsl:when test="contains($controlField008-24,'a')">
551                     abstract or summary
552                 </xsl:when>
553                 <xsl:when test="contains($controlField008-24,'b')">
554                     bibliography
555                 </xsl:when>
556                 <xsl:when test="contains($controlField008-24,'c')">
557                     catalog
558                 </xsl:when>
559                 <xsl:when test="contains($controlField008-24,'d')">
560                     dictionary
561                 </xsl:when>
562                 <xsl:when test="contains($controlField008-24,'e')">
563                     encyclopedia
564                 </xsl:when>
565                 <xsl:when test="contains($controlField008-24,'f')">
566                     handbook
567                 </xsl:when>
568                 <xsl:when test="contains($controlField008-24,'g')">
569                     legal article
570                 </xsl:when>
571                 <xsl:when test="contains($controlField008-24,'i')">
572                     index
573                 </xsl:when>
574                 <xsl:when test="contains($controlField008-24,'k')">
575                     discography
576                 </xsl:when>
577                 <xsl:when test="contains($controlField008-24,'l')">
578                     legislation
579                 </xsl:when>
580                 <xsl:when test="contains($controlField008-24,'m')">
581                     theses
582                 </xsl:when>
583                 <xsl:when test="contains($controlField008-24,'n')">
584                     survey of literature
585                 </xsl:when>
586                 <xsl:when test="contains($controlField008-24,'o')">
587                     review
588                 </xsl:when>
589                 <xsl:when test="contains($controlField008-24,'p')">
590                     programmed text
591                 </xsl:when>
592                 <xsl:when test="contains($controlField008-24,'q')">
593                     filmography
594                 </xsl:when>
595                 <xsl:when test="contains($controlField008-24,'r')">
596                     directory
597                 </xsl:when>
598                 <xsl:when test="contains($controlField008-24,'s')">
599                     statistics
600                 </xsl:when>
601                 <xsl:when test="contains($controlField008-24,'v')">
602                     legal case and case notes
603                 </xsl:when>
604                 <xsl:when test="contains($controlField008-24,'w')">
605                     law report or digest
606                 </xsl:when>
607                 <xsl:when test="contains($controlField008-24,'z')">
608                     treaty
609                 </xsl:when>
610             </xsl:choose>
611             <xsl:choose>
612                 <xsl:when test="$controlField008-29='1'">
613                     conference publication
614                 </xsl:when>
615             </xsl:choose>
616         </span>
617         </xsl:if>
618         </xsl:if>
619         <xsl:if test="$typeOf008='CF'">
620         <span class="results_typeofcomp">
621             <xsl:if test="$controlField008-26='a' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g'">
622             <span class="label">; Type of computer file: </span>
623             </xsl:if>
624             <xsl:choose>
625                 <xsl:when test="$controlField008-26='a'">
626                     numeric data
627                 </xsl:when>
628             </xsl:choose>
629         </span>
630         </xsl:if>
631         <xsl:if test="$typeOf008='BK'">
632         <span class="results_contents_literary">
633             <xsl:if test="(substring($controlField008,25,1)='j') or (substring($controlField008,25,1)='1') or ($controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d')">
634             <span class="label">; Nature of contents: </span>
635             </xsl:if>
636             <xsl:if test="substring($controlField008,25,1)='j'">
637                 patent
638             </xsl:if>
639             <xsl:if test="substring($controlField008,31,1)='1'">
640                 festschrift
641             </xsl:if>
642
643             <xsl:if test="$controlField008-33 and $controlField008-33!='|' and $controlField008-33!='u' and $controlField008-33!=' '">
644             <span class="label">; Literary form: </span>
645             </xsl:if>
646             <xsl:choose>
647                 <xsl:when test="$controlField008-33='0'">
648                     Not fiction
649                 </xsl:when>
650                 <xsl:when test="$controlField008-33='1'">
651                     Fiction
652                 </xsl:when>
653                 <xsl:when test="$controlField008-33='d'">
654                     Dramas
655                 </xsl:when>
656                 <xsl:when test="$controlField008-33='e'">
657                     Essays
658                 </xsl:when>
659                 <xsl:when test="$controlField008-33='f'">
660                     Novels
661                 </xsl:when>
662                 <xsl:when test="$controlField008-33='h'">
663                     Humor, satires, etc.
664                 </xsl:when>
665                 <xsl:when test="$controlField008-33='i'">
666                     Letters
667                 </xsl:when>
668                 <xsl:when test="$controlField008-33='j'">
669                     Short stories
670                 </xsl:when>
671                 <xsl:when test="$controlField008-33='m'">
672                     Mixed forms
673                 </xsl:when>
674                 <xsl:when test="$controlField008-33='p'">
675                     Poetry
676                 </xsl:when>
677                 <xsl:when test="$controlField008-33='s'">
678                     Speeches
679                 </xsl:when>
680             </xsl:choose>
681         </span>
682         </xsl:if>
683         <xsl:if test="$typeOf008='MU' and $controlField008-30-31 and $controlField008-30-31!='||' and $controlField008-30-31!='  '">
684         <span class="results_literaryform">
685             <span class="label">; Literary form: </span> <!-- Literary text for sound recordings -->
686             <xsl:if test="contains($controlField008-30-31,'b')">
687                 biography
688             </xsl:if>
689             <xsl:if test="contains($controlField008-30-31,'c')">
690                 conference publication
691             </xsl:if>
692             <xsl:if test="contains($controlField008-30-31,'d')">
693                 drama
694             </xsl:if>
695             <xsl:if test="contains($controlField008-30-31,'e')">
696                 essay
697             </xsl:if>
698             <xsl:if test="contains($controlField008-30-31,'f')">
699                 fiction
700             </xsl:if>
701             <xsl:if test="contains($controlField008-30-31,'o')">
702                 folktale
703             </xsl:if>
704             <xsl:if test="contains($controlField008-30-31,'h')">
705                 history
706             </xsl:if>
707             <xsl:if test="contains($controlField008-30-31,'k')">
708                 humor, satire
709             </xsl:if>
710             <xsl:if test="contains($controlField008-30-31,'m')">
711                 memoir
712             </xsl:if>
713             <xsl:if test="contains($controlField008-30-31,'p')">
714                 poetry
715             </xsl:if>
716             <xsl:if test="contains($controlField008-30-31,'r')">
717                 rehearsal
718             </xsl:if>
719             <xsl:if test="contains($controlField008-30-31,'g')">
720                 reporting
721             </xsl:if>
722             <xsl:if test="contains($controlField008-30-31,'s')">
723                 sound
724             </xsl:if>
725             <xsl:if test="contains($controlField008-30-31,'l')">
726                 speech
727             </xsl:if>
728         </span>
729         </xsl:if>
730         <xsl:if test="$typeOf008='VM'">
731         <span class="results_typeofvisual">
732             <span class="label">; Type of visual material: </span>
733             <xsl:choose>
734                 <xsl:when test="$controlField008-33='a'">
735                     art original
736                 </xsl:when>
737                 <xsl:when test="$controlField008-33='b'">
738                     kit
739                 </xsl:when>
740                 <xsl:when test="$controlField008-33='c'">
741                     art reproduction
742                 </xsl:when>
743                 <xsl:when test="$controlField008-33='d'">
744                     diorama
745                 </xsl:when>
746                 <xsl:when test="$controlField008-33='f'">
747                     filmstrip
748                 </xsl:when>
749                 <xsl:when test="$controlField008-33='g'">
750                     game
751                 </xsl:when>
752                 <xsl:when test="$controlField008-33='i'">
753                     picture
754                 </xsl:when>
755                 <xsl:when test="$controlField008-33='k'">
756                     graphic
757                 </xsl:when>
758                 <xsl:when test="$controlField008-33='l'">
759                     technical drawing
760                 </xsl:when>
761                 <xsl:when test="$controlField008-33='m'">
762                     motion picture
763                 </xsl:when>
764                 <xsl:when test="$controlField008-33='n'">
765                     chart
766                 </xsl:when>
767                 <xsl:when test="$controlField008-33='o'">
768                     flash card
769                 </xsl:when>
770                 <xsl:when test="$controlField008-33='p'">
771                     microscope slide
772                 </xsl:when>
773                 <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
774                     model
775                 </xsl:when>
776                 <xsl:when test="$controlField008-33='r'">
777                     realia
778                 </xsl:when>
779                 <xsl:when test="$controlField008-33='s'">
780                     slide
781                 </xsl:when>
782                 <xsl:when test="$controlField008-33='t'">
783                     transparency
784                 </xsl:when>
785                 <xsl:when test="$controlField008-33='v'">
786                     videorecording
787                 </xsl:when>
788                 <xsl:when test="$controlField008-33='w'">
789                     toy
790                 </xsl:when>
791             </xsl:choose>
792         </span>
793         </xsl:if>
794         </xsl:if>
795
796     <xsl:if test="($typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM') and ($controlField008-22='a' or $controlField008-22='b' or $controlField008-22='c' or $controlField008-22='d' or $controlField008-22='e' or $controlField008-22='g' or $controlField008-22='j' or $controlField008-22='f')">
797     <span class="results_audience">
798         <span class="label">; Audience: </span>
799         <xsl:choose>
800             <xsl:when test="$controlField008-22='a'">
801              Preschool;
802             </xsl:when>
803             <xsl:when test="$controlField008-22='b'">
804              Primary;
805             </xsl:when>
806             <xsl:when test="$controlField008-22='c'">
807              Pre-adolescent;
808             </xsl:when>
809             <xsl:when test="$controlField008-22='d'">
810              Adolescent;
811             </xsl:when>
812             <xsl:when test="$controlField008-22='e'">
813              Adult;
814             </xsl:when>
815             <xsl:when test="$controlField008-22='g'">
816              General;
817             </xsl:when>
818             <xsl:when test="$controlField008-22='j'">
819              Juvenile;
820             </xsl:when>
821             <xsl:when test="$controlField008-22='f'">
822              Specialized;
823             </xsl:when>
824         </xsl:choose>
825     </span>
826     </xsl:if>
827 <xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 -->
828         </span>
829 </xsl:if> <!-- DisplayIconsXSLT -->
830
831     <xsl:call-template name="show-lang-041"/>
832
833     <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
834     <xsl:if test="$display880">
835       <xsl:call-template name="m880Select">
836         <xsl:with-param name="basetags">260</xsl:with-param>
837         <xsl:with-param name="codes">abcg</xsl:with-param>
838         <xsl:with-param name="class">results_summary publisher</xsl:with-param>
839         <xsl:with-param name="label">Publication details: </xsl:with-param>
840       </xsl:call-template>
841     </xsl:if>
842
843     <xsl:call-template name="show-series">
844         <xsl:with-param name="searchurl">/cgi-bin/koha/catalogue/search.pl</xsl:with-param>
845         <xsl:with-param name="UseControlNumber" select="$UseControlNumber"/>
846         <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
847     </xsl:call-template>
848
849     <!-- Publisher info and RDA related info from tags 260, 264 -->
850     <xsl:choose>
851         <xsl:when test="marc:datafield[@tag=264]">
852             <xsl:call-template name="showRDAtag264"/>
853         </xsl:when>
854         <xsl:when test="marc:datafield[@tag=260]">
855             <span class="results_summary publisher"><span class="label">Publication details: </span>
856                 <xsl:for-each select="marc:datafield[@tag=260]">
857                     <xsl:if test="marc:subfield[@code='a']">
858                         <xsl:call-template name="subfieldSelect">
859                             <xsl:with-param name="codes">a</xsl:with-param>
860                         </xsl:call-template>
861                     </xsl:if>
862                     <xsl:text> </xsl:text>
863                     <xsl:if test="marc:subfield[@code='b']">
864                         <xsl:call-template name="subfieldSelect">
865                             <xsl:with-param name="codes">b</xsl:with-param>
866                         </xsl:call-template>
867                     </xsl:if>
868                     <xsl:text> </xsl:text>
869                     <xsl:call-template name="chopPunctuation">
870                       <xsl:with-param name="chopString">
871                         <xsl:call-template name="subfieldSelect">
872                             <xsl:with-param name="codes">cg</xsl:with-param>
873                         </xsl:call-template>
874                        </xsl:with-param>
875                     </xsl:call-template>
876                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
877                 </xsl:for-each>
878             </span>
879         </xsl:when>
880     </xsl:choose>
881
882     <!-- Publisher or Distributor Number -->
883     <xsl:if test="marc:datafield[@tag=028]">
884         <span class="results_summary publisher_number ">
885             <span class="label">Publisher number: </span>
886             <xsl:for-each select="marc:datafield[@tag=028]">
887                 <xsl:call-template name="subfieldSelect">
888                     <xsl:with-param name="codes">abq</xsl:with-param>
889                     <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
890                 </xsl:call-template>
891             </xsl:for-each>
892         </span>
893     </xsl:if>
894
895     <!-- Dissertation note -->
896     <xsl:if test="marc:datafield[@tag=502]">
897         <span class="results_summary diss_note">
898             <span class="label">Dissertation note: </span>
899             <xsl:for-each select="marc:datafield[@tag=502]">
900                 <xsl:call-template name="subfieldSelect">
901                     <xsl:with-param name="codes">abcdgo</xsl:with-param>
902                 </xsl:call-template>
903             </xsl:for-each>
904             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
905         </span>
906     </xsl:if>
907
908     <xsl:if test="marc:datafield[@tag=300]">
909     <span class="results_summary description"><span class="label">Description: </span>
910         <xsl:for-each select="marc:datafield[@tag=300]">
911             <xsl:call-template name="chopPunctuation">
912               <xsl:with-param name="chopString">
913                 <xsl:call-template name="subfieldSelect">
914                     <xsl:with-param name="codes">abcefg</xsl:with-param>
915                 </xsl:call-template>
916                </xsl:with-param>
917            </xsl:call-template>
918                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
919         </xsl:for-each>
920     </span>
921    </xsl:if>
922
923    <xsl:call-template name="showISBNISSN"/>
924
925     <xsl:if test="marc:datafield[@tag=250]">
926     <span class="results_summary edition">
927     <span class="label">Edition: </span>
928             <xsl:for-each select="marc:datafield[@tag=250]">
929                     <xsl:call-template name="subfieldSelect">
930                         <xsl:with-param name="codes">ab</xsl:with-param>
931                     </xsl:call-template>
932             </xsl:for-each>
933     </span>
934     </xsl:if>
935
936     <xsl:if test="marc:datafield[@tag=773]">
937         <xsl:for-each select="marc:datafield[@tag=773]">
938             <xsl:if test="marc:subfield[@code='t']">
939     <span class="results_summary source">
940     <span class="label">Source: </span>
941             <xsl:value-of select="marc:subfield[@code='t']"/>
942     </span>
943             </xsl:if>
944         </xsl:for-each>
945     </xsl:if>
946
947     <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
948     <xsl:if test="$display880">
949        <xsl:call-template name="m880Select">
950          <xsl:with-param name="basetags">246</xsl:with-param>
951          <xsl:with-param name="codes">ab</xsl:with-param>
952          <xsl:with-param name="class">results_summary other_title</xsl:with-param>
953          <xsl:with-param name="label">Other title: </xsl:with-param>
954        </xsl:call-template>
955     </xsl:if>
956
957     <xsl:if test="marc:datafield[@tag=246]">
958         <span class="results_summary other_title">
959     <span class="label">Other title: </span>
960             <xsl:for-each select="marc:datafield[@tag=246]">
961                     <xsl:call-template name="subfieldSelect">
962                         <xsl:with-param name="codes">ab</xsl:with-param>
963                     </xsl:call-template>
964                 <!-- #13386 added separator | -->
965                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
966             </xsl:for-each>
967         </span>
968     </xsl:if>
969     <xsl:if test="marc:datafield[@tag=856]">
970         <span class="results_summary online_access">
971             <span class="label">Online access: </span>
972             <xsl:for-each select="marc:datafield[@tag=856]">
973                 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
974                 <a>
975                     <xsl:attribute name="href">
976                         <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
977                             <xsl:choose>
978                                 <xsl:when test="@ind1=7">
979                                     <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
980                                 </xsl:when>
981                                 <xsl:when test="@ind1=1">
982                                     <xsl:text>ftp://</xsl:text>
983                                 </xsl:when>
984                                 <xsl:otherwise>
985                                     <xsl:text>http://</xsl:text>
986                                 </xsl:otherwise>
987                             </xsl:choose>
988                         </xsl:if>
989                         <xsl:value-of select="marc:subfield[@code='u']"/>
990                     </xsl:attribute>
991                     <xsl:choose>
992                         <xsl:when test="($Show856uAsImage='Results' 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')">
993                             <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>
994                         </xsl:when>
995                         <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
996                             <xsl:call-template name="subfieldSelect">
997                                 <xsl:with-param name="codes">y3z</xsl:with-param>
998                             </xsl:call-template>
999                         </xsl:when>
1000                         <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1001                             <xsl:choose>
1002                                 <xsl:when test="$URLLinkText!=''">
1003                                     <xsl:value-of select="$URLLinkText"/>
1004                                 </xsl:when>
1005                                 <xsl:otherwise>
1006                                     <xsl:text>Click here to access online</xsl:text>
1007                                 </xsl:otherwise>
1008                             </xsl:choose>
1009                         </xsl:when>
1010                     </xsl:choose>
1011                 </a>
1012                 <xsl:choose>
1013                     <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
1014                     <xsl:otherwise> | </xsl:otherwise>
1015                 </xsl:choose>
1016             </xsl:for-each>
1017         </span>
1018     </xsl:if>
1019 </xsl:template>
1020
1021     <xsl:template name="nameABCQ">
1022             <xsl:call-template name="chopPunctuation">
1023                 <xsl:with-param name="chopString">
1024                     <xsl:call-template name="subfieldSelect">
1025                         <xsl:with-param name="codes">abcq</xsl:with-param>
1026                     </xsl:call-template>
1027                 </xsl:with-param>
1028                 <xsl:with-param name="punctuation">
1029                     <xsl:text>:,;/ </xsl:text>
1030                 </xsl:with-param>
1031             </xsl:call-template>
1032     </xsl:template>
1033
1034     <xsl:template name="nameABCDN">
1035             <xsl:call-template name="chopPunctuation">
1036                 <xsl:with-param name="chopString">
1037                     <xsl:call-template name="subfieldSelect">
1038                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1039                     </xsl:call-template>
1040                 </xsl:with-param>
1041                 <xsl:with-param name="punctuation">
1042                     <xsl:text>:,;/ </xsl:text>
1043                 </xsl:with-param>
1044             </xsl:call-template>
1045     </xsl:template>
1046
1047     <xsl:template name="nameACDEQ">
1048             <xsl:call-template name="subfieldSelect">
1049                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1050             </xsl:call-template>
1051     </xsl:template>
1052
1053     <xsl:template name="nameDate">
1054         <xsl:for-each select="marc:subfield[@code='d']">
1055             <xsl:call-template name="chopPunctuation">
1056                 <xsl:with-param name="chopString" select="."/>
1057             </xsl:call-template>
1058         </xsl:for-each>
1059     </xsl:template>
1060
1061     <xsl:template name="role">
1062         <xsl:for-each select="marc:subfield[@code='e']">
1063                     <xsl:value-of select="."/>
1064         </xsl:for-each>
1065         <xsl:for-each select="marc:subfield[@code='4']">
1066                     <xsl:value-of select="."/>
1067         </xsl:for-each>
1068     </xsl:template>
1069
1070     <xsl:template name="specialSubfieldSelect">
1071         <xsl:param name="anyCodes"/>
1072         <xsl:param name="axis"/>
1073         <xsl:param name="beforeCodes"/>
1074         <xsl:param name="afterCodes"/>
1075         <xsl:variable name="str">
1076             <xsl:for-each select="marc:subfield">
1077                 <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])">
1078                     <xsl:value-of select="text()"/>
1079                     <xsl:text> </xsl:text>
1080                 </xsl:if>
1081             </xsl:for-each>
1082         </xsl:variable>
1083         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1084     </xsl:template>
1085
1086     <xsl:template name="subtitle">
1087         <xsl:if test="marc:subfield[@code='b']">
1088                 <xsl:call-template name="chopPunctuation">
1089                     <xsl:with-param name="chopString">
1090                         <xsl:value-of select="marc:subfield[@code='b']"/>
1091
1092                         <!--<xsl:call-template name="subfieldSelect">
1093                             <xsl:with-param name="codes">b</xsl:with-param>
1094                         </xsl:call-template>-->
1095                     </xsl:with-param>
1096                 </xsl:call-template>
1097         </xsl:if>
1098     </xsl:template>
1099
1100     <xsl:template name="chopBrackets">
1101         <xsl:param name="chopString"></xsl:param>
1102         <xsl:variable name="string">
1103             <xsl:call-template name="chopPunctuation">
1104                 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
1105             </xsl:call-template>
1106         </xsl:variable>
1107         <xsl:if test="substring($string, 1,1)='['">
1108             <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
1109         </xsl:if>
1110         <xsl:if test="substring($string, 1,1)!='['">
1111             <xsl:value-of select="$string"></xsl:value-of>
1112         </xsl:if>
1113     </xsl:template>
1114
1115 </xsl:stylesheet>