Bug 21518: Material type "three-dimensional artifact" displays as "visual material"
[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 [<!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   xmlns:str="http://exslt.org/strings"
9   exclude-result-prefixes="marc items str">
10     <xsl:import href="MARC21slimUtils.xsl"/>
11     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
13     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
14
15     <xsl:template match="/">
16             <xsl:apply-templates/>
17     </xsl:template>
18     <xsl:template match="marc:record">
19
20         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22
23         <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
24         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
25         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
26         <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
27         <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
28         <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
29         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
30         <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
31         <xsl:variable name="IntranetBiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='IntranetBiblioDefaultView']"/>
32         <xsl:variable name="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
33         <xsl:variable name="leader" select="marc:leader"/>
34         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
35         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
36         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
37         <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
38         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
39         <xsl:variable name="typeOf008">
40             <xsl:choose>
41                 <xsl:when test="$leader19='a'">ST</xsl:when>
42                 <xsl:when test="$leader6='a'">
43                     <xsl:choose>
44                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
45                         <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">CR</xsl:when>
46                     </xsl:choose>
47                 </xsl:when>
48                 <xsl:when test="$leader6='t'">BK</xsl:when>
49                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
50                 <xsl:when test="$leader6='m'">CF</xsl:when>
51                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
52                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
53                 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
54                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
55             </xsl:choose>
56         </xsl:variable>
57         <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
58         <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
59         <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
60         <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
61         <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
62         <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
63         <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
64         <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
65         <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
66
67         <xsl:variable name="physicalDescription">
68             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
69                 reformatted digital
70             </xsl:if>
71             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
72                 digitized microfilm
73             </xsl:if>
74             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
75                 digitized other analog
76             </xsl:if>
77
78             <xsl:variable name="check008-23">
79                 <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='CR' or $typeOf008='MX'">
80                     <xsl:value-of select="true()"></xsl:value-of>
81                 </xsl:if>
82             </xsl:variable>
83             <xsl:variable name="check008-29">
84                 <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
85                     <xsl:value-of select="true()"></xsl:value-of>
86                 </xsl:if>
87             </xsl:variable>
88             <xsl:choose>
89                 <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
90                     braille
91                 </xsl:when>
92                 <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='CR') and ($controlField008-23=' ' or $controlField008='r'))">
93                     print
94                 </xsl:when>
95                 <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
96                     electronic
97                 </xsl:when>
98                 <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
99                     microfiche
100                 </xsl:when>
101                 <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
102                     microfilm
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">by
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"/> Book</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"/> Book</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                     legal article
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">Publisher: </xsl:with-param>
840       </xsl:call-template>
841     </xsl:if>
842
843     <!-- Publisher info and RDA related info from tags 260, 264 -->
844     <xsl:choose>
845         <xsl:when test="marc:datafield[@tag=264]">
846             <xsl:call-template name="showRDAtag264"/>
847         </xsl:when>
848         <xsl:when test="marc:datafield[@tag=260]">
849             <span class="results_summary publisher"><span class="label">Publisher: </span>
850                 <xsl:for-each select="marc:datafield[@tag=260]">
851                     <xsl:if test="marc:subfield[@code='a']">
852                         <xsl:call-template name="subfieldSelect">
853                             <xsl:with-param name="codes">a</xsl:with-param>
854                         </xsl:call-template>
855                     </xsl:if>
856                     <xsl:text> </xsl:text>
857                     <xsl:if test="marc:subfield[@code='b']">
858                         <xsl:call-template name="subfieldSelect">
859                             <xsl:with-param name="codes">b</xsl:with-param>
860                         </xsl:call-template>
861                     </xsl:if>
862                     <xsl:text> </xsl:text>
863                     <xsl:call-template name="chopPunctuation">
864                       <xsl:with-param name="chopString">
865                         <xsl:call-template name="subfieldSelect">
866                             <xsl:with-param name="codes">cg</xsl:with-param>
867                         </xsl:call-template>
868                        </xsl:with-param>
869                     </xsl:call-template>
870                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
871                 </xsl:for-each>
872             </span>
873         </xsl:when>
874     </xsl:choose>
875
876     <!-- Dissertation note -->
877     <xsl:if test="marc:datafield[@tag=502]">
878         <span class="results_summary diss_note">
879             <span class="label">Dissertation note: </span>
880             <xsl:for-each select="marc:datafield[@tag=502]">
881                 <xsl:call-template name="subfieldSelect">
882                     <xsl:with-param name="codes">abcdgo</xsl:with-param>
883                 </xsl:call-template>
884             </xsl:for-each>
885             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
886         </span>
887     </xsl:if>
888
889     <xsl:if test="marc:datafield[@tag=300]">
890     <span class="results_summary description"><span class="label">Description: </span>
891         <xsl:for-each select="marc:datafield[@tag=300]">
892             <xsl:call-template name="chopPunctuation">
893               <xsl:with-param name="chopString">
894                 <xsl:call-template name="subfieldSelect">
895                     <xsl:with-param name="codes">abcefg</xsl:with-param>
896                 </xsl:call-template>
897                </xsl:with-param>
898            </xsl:call-template>
899                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
900         </xsl:for-each>
901     </span>
902    </xsl:if>
903
904    <xsl:call-template name="showISBNISSN"/>
905
906     <xsl:if test="marc:datafield[@tag=250]">
907     <span class="results_summary edition">
908     <span class="label">Edition: </span>
909             <xsl:for-each select="marc:datafield[@tag=250]">
910                     <xsl:call-template name="subfieldSelect">
911                         <xsl:with-param name="codes">ab</xsl:with-param>
912                     </xsl:call-template>
913             </xsl:for-each>
914     </span>
915     </xsl:if>
916
917     <xsl:if test="marc:datafield[@tag=773]">
918         <xsl:for-each select="marc:datafield[@tag=773]">
919             <xsl:if test="marc:subfield[@code='t']">
920     <span class="results_summary source">
921     <span class="label">Source: </span>
922             <xsl:value-of select="marc:subfield[@code='t']"/>
923     </span>
924             </xsl:if>
925         </xsl:for-each>
926     </xsl:if>
927
928     <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
929     <xsl:if test="$display880">
930        <xsl:call-template name="m880Select">
931          <xsl:with-param name="basetags">246</xsl:with-param>
932          <xsl:with-param name="codes">ab</xsl:with-param>
933          <xsl:with-param name="class">results_summary other_title</xsl:with-param>
934          <xsl:with-param name="label">Other title: </xsl:with-param>
935        </xsl:call-template>
936     </xsl:if>
937
938     <xsl:if test="marc:datafield[@tag=246]">
939         <span class="results_summary other_title">
940     <span class="label">Other title: </span>
941             <xsl:for-each select="marc:datafield[@tag=246]">
942                     <xsl:call-template name="subfieldSelect">
943                         <xsl:with-param name="codes">ab</xsl:with-param>
944                     </xsl:call-template>
945                 <!-- #13386 added separator | -->
946                 <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>
947             </xsl:for-each>
948         </span>
949     </xsl:if>
950     <xsl:if test="marc:datafield[@tag=856]">
951         <span class="results_summary online_access">
952             <span class="label">Online access: </span>
953             <xsl:for-each select="marc:datafield[@tag=856]">
954                 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
955                 <a>
956                     <xsl:attribute name="href">
957                         <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))">
958                             <xsl:choose>
959                                 <xsl:when test="@ind1=7">
960                                     <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text>
961                                 </xsl:when>
962                                 <xsl:when test="@ind1=1">
963                                     <xsl:text>ftp://</xsl:text>
964                                 </xsl:when>
965                                 <xsl:otherwise>
966                                     <xsl:text>http://</xsl:text>
967                                 </xsl:otherwise>
968                             </xsl:choose>
969                         </xsl:if>
970                         <xsl:value-of select="marc:subfield[@code='u']"/>
971                     </xsl:attribute>
972                     <xsl:choose>
973                         <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')">
974                             <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>
975                         </xsl:when>
976                         <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
977                             <xsl:call-template name="subfieldSelect">
978                                 <xsl:with-param name="codes">y3z</xsl:with-param>
979                             </xsl:call-template>
980                         </xsl:when>
981                         <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
982                             <xsl:choose>
983                                 <xsl:when test="$URLLinkText!=''">
984                                     <xsl:value-of select="$URLLinkText"/>
985                                 </xsl:when>
986                                 <xsl:otherwise>
987                                     <xsl:text>Click here to access online</xsl:text>
988                                 </xsl:otherwise>
989                             </xsl:choose>
990                         </xsl:when>
991                     </xsl:choose>
992                 </a>
993                 <xsl:choose>
994                     <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
995                     <xsl:otherwise> | </xsl:otherwise>
996                 </xsl:choose>
997             </xsl:for-each>
998         </span>
999     </xsl:if>
1000 </xsl:template>
1001
1002     <xsl:template name="nameABCQ">
1003             <xsl:call-template name="chopPunctuation">
1004                 <xsl:with-param name="chopString">
1005                     <xsl:call-template name="subfieldSelect">
1006                         <xsl:with-param name="codes">abcq</xsl:with-param>
1007                     </xsl:call-template>
1008                 </xsl:with-param>
1009                 <xsl:with-param name="punctuation">
1010                     <xsl:text>:,;/ </xsl:text>
1011                 </xsl:with-param>
1012             </xsl:call-template>
1013     </xsl:template>
1014
1015     <xsl:template name="nameABCDN">
1016             <xsl:call-template name="chopPunctuation">
1017                 <xsl:with-param name="chopString">
1018                     <xsl:call-template name="subfieldSelect">
1019                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1020                     </xsl:call-template>
1021                 </xsl:with-param>
1022                 <xsl:with-param name="punctuation">
1023                     <xsl:text>:,;/ </xsl:text>
1024                 </xsl:with-param>
1025             </xsl:call-template>
1026     </xsl:template>
1027
1028     <xsl:template name="nameACDEQ">
1029             <xsl:call-template name="subfieldSelect">
1030                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1031             </xsl:call-template>
1032     </xsl:template>
1033
1034     <xsl:template name="nameDate">
1035         <xsl:for-each select="marc:subfield[@code='d']">
1036             <xsl:call-template name="chopPunctuation">
1037                 <xsl:with-param name="chopString" select="."/>
1038             </xsl:call-template>
1039         </xsl:for-each>
1040     </xsl:template>
1041
1042     <xsl:template name="role">
1043         <xsl:for-each select="marc:subfield[@code='e']">
1044                     <xsl:value-of select="."/>
1045         </xsl:for-each>
1046         <xsl:for-each select="marc:subfield[@code='4']">
1047                     <xsl:value-of select="."/>
1048         </xsl:for-each>
1049     </xsl:template>
1050
1051     <xsl:template name="specialSubfieldSelect">
1052         <xsl:param name="anyCodes"/>
1053         <xsl:param name="axis"/>
1054         <xsl:param name="beforeCodes"/>
1055         <xsl:param name="afterCodes"/>
1056         <xsl:variable name="str">
1057             <xsl:for-each select="marc:subfield">
1058                 <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])">
1059                     <xsl:value-of select="text()"/>
1060                     <xsl:text> </xsl:text>
1061                 </xsl:if>
1062             </xsl:for-each>
1063         </xsl:variable>
1064         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1065     </xsl:template>
1066
1067     <xsl:template name="subtitle">
1068         <xsl:if test="marc:subfield[@code='b']">
1069                 <xsl:call-template name="chopPunctuation">
1070                     <xsl:with-param name="chopString">
1071                         <xsl:value-of select="marc:subfield[@code='b']"/>
1072
1073                         <!--<xsl:call-template name="subfieldSelect">
1074                             <xsl:with-param name="codes">b</xsl:with-param>
1075                         </xsl:call-template>-->
1076                     </xsl:with-param>
1077                 </xsl:call-template>
1078         </xsl:if>
1079     </xsl:template>
1080
1081     <xsl:template name="chopBrackets">
1082         <xsl:param name="chopString"></xsl:param>
1083         <xsl:variable name="string">
1084             <xsl:call-template name="chopPunctuation">
1085                 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
1086             </xsl:call-template>
1087         </xsl:variable>
1088         <xsl:if test="substring($string, 1,1)='['">
1089             <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
1090         </xsl:if>
1091         <xsl:if test="substring($string, 1,1)!='['">
1092             <xsl:value-of select="$string"></xsl:value-of>
1093         </xsl:if>
1094     </xsl:template>
1095
1096 </xsl:stylesheet>