Bug 11881: Small improvements for the availability informations in the search results...
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / xslt / MARC21slim2OPACResults.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
4 <xsl:stylesheet version="1.0"
5   xmlns:marc="http://www.loc.gov/MARC21/slim"
6   xmlns:items="http://www.koha-community.org/items"
7   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8   exclude-result-prefixes="marc items">
9     <xsl:import href="MARC21slimUtils.xsl"/>
10     <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11     <xsl:key name="item-by-status" match="items:item" use="items:status"/>
12     <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
13
14     <xsl:template match="/">
15             <xsl:apply-templates/>
16     </xsl:template>
17     <xsl:template match="marc:record">
18
19         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
20         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
21
22     <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
23     <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
24     <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
25     <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
26     <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
27     <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
28     <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
29     <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
30     <xsl:variable name="OPACItemLocation" select="marc:sysprefs/marc:syspref[@name='OPACItemLocation']"/>
31     <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
32     <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
33     <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
34         <xsl:variable name="leader" select="marc:leader"/>
35         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
36         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
37         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
38         <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
39         <xsl:variable name="isbn" select="marc:datafield[@tag=020]/marc:subfield[@code='a']"/>
40         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
41         <xsl:variable name="typeOf008">
42             <xsl:choose>
43                 <xsl:when test="$leader19='a'">ST</xsl:when>
44                 <xsl:when test="$leader6='a'">
45                     <xsl:choose>
46                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
47                         <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">CR</xsl:when>
48                     </xsl:choose>
49                 </xsl:when>
50                 <xsl:when test="$leader6='t'">BK</xsl:when>
51                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
52                 <xsl:when test="$leader6='m'">CF</xsl:when>
53                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
54                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
55                 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
56                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
57             </xsl:choose>
58         </xsl:variable>
59         <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
60         <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
61         <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
62         <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
63         <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
64         <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
65         <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
66         <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
67         <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
68
69         <xsl:variable name="physicalDescription">
70             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a']">
71                 reformatted digital
72             </xsl:if>
73             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='b']">
74                 digitized microfilm
75             </xsl:if>
76             <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='d']">
77                 digitized other analog
78             </xsl:if>
79
80             <xsl:variable name="check008-23">
81                 <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='CR' or $typeOf008='MX'">
82                     <xsl:value-of select="true()"></xsl:value-of>
83                 </xsl:if>
84             </xsl:variable>
85             <xsl:variable name="check008-29">
86                 <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
87                     <xsl:value-of select="true()"></xsl:value-of>
88                 </xsl:if>
89             </xsl:variable>
90             <xsl:choose>
91                 <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
92                     braille
93                 </xsl:when>
94                 <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='CR') and ($controlField008-23=' ' or $controlField008='r'))">
95                     print
96                 </xsl:when>
97                 <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
98                     electronic
99                 </xsl:when>
100                 <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
101                     microfiche
102                 </xsl:when>
103                 <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
104                     microfilm
105                 </xsl:when>
106             </xsl:choose>
107 <!--
108             <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']">
109                     <xsl:call-template name="chopBrackets">
110                         <xsl:with-param name="chopString">
111                             <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"></xsl:value-of>
112                         </xsl:with-param>
113                     </xsl:call-template>
114             </xsl:if>
115             <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']">
116                     <xsl:call-template name="chopBrackets">
117                         <xsl:with-param name="chopString">
118                             <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"></xsl:value-of>
119                         </xsl:with-param>
120                     </xsl:call-template>
121             </xsl:if>
122             <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']">
123                     <xsl:call-template name="chopBrackets">
124                         <xsl:with-param name="chopString">
125                             <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"></xsl:value-of>
126                         </xsl:with-param>
127                     </xsl:call-template>
128             </xsl:if>
129             <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']">
130                     <xsl:call-template name="chopBrackets">
131                         <xsl:with-param name="chopString">
132                             <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"></xsl:value-of>
133                         </xsl:with-param>
134                     </xsl:call-template>
135             </xsl:if>
136             <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']">
137                     <xsl:call-template name="chopBrackets">
138                         <xsl:with-param name="chopString">
139                             <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"></xsl:value-of>
140                         </xsl:with-param>
141                     </xsl:call-template>
142             </xsl:if>
143             <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']">
144                     <xsl:call-template name="chopBrackets">
145                         <xsl:with-param name="chopString">
146                             <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"></xsl:value-of>
147                         </xsl:with-param>
148                     </xsl:call-template>
149             </xsl:if>
150             <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']">
151                     <xsl:value-of select="."></xsl:value-of>
152             </xsl:for-each>
153             <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']">
154                 <xsl:choose>
155                     <xsl:when test="substring(text(),14,1)='a'">
156                         access
157                     </xsl:when>
158                     <xsl:when test="substring(text(),14,1)='p'">
159                         preservation
160                     </xsl:when>
161                     <xsl:when test="substring(text(),14,1)='r'">
162                         replacement
163                     </xsl:when>
164                 </xsl:choose>
165             </xsl:for-each>
166 -->
167             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='b']">
168                 chip cartridge
169             </xsl:if>
170             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='c']">
171                 <img src="/opac-tmpl/lib/famfamfam/silk/cd.png" alt="computer optical disc cartridge" title="computer optical disc cartridge" class="format"/>
172             </xsl:if>
173             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='j']">
174                 magnetic disc
175             </xsl:if>
176             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='m']">
177                 magneto-optical disc
178             </xsl:if>
179             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='o']">
180                 <img src="/opac-tmpl/lib/famfamfam/silk/cd.png" alt="optical disc" title="optical disc" class="format"/>
181             </xsl:if>
182             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
183                 available online
184                 <img src="/opac-tmpl/lib/famfamfam/silk/drive_web.png" alt="remote" title="remote" class="format"/>
185             </xsl:if>
186             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
187                 tape cartridge
188             </xsl:if>
189             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='f']">
190                 tape cassette
191             </xsl:if>
192             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='h']">
193                 tape reel
194             </xsl:if>
195
196             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='a']">
197                 <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="celestial globe" title="celestial globe" class="format"/>
198             </xsl:if>
199             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='e']">
200                 <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="earth moon globe" title="earth moon globe" class="format"/>
201             </xsl:if>
202             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='b']">
203                 <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="planetary or lunar globe" title="planetary or lunar globe" class="format"/>
204             </xsl:if>
205             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='c']">
206                 <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="terrestrial globe" title="terrestrial globe" class="format"/>
207             </xsl:if>
208
209             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
210                 kit
211             </xsl:if>
212
213             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
214                 atlas
215             </xsl:if>
216             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='g']">
217                 diagram
218             </xsl:if>
219             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
220                 map
221             </xsl:if>
222             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
223                 model
224             </xsl:if>
225             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='k']">
226                 profile
227             </xsl:if>
228             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
229                 remote-sensing image
230             </xsl:if>
231             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='s']">
232                 section
233             </xsl:if>
234             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='y']">
235                 view
236             </xsl:if>
237
238             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='a']">
239                 aperture card
240             </xsl:if>
241             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='e']">
242                 microfiche
243             </xsl:if>
244             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='f']">
245                 microfiche cassette
246             </xsl:if>
247             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='b']">
248                 microfilm cartridge
249             </xsl:if>
250             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='c']">
251                 microfilm cassette
252             </xsl:if>
253             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='d']">
254                 microfilm reel
255             </xsl:if>
256             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='h'][substring(text(),2,1)='g']">
257                 microopaque
258             </xsl:if>
259             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='c']">
260                 film cartridge
261             </xsl:if>
262             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='f']">
263                 film cassette
264             </xsl:if>
265             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='m'][substring(text(),2,1)='r']">
266                 film reel
267             </xsl:if>
268             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='n']">
269                 <img src="/opac-tmpl/lib/famfamfam/silk/chart_curve.png" alt="chart" title="chart" class="format"/>
270             </xsl:if>
271             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='c']">
272                 collage
273             </xsl:if>
274             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='d']">
275                  <img src="/opac-tmpl/lib/famfamfam/silk/pencil.png" alt="drawing" title="drawing" class="format"/>
276             </xsl:if>
277             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='o']">
278                 <img src="/opac-tmpl/lib/famfamfam/silk/note.png" alt="flash card" title="flash card" class="format"/>
279             </xsl:if>
280             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='e']">
281                 <img src="/opac-tmpl/lib/famfamfam/silk/paintbrush.png" alt="painting" title="painting" class="format"/>
282             </xsl:if>
283             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='f']">
284                 photomechanical print
285             </xsl:if>
286             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='g']">
287                 photonegative
288             </xsl:if>
289             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='h']">
290                 photoprint
291             </xsl:if>
292             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='i']">
293                 <img src="/opac-tmpl/lib/famfamfam/silk/picture.png" alt="picture" title="picture" class="format"/>
294             </xsl:if>
295             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='j']">
296                 print
297             </xsl:if>
298             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='l']">
299                 technical drawing
300             </xsl:if>
301             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='q'][substring(text(),2,1)='q']">
302                 <img src="/opac-tmpl/lib/famfamfam/silk/script.png" alt="notated music" title="notated music" class="format"/>
303             </xsl:if>
304             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='d']">
305                 filmslip
306             </xsl:if>
307             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='c']">
308                 filmstrip cartridge
309             </xsl:if>
310             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='o']">
311                 filmstrip roll
312             </xsl:if>
313             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='f']">
314                 other filmstrip type
315             </xsl:if>
316             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='s']">
317                 <img src="/opac-tmpl/lib/famfamfam/silk/pictures.png" alt="slide" title="slide" class="format"/>
318             </xsl:if>
319             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='t']">
320                 transparency
321             </xsl:if>
322             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='r'][substring(text(),2,1)='r']">
323                 remote-sensing image
324             </xsl:if>
325             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='e']">
326                 cylinder
327             </xsl:if>
328             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='q']">
329                 roll
330             </xsl:if>
331             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='g']">
332                 sound cartridge
333             </xsl:if>
334             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='s']">
335                 sound cassette
336             </xsl:if>
337             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='d']">
338                 <img src="/opac-tmpl/lib/famfamfam/silk/cd.png" alt="sound disc" title="sound disc" class="format"/>
339             </xsl:if>
340             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='t']">
341                 sound-tape reel
342             </xsl:if>
343             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='i']">
344                 sound-track film
345             </xsl:if>
346             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='w']">
347                 wire recording
348             </xsl:if>
349             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='c']">
350                 combination
351             </xsl:if>
352             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='b']">
353                 braille
354             </xsl:if>
355             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='a']">
356                 moon
357             </xsl:if>
358             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='f'][substring(text(),2,1)='d']">
359                 tactile, with no writing system
360             </xsl:if>
361             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='c']">
362                 braille
363             </xsl:if>
364             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='b']">
365                 <img src="/opac-tmpl/lib/famfamfam/silk/magnifier.png" alt="large print" title="large print" class="format"/>
366             </xsl:if>
367             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='a']">
368                 regular print
369             </xsl:if>
370             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='d']">
371                 text in looseleaf binder
372             </xsl:if>
373             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='c']">
374                 videocartridge
375             </xsl:if>
376             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='f']">
377                 videocassette
378             </xsl:if>
379             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='d']">
380                 <img src="/opac-tmpl/lib/famfamfam/silk/dvd.png" alt="videodisc" title="videodisc" class="format"/>
381             </xsl:if>
382             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='r']">
383                 videoreel
384             </xsl:if>
385 <!--
386             <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
387                     <xsl:value-of select="."></xsl:value-of>
388             </xsl:for-each>
389             <xsl:for-each select="marc:datafield[@tag=300]">
390                     <xsl:call-template name="subfieldSelect">
391                         <xsl:with-param name="codes">abce</xsl:with-param>
392                     </xsl:call-template>
393             </xsl:for-each>
394 -->
395         </xsl:variable>
396
397         <!-- Title Statement: Alternate Graphic Representation (MARC 880) -->
398         <xsl:if test="$display880">
399            <xsl:call-template name="m880Select">
400               <xsl:with-param name="basetags">245</xsl:with-param>
401               <xsl:with-param name="codes">abhfgknps</xsl:with-param>
402               <xsl:with-param name="bibno"><xsl:value-of  select="$biblionumber"/></xsl:with-param>
403            </xsl:call-template>
404         </xsl:if>
405
406     <a>
407         <xsl:attribute name="href">
408             <xsl:call-template name="buildBiblioDefaultViewURL">
409                 <xsl:with-param name="BiblioDefaultView">
410                     <xsl:value-of select="$BiblioDefaultView"/>
411                 </xsl:with-param>
412             </xsl:call-template>
413             <xsl:value-of select="$biblionumber"/>
414         </xsl:attribute>
415         <xsl:attribute name="class">title</xsl:attribute>
416
417         <xsl:if test="marc:datafield[@tag=245]">
418             <xsl:for-each select="marc:datafield[@tag=245]">
419                 <xsl:call-template name="subfieldSelect">
420                     <xsl:with-param name="codes">a</xsl:with-param>
421                 </xsl:call-template>
422                 <xsl:text> </xsl:text>
423                 <!-- 13381 add additional subfields-->
424                 <xsl:for-each select="marc:subfield[contains('bchknps', @code)]">
425                     <xsl:choose>
426                         <xsl:when test="@code='h'">
427                             <!--  13381 Span class around subfield h so it can be suppressed via css -->
428                             <span class="title_medium"><xsl:apply-templates/> </span>
429                         </xsl:when>
430                         <xsl:when test="@code='c'">
431                             <!--  13381 Span class around subfield c so it can be suppressed via css -->
432                             <span class="title_resp_stmt"><xsl:apply-templates/> </span>
433                         </xsl:when>
434                         <xsl:otherwise>
435                             <xsl:apply-templates/>
436                             <xsl:text> </xsl:text>
437                         </xsl:otherwise>
438                     </xsl:choose>
439                 </xsl:for-each>
440             </xsl:for-each>
441         </xsl:if>
442     </a>
443     <p>
444
445     <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
446     <xsl:if test="$display880">
447       <xsl:call-template name="m880Select">
448       <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
449       <xsl:with-param name="codes">abc</xsl:with-param>
450       </xsl:call-template>
451     </xsl:if>
452
453     <xsl:choose>
454     <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]">
455
456     by <span class="author">
457         <!-- #13383 -->
458         <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']">
459             <xsl:if test="@tag=111 or @tag=711 and marc:subfield[@code='n']">
460                 <xsl:text> </xsl:text>
461                 <xsl:call-template name="subfieldSelect">
462                     <xsl:with-param name="codes">n</xsl:with-param>
463                 </xsl:call-template>
464                 <xsl:text> </xsl:text>
465             </xsl:if>
466             <xsl:call-template name="chopPunctuation">
467                 <xsl:with-param name="chopString">
468                     <xsl:call-template name="subfieldSelect">
469                         <xsl:with-param name="codes">
470                             <xsl:choose>
471                                 <!-- #13383 include subfield e for field 111  -->
472                                 <xsl:when test="@tag=111">abcdeqt</xsl:when>
473                                 <xsl:otherwise>abcdjqt</xsl:otherwise>
474                             </xsl:choose>
475                         </xsl:with-param>
476                     </xsl:call-template>
477                 </xsl:with-param>
478                 <xsl:with-param name="punctuation">
479                     <xsl:text>:,;/ </xsl:text>
480                 </xsl:with-param>
481             </xsl:call-template>
482             <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'][. != ''])">
483                 <span class="relatorcode">
484                     <xsl:text> [</xsl:text>
485                     <xsl:choose>
486                         <xsl:when test="@tag=111">
487                             <xsl:choose>
488                                 <!-- Prefer j over 4 -->
489                                 <xsl:when test="marc:subfield[@code='j']">
490                                     <xsl:for-each select="marc:subfield[@code='j']">
491                                         <xsl:value-of select="."/>
492                                         <xsl:if test="position() != last()">, </xsl:if>
493                                     </xsl:for-each>
494                                 </xsl:when>
495                                 <xsl:otherwise>
496                                     <xsl:for-each select="marc:subfield[@code=4]">
497                                         <xsl:value-of select="."/>
498                                         <xsl:if test="position() != last()">, </xsl:if>
499                                     </xsl:for-each>
500                                 </xsl:otherwise>
501                             </xsl:choose>
502                         </xsl:when>
503                         <!-- Prefer e over 4 -->
504                         <xsl:when test="marc:subfield[@code='e']">
505                             <xsl:for-each select="marc:subfield[@code='e']">
506                                 <xsl:value-of select="."/>
507                                 <xsl:if test="position() != last()">, </xsl:if>
508                             </xsl:for-each>
509                         </xsl:when>
510                         <xsl:otherwise>
511                             <xsl:for-each select="marc:subfield[@code=4]">
512                                 <xsl:value-of select="."/>
513                                 <xsl:if test="position() != last()">, </xsl:if>
514                             </xsl:for-each>
515                         </xsl:otherwise>
516                     </xsl:choose>
517                     <xsl:text>]</xsl:text>
518                 </span>
519             </xsl:if>
520             <xsl:choose>
521                 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
522             </xsl:choose>
523         </xsl:for-each>
524
525     </span>
526     </xsl:when>
527     </xsl:choose>
528     </p>
529
530     <xsl:if test="marc:datafield[@tag=250]">
531     <span class="results_summary edition">
532     <span class="label">Edition: </span>
533             <xsl:for-each select="marc:datafield[@tag=250]">
534                     <xsl:call-template name="subfieldSelect">
535                         <xsl:with-param name="codes">ab</xsl:with-param>
536                     </xsl:call-template>
537             </xsl:for-each>
538         </span>
539     </xsl:if>
540
541     <xsl:if test="marc:datafield[@tag=773]">
542         <xsl:for-each select="marc:datafield[@tag=773]">
543             <xsl:if test="marc:subfield[@code='t']">
544     <span class="results_summary source">
545     <span class="label">Source: </span>
546             <xsl:value-of select="marc:subfield[@code='t']"/>
547     </span>
548             </xsl:if>
549         </xsl:for-each>
550     </xsl:if>
551
552 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
553     <span class="results_summary type">
554     <xsl:if test="$typeOf008!=''">
555     <span class="results_material_type">
556         <span class="label">Material type: </span>
557             <xsl:choose>
558                 <xsl:when test="$leader19='a'"><img src="/opac-tmpl/lib/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
559                 <xsl:when test="$leader6='a'">
560                     <xsl:choose>
561                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/opac-tmpl/lib/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
562                         <xsl:when test="$leader7='i' or $leader7='s'"><img src="/opac-tmpl/lib/famfamfam/silk/newspaper.png" alt="serial" title="serial" class="materialtype"/> Continuing Resource</xsl:when>
563                         <xsl:when test="$leader7='a' or $leader7='b'"><img src="/opac-tmpl/lib/famfamfam/silk/book_open.png" alt="article" title="article" class="materialtype"/> Article</xsl:when>
564                     </xsl:choose>
565                 </xsl:when>
566                 <xsl:when test="$leader6='t'"><img src="/opac-tmpl/lib/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
567                 <xsl:when test="$leader6='o'"><img src="/opac-tmpl/lib/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype"/> Kit</xsl:when>
568                 <xsl:when test="$leader6='p'"><img src="/opac-tmpl/lib/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials" class="materialtype"/>Mixed Materials</xsl:when>
569                 <xsl:when test="$leader6='m'"><img src="/opac-tmpl/lib/famfamfam/silk/computer_link.png" alt="computer file" title="computer file" class="materialtype"/> Computer File</xsl:when>
570                 <xsl:when test="$leader6='e' or $leader6='f'"><img src="/opac-tmpl/lib/famfamfam/silk/map.png" alt="map" title="map" class="materialtype"/> Map</xsl:when>
571                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"><img src="/opac-tmpl/lib/famfamfam/silk/film.png" alt="visual material" title="visual material" class="materialtype"/> Visual Material</xsl:when>
572                 <xsl:when test="$leader6='c' or $leader6='d'"><img src="/opac-tmpl/lib/famfamfam/silk/music.png" alt="score" title="score" class="materialtype"/> Score</xsl:when>
573                 <xsl:when test="$leader6='i'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype"/> Sound</xsl:when>
574                 <xsl:when test="$leader6='j'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype"/> Music</xsl:when>
575             </xsl:choose>
576     </span>
577     </xsl:if>
578     <xsl:if test="string-length(normalize-space($physicalDescription))">
579         <span class="results_format">
580             <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
581         </span>
582     </xsl:if>
583
584         <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">
585
586         <xsl:if test="$typeOf008='CR'">
587         <span class="results_typeofcontinuing">
588         <xsl:if test="$controlField008-21 and $controlField008-21 !='|' and $controlField008-21 !=' '">
589         <span class="label">; Type of continuing resource: </span>
590         </xsl:if>
591             <xsl:choose>
592                 <xsl:when test="$controlField008-21='d'">
593                      <img src="/opac-tmpl/lib/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
594                 </xsl:when>
595                 <xsl:when test="$controlField008-21='l'">
596                     loose-leaf
597                 </xsl:when>
598                 <xsl:when test="$controlField008-21='m'">
599                     series
600                 </xsl:when>
601                 <xsl:when test="$controlField008-21='n'">
602                     newspaper
603                 </xsl:when>
604                 <xsl:when test="$controlField008-21='p'">
605                     periodical
606                 </xsl:when>
607                 <xsl:when test="$controlField008-21='w'">
608                      <img src="/opac-tmpl/lib/famfamfam/silk/world_link.png" alt="web site" title="web site" class="format"/>
609                 </xsl:when>
610             </xsl:choose>
611         </span>
612         </xsl:if>
613         <xsl:if test="$typeOf008='BK' or $typeOf008='CR'">
614         <xsl:if test="contains($controlField008-24,'abcdefghijklmnopqrstvwxyz')">
615         <span class="results_natureofcontents">
616         <span class="label">; Nature of contents: </span>
617             <xsl:choose>
618                 <xsl:when test="contains($controlField008-24,'a')">
619                     abstract or summary
620                 </xsl:when>
621                 <xsl:when test="contains($controlField008-24,'b')">
622                         bibliography
623                      <img src="/opac-tmpl/lib/famfamfam/silk/text_list_bullets.png" alt="bibliography" title="bibliography" class="natureofcontents"/>
624                 </xsl:when>
625                 <xsl:when test="contains($controlField008-24,'c')">
626                     catalog
627                 </xsl:when>
628                 <xsl:when test="contains($controlField008-24,'d')">
629                     dictionary
630                 </xsl:when>
631                 <xsl:when test="contains($controlField008-24,'e')">
632                     encyclopedia
633                 </xsl:when>
634                 <xsl:when test="contains($controlField008-24,'f')">
635                     handbook
636                 </xsl:when>
637                 <xsl:when test="contains($controlField008-24,'g')">
638                     legal article
639                 </xsl:when>
640                 <xsl:when test="contains($controlField008-24,'i')">
641                     index
642                 </xsl:when>
643                 <xsl:when test="contains($controlField008-24,'k')">
644                     discography
645                 </xsl:when>
646                 <xsl:when test="contains($controlField008-24,'l')">
647                     legislation
648                 </xsl:when>
649                 <xsl:when test="contains($controlField008-24,'m')">
650                     theses
651                 </xsl:when>
652                 <xsl:when test="contains($controlField008-24,'n')">
653                     survey of literature
654                 </xsl:when>
655                 <xsl:when test="contains($controlField008-24,'o')">
656                     review
657                 </xsl:when>
658                 <xsl:when test="contains($controlField008-24,'p')">
659                     programmed text
660                 </xsl:when>
661                 <xsl:when test="contains($controlField008-24,'q')">
662                     filmography
663                 </xsl:when>
664                 <xsl:when test="contains($controlField008-24,'r')">
665                     directory
666                 </xsl:when>
667                 <xsl:when test="contains($controlField008-24,'s')">
668                     statistics
669                 </xsl:when>
670                 <xsl:when test="contains($controlField008-24,'t')">
671                      <img src="/opac-tmpl/lib/famfamfam/silk/report.png" alt="technical report" title="technical report" class="natureofcontents"/>
672                 </xsl:when>
673                 <xsl:when test="contains($controlField008-24,'v')">
674                     legal case and case notes
675                 </xsl:when>
676                 <xsl:when test="contains($controlField008-24,'w')">
677                     law report or digest
678                 </xsl:when>
679                 <xsl:when test="contains($controlField008-24,'z')">
680                     treaty
681                 </xsl:when>
682             </xsl:choose>
683             <xsl:choose>
684                 <xsl:when test="$controlField008-29='1'">
685                     conference publication
686                 </xsl:when>
687             </xsl:choose>
688         </span>
689         </xsl:if>
690         </xsl:if>
691         <xsl:if test="$typeOf008='CF'">
692         <span class="results_typeofcomp">
693             <xsl:if test="$controlField008-26='a' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g'">
694             <span class="label">; Type of computer file: </span>
695             </xsl:if>
696             <xsl:choose>
697                 <xsl:when test="$controlField008-26='a'">
698                     numeric data
699                 </xsl:when>
700                 <xsl:when test="$controlField008-26='e'">
701                      <img src="/opac-tmpl/lib/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
702                 </xsl:when>
703                 <xsl:when test="$controlField008-26='f'">
704                      <img src="/opac-tmpl/lib/famfamfam/silk/font.png" alt="font" title="font" class="format"/>
705                 </xsl:when>
706                 <xsl:when test="$controlField008-26='g'">
707                      <img src="/opac-tmpl/lib/famfamfam/silk/controller.png" alt="game" title="game" class="format"/>
708                 </xsl:when>
709             </xsl:choose>
710         </span>
711         </xsl:if>
712         <xsl:if test="$typeOf008='BK'">
713         <span class="results_contents_literary">
714             <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')">
715             <span class="label">; Nature of contents: </span>
716             </xsl:if>
717             <xsl:if test="substring($controlField008,25,1)='j'">
718                 patent
719             </xsl:if>
720             <xsl:if test="substring($controlField008,31,1)='1'">
721                 festschrift
722             </xsl:if>
723             <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
724                  <img src="/opac-tmpl/lib/famfamfam/silk/user.png" alt="biography" title="biography" class="natureofcontents"/>
725             </xsl:if>
726
727             <xsl:if test="$controlField008-33 and $controlField008-33!='|' and $controlField008-33!='u' and $controlField008-33!=' '">
728             <span class="label">; Literary form: </span>
729             </xsl:if>
730             <xsl:choose>
731                 <xsl:when test="$controlField008-33='0'">
732                     not fiction
733                 </xsl:when>
734                 <xsl:when test="$controlField008-33='1'">
735                     fiction
736                 </xsl:when>
737                 <xsl:when test="$controlField008-33='e'">
738                     essay
739                 </xsl:when>
740                 <xsl:when test="$controlField008-33='d'">
741                     drama
742                 </xsl:when>
743                 <xsl:when test="$controlField008-33='c'">
744                     comic strip
745                 </xsl:when>
746                 <xsl:when test="$controlField008-33='l'">
747                     fiction
748                 </xsl:when>
749                 <xsl:when test="$controlField008-33='h'">
750                     humor, satire
751                 </xsl:when>
752                 <xsl:when test="$controlField008-33='i'">
753                     letter
754                 </xsl:when>
755                 <xsl:when test="$controlField008-33='f'">
756                     novel
757                 </xsl:when>
758                 <xsl:when test="$controlField008-33='j'">
759                     short story
760                 </xsl:when>
761                 <xsl:when test="$controlField008-33='s'">
762                     speech
763                 </xsl:when>
764             </xsl:choose>
765         </span>
766         </xsl:if>
767         <xsl:if test="$typeOf008='MU' and $controlField008-30-31 and $controlField008-30-31!='||' and $controlField008-30-31!='  '">
768         <span class="results_literaryform">
769             <span class="label">; Literary form: </span> <!-- Literary text for sound recordings -->
770             <xsl:if test="contains($controlField008-30-31,'b')">
771                 biography
772             </xsl:if>
773             <xsl:if test="contains($controlField008-30-31,'c')">
774                 conference publication
775             </xsl:if>
776             <xsl:if test="contains($controlField008-30-31,'d')">
777                 drama
778             </xsl:if>
779             <xsl:if test="contains($controlField008-30-31,'e')">
780                 essay
781             </xsl:if>
782             <xsl:if test="contains($controlField008-30-31,'f')">
783                 fiction
784             </xsl:if>
785             <xsl:if test="contains($controlField008-30-31,'o')">
786                 folktale
787             </xsl:if>
788             <xsl:if test="contains($controlField008-30-31,'h')">
789                 history
790             </xsl:if>
791             <xsl:if test="contains($controlField008-30-31,'k')">
792                 humor, satire
793             </xsl:if>
794             <xsl:if test="contains($controlField008-30-31,'m')">
795                 memoir
796             </xsl:if>
797             <xsl:if test="contains($controlField008-30-31,'p')">
798                 poetry
799             </xsl:if>
800             <xsl:if test="contains($controlField008-30-31,'r')">
801                 rehearsal
802             </xsl:if>
803             <xsl:if test="contains($controlField008-30-31,'g')">
804                 reporting
805             </xsl:if>
806             <xsl:if test="contains($controlField008-30-31,'s')">
807                 sound
808             </xsl:if>
809             <xsl:if test="contains($controlField008-30-31,'l')">
810                 speech
811             </xsl:if>
812         </span>
813         </xsl:if>
814         <xsl:if test="$typeOf008='VM'">
815         <span class="results_typeofvisual">
816             <span class="label">; Type of visual material: </span>
817             <xsl:choose>
818                 <xsl:when test="$controlField008-33='a'">
819                     art original
820                 </xsl:when>
821                 <xsl:when test="$controlField008-33='b'">
822                     kit
823                 </xsl:when>
824                 <xsl:when test="$controlField008-33='c'">
825                     art reproduction
826                 </xsl:when>
827                 <xsl:when test="$controlField008-33='d'">
828                     diorama
829                 </xsl:when>
830                 <xsl:when test="$controlField008-33='f'">
831                     filmstrip
832                 </xsl:when>
833                 <xsl:when test="$controlField008-33='g'">
834                     legal article
835                 </xsl:when>
836                 <xsl:when test="$controlField008-33='i'">
837                     picture
838                 </xsl:when>
839                 <xsl:when test="$controlField008-33='k'">
840                     graphic
841                 </xsl:when>
842                 <xsl:when test="$controlField008-33='l'">
843                     technical drawing
844                 </xsl:when>
845                 <xsl:when test="$controlField008-33='m'">
846                     motion picture
847                 </xsl:when>
848                 <xsl:when test="$controlField008-33='n'">
849                     chart
850                 </xsl:when>
851                 <xsl:when test="$controlField008-33='o'">
852                     flash card
853                 </xsl:when>
854                 <xsl:when test="$controlField008-33='p'">
855                     microscope slide
856                 </xsl:when>
857                 <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
858                     model
859                 </xsl:when>
860                 <xsl:when test="$controlField008-33='r'">
861                     realia
862                 </xsl:when>
863                 <xsl:when test="$controlField008-33='s'">
864                     slide
865                 </xsl:when>
866                 <xsl:when test="$controlField008-33='t'">
867                     transparency
868                 </xsl:when>
869                 <xsl:when test="$controlField008-33='v'">
870                     videorecording
871                 </xsl:when>
872                 <xsl:when test="$controlField008-33='w'">
873                     toy
874                 </xsl:when>
875             </xsl:choose>
876             </span>
877         </xsl:if>
878         </xsl:if>
879
880     <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')">
881         <span class="results_audience">
882         <span class="label">; Audience: </span>
883         <xsl:choose>
884             <xsl:when test="$controlField008-22='a'">
885              Preschool;
886             </xsl:when>
887             <xsl:when test="$controlField008-22='b'">
888              Primary;
889             </xsl:when>
890             <xsl:when test="$controlField008-22='c'">
891              Pre-adolescent;
892             </xsl:when>
893             <xsl:when test="$controlField008-22='d'">
894              Adolescent;
895             </xsl:when>
896             <xsl:when test="$controlField008-22='e'">
897              Adult;
898             </xsl:when>
899             <xsl:when test="$controlField008-22='g'">
900              General;
901             </xsl:when>
902             <xsl:when test="$controlField008-22='j'">
903              Juvenile;
904             </xsl:when>
905             <xsl:when test="$controlField008-22='f'">
906              Specialized;
907             </xsl:when>
908         </xsl:choose>
909         </span>
910     </xsl:if>
911 <xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 -->
912         </span>
913 </xsl:if>
914
915     <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
916     <xsl:if test="$display880">
917       <xsl:call-template name="m880Select">
918         <xsl:with-param name="basetags">260</xsl:with-param>
919         <xsl:with-param name="codes">abcg</xsl:with-param>
920         <xsl:with-param name="class">results_summary publisher</xsl:with-param>
921         <xsl:with-param name="label">Publisher: </xsl:with-param>
922       </xsl:call-template>
923     </xsl:if>
924
925     <!-- Publisher info and RDA related info from tags 260, 264 -->
926     <xsl:choose>
927         <xsl:when test="marc:datafield[@tag=264]">
928             <xsl:call-template name="showRDAtag264"/>
929         </xsl:when>
930         <xsl:when test="marc:datafield[@tag=260]">
931             <span class="results_summary publisher"><span class="label">Publisher: </span>
932                 <xsl:for-each select="marc:datafield[@tag=260]">
933                     <xsl:if test="marc:subfield[@code='a']">
934                         <xsl:call-template name="subfieldSelect">
935                             <xsl:with-param name="codes">a</xsl:with-param>
936                         </xsl:call-template>
937                     </xsl:if>
938                     <xsl:text> </xsl:text>
939                     <xsl:if test="marc:subfield[@code='b']">
940                         <xsl:call-template name="subfieldSelect">
941                             <xsl:with-param name="codes">b</xsl:with-param>
942                         </xsl:call-template>
943                     </xsl:if>
944                     <xsl:text> </xsl:text>
945                     <xsl:call-template name="chopPunctuation">
946                       <xsl:with-param name="chopString">
947                         <xsl:call-template name="subfieldSelect">
948                             <xsl:with-param name="codes">cg</xsl:with-param>
949                         </xsl:call-template>
950                        </xsl:with-param>
951                     </xsl:call-template>
952                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
953                 </xsl:for-each>
954                 <xsl:if test="marc:datafield[@tag=264]">
955                     <xsl:text>; </xsl:text>
956                     <xsl:call-template name="showRDAtag264"/>
957                 </xsl:if>
958             </span>
959         </xsl:when>
960     </xsl:choose>
961
962     <!-- Dissertation note -->
963     <xsl:if test="marc:datafield[@tag=502]">
964         <span class="results_summary diss_note">
965             <span class="label">Dissertation note: </span>
966             <xsl:for-each select="marc:datafield[@tag=502]">
967                 <xsl:call-template name="subfieldSelect">
968                     <xsl:with-param name="codes">abcdgo</xsl:with-param>
969                 </xsl:call-template>
970             </xsl:for-each>
971             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
972         </span>
973     </xsl:if>
974
975     <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
976     <xsl:if test="$display880">
977        <xsl:call-template name="m880Select">
978          <xsl:with-param name="basetags">246</xsl:with-param>
979          <xsl:with-param name="codes">ab</xsl:with-param>
980          <xsl:with-param name="class">results_summary other_title</xsl:with-param>
981          <xsl:with-param name="label">Other title: </xsl:with-param>
982        </xsl:call-template>
983     </xsl:if>
984
985     <xsl:if test="marc:datafield[@tag=246]">
986     <span class="results_summary other_title">
987     <span class="label">Other title: </span>
988             <xsl:for-each select="marc:datafield[@tag=246]">
989                     <xsl:call-template name="subfieldSelect">
990                         <xsl:with-param name="codes">ab</xsl:with-param>
991                     </xsl:call-template>
992                 <!-- #13386 added separator | -->
993                 <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>
994             </xsl:for-each>
995         </span>
996     </xsl:if>
997     <xsl:if test="marc:datafield[@tag=242]">
998     <span class="results_summary translated_title">
999     <span class="label">Title translated: </span>
1000             <xsl:for-each select="marc:datafield[@tag=242]">
1001                     <xsl:call-template name="subfieldSelect">
1002                         <xsl:with-param name="codes">abh</xsl:with-param>
1003                     </xsl:call-template>
1004                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1005             </xsl:for-each>
1006         </span>
1007     </xsl:if>
1008     <xsl:if test="marc:datafield[@tag=856]">
1009          <span class="results_summary online_resources">
1010                            <span class="label">Online Access: </span>
1011                             <xsl:for-each select="marc:datafield[@tag=856]">
1012                             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
1013                             <xsl:if test="$OPACURLOpenInNewWindow='0'">
1014                               <a>
1015                               <xsl:choose>
1016                                 <xsl:when test="$OPACTrackClicks='track'">
1017                                   <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1018                                 </xsl:when>
1019                                 <xsl:when test="$OPACTrackClicks='anonymous'">
1020                                   <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1021                                 </xsl:when>
1022                                 <xsl:otherwise>
1023                                   <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
1024                                 </xsl:otherwise>
1025                               </xsl:choose>
1026                                     <xsl:choose>
1027                                      <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')">
1028                                         <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px;</xsl:attribute></xsl:element><xsl:text></xsl:text>
1029                                     </xsl:when>
1030                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1031                                         <xsl:call-template name="subfieldSelect">
1032                                         <xsl:with-param name="codes">y3z</xsl:with-param>
1033                                         </xsl:call-template>
1034                                     </xsl:when>
1035                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1036                                         <xsl:choose>
1037                                         <xsl:when test="$URLLinkText!=''">
1038                                                 <xsl:value-of select="$URLLinkText"/>
1039                                         </xsl:when>
1040                                         <xsl:otherwise>
1041                                                 <xsl:text>Click here to access online</xsl:text>
1042                                         </xsl:otherwise>
1043                                         </xsl:choose>
1044                                     </xsl:when>
1045                                     </xsl:choose>
1046                                     </a>
1047                               </xsl:if>
1048                             <xsl:if test="$OPACURLOpenInNewWindow='1'">
1049                                    <a target='_blank'>
1050                                    <xsl:choose>
1051                                      <xsl:when test="$OPACTrackClicks='track'">
1052                                        <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1053                                      </xsl:when>
1054                                      <xsl:when test="$OPACTrackClicks='anonymous'">
1055                                        <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
1056                                      </xsl:when>
1057                                      <xsl:otherwise>
1058                                        <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
1059                                      </xsl:otherwise>
1060                                    </xsl:choose>
1061                                     <xsl:choose>
1062                                     <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and ($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')">
1063                                         <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px</xsl:attribute></xsl:element><xsl:text></xsl:text>
1064                                     </xsl:when>
1065                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1066                                         <xsl:call-template name="subfieldSelect">
1067                                         <xsl:with-param name="codes">y3z</xsl:with-param>
1068                                         </xsl:call-template>
1069                                     </xsl:when>
1070                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1071                                         <xsl:choose>
1072                                         <xsl:when test="$URLLinkText!=''">
1073                                                 <xsl:value-of select="$URLLinkText"/>
1074                                         </xsl:when>
1075                                         <xsl:otherwise>
1076                                                 <xsl:text>Click here to access online</xsl:text>
1077                                         </xsl:otherwise>
1078                                         </xsl:choose>
1079                                     </xsl:when>
1080                                     </xsl:choose>
1081                                     </a>
1082                               </xsl:if>
1083                                     <xsl:choose>
1084                                     <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
1085                                     <xsl:otherwise> | </xsl:otherwise>
1086                                     </xsl:choose>
1087                             </xsl:for-each>
1088                             </span>
1089                         </xsl:if>
1090                         <span class="results_summary availability">
1091                         <span class="label">Availability: </span>
1092                         <xsl:choose>
1093                                    <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
1094                         <xsl:choose>
1095                             <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]">
1096                             <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/>
1097                             <xsl:for-each select="marc:datafield[@tag=$AlternateHoldingsField][1]">
1098                                 <xsl:call-template name="subfieldSelect">
1099                                     <xsl:with-param name="codes"><xsl:value-of select="$AlternateHoldingsSubfields"/></xsl:with-param>
1100                                     <xsl:with-param name="delimeter"><xsl:value-of select="$AlternateHoldingsSeparator"/></xsl:with-param>
1101                                 </xsl:call-template>
1102                             </xsl:for-each>
1103                             (<xsl:value-of select="$AlternateHoldingsCount"/>)
1104                             </xsl:when>
1105                             <xsl:otherwise>No items available </xsl:otherwise>
1106                         </xsl:choose>
1107                                    </xsl:when>
1108                    <xsl:when test="count(key('item-by-status', 'available'))>0">
1109                    <span class="available">
1110                        <b><xsl:text>Items available for loan: </xsl:text></b>
1111                        <xsl:variable name="available_items"
1112                            select="key('item-by-status', 'available')"/>
1113                <xsl:choose>
1114                <xsl:when test="$singleBranchMode=1">
1115                    <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1116                        <span class="CommasWithLinebreaks">
1117                            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1118                            <xsl:text> (</xsl:text>
1119                                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1120                            <xsl:text>)</xsl:text>
1121                            <xsl:choose>
1122                                <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1123                                <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1124                            </xsl:choose>
1125                         </span>
1126                    </xsl:for-each>
1127                </xsl:when>
1128                <xsl:otherwise>
1129                    <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1130                        <span class="CommasWithLinebreaks">
1131                            <xsl:value-of select="items:homebranch"/>
1132                            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1133                            <xsl:text> (</xsl:text>
1134                                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1135                            <xsl:text>)</xsl:text>
1136                            <xsl:choose>
1137                                <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1138                                <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1139                            </xsl:choose>
1140                        </span>
1141                    </xsl:for-each>
1142                </xsl:otherwise>
1143                </xsl:choose>
1144
1145            </span>
1146                    </xsl:when>
1147                                    </xsl:choose>
1148
1149             <xsl:choose>
1150                 <xsl:when test="count(key('item-by-status', 'reference'))>0">
1151                     <span class="available">
1152                         <b><xsl:text>Items available for reference: </xsl:text></b>
1153                         <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1154                         <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1155                             <xsl:if test="$singleBranchMode=0">
1156                                 <xsl:value-of select="items:homebranch"/>
1157                             </xsl:if>
1158                             <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1159                             <xsl:text> (</xsl:text>
1160                             <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1161                             <xsl:text> )</xsl:text>
1162                             <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1163                         </xsl:for-each>
1164                     </span>
1165                 </xsl:when>
1166             </xsl:choose>
1167
1168                    <xsl:choose> <xsl:when test="count(key('item-by-status', 'available'))>0">
1169                        <xsl:choose><xsl:when test="count(key('item-by-status', 'reference'))>0">
1170                             <br/>
1171                        </xsl:when></xsl:choose>
1172                    </xsl:when> </xsl:choose>
1173
1174                    <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
1175                    <span class="unavailable">
1176                        <xsl:text>Checked out (</xsl:text>
1177                        <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/>
1178                        <xsl:text>). </xsl:text>
1179                                    </span>
1180                    </xsl:if>
1181                    <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0">
1182                    <span class="unavailable">
1183                        <xsl:text>Withdrawn (</xsl:text>
1184                        <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
1185                        <xsl:text>). </xsl:text>                   </span>
1186                                    </xsl:if>
1187                     <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
1188                    <span class="unavailable">
1189                        <xsl:text>Lost (</xsl:text>
1190                        <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
1191                        <xsl:text>). </xsl:text>                   </span>
1192                                    </xsl:if>
1193                     <xsl:if test="count(key('item-by-status', 'Damaged'))>0">
1194                    <span class="unavailable">
1195                        <xsl:text>Damaged (</xsl:text>
1196                        <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>
1197                        <xsl:text>). </xsl:text>                   </span>
1198                    </xsl:if>
1199                     <xsl:if test="count(key('item-by-status', 'On order'))>0">
1200                    <span class="unavailable">
1201                        <xsl:text>On order (</xsl:text>
1202                        <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
1203                        <xsl:text>). </xsl:text>                   </span>
1204                    </xsl:if>
1205                     <xsl:if test="count(key('item-by-status', 'In transit'))>0">
1206                    <span class="unavailable">
1207                        <xsl:text>In transit (</xsl:text>
1208                        <xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
1209                        <xsl:text>). </xsl:text>                   </span>
1210                    </xsl:if>
1211                     <xsl:if test="count(key('item-by-status', 'Waiting'))>0">
1212                    <span class="unavailable">
1213                        <xsl:text>On hold (</xsl:text>
1214                        <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
1215                        <xsl:text>). </xsl:text>                   </span>
1216                    </xsl:if>
1217                </span>
1218     <xsl:choose>
1219         <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)">
1220             <span class="results_summary location">
1221                 <span class="label">Location(s): </span>
1222                 <xsl:choose>
1223                 <xsl:when test="count(key('item-by-status', 'available'))>0">
1224                     <span class="available">
1225                         <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
1226                         <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1227                             <xsl:choose>
1228                                 <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1229                                 <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1230                             </xsl:choose>
1231                             <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1232                             <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1233                         </xsl:for-each>
1234                     </span>
1235                 </xsl:when>
1236                 <xsl:when test="count(key('item-by-status', 'reference'))>0">
1237                     <span class="available">
1238                         <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1239                         <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1240                             <xsl:choose>
1241                                 <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1242                                 <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1243                             </xsl:choose>
1244                             <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1245                             <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1246                         </xsl:for-each>
1247                     </span>
1248                 </xsl:when>
1249                 </xsl:choose>
1250             </span>
1251         </xsl:when>
1252        </xsl:choose>
1253     </xsl:template>
1254
1255     <xsl:template name="nameABCQ">
1256             <xsl:call-template name="chopPunctuation">
1257                 <xsl:with-param name="chopString">
1258                     <xsl:call-template name="subfieldSelect">
1259                         <xsl:with-param name="codes">abcq</xsl:with-param>
1260                     </xsl:call-template>
1261                 </xsl:with-param>
1262                 <xsl:with-param name="punctuation">
1263                     <xsl:text>:,;/ </xsl:text>
1264                 </xsl:with-param>
1265             </xsl:call-template>
1266     </xsl:template>
1267
1268     <xsl:template name="nameABCDN">
1269             <xsl:call-template name="chopPunctuation">
1270                 <xsl:with-param name="chopString">
1271                     <xsl:call-template name="subfieldSelect">
1272                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1273                     </xsl:call-template>
1274                 </xsl:with-param>
1275                 <xsl:with-param name="punctuation">
1276                     <xsl:text>:,;/ </xsl:text>
1277                 </xsl:with-param>
1278             </xsl:call-template>
1279     </xsl:template>
1280
1281     <xsl:template name="nameACDEQ">
1282             <xsl:call-template name="subfieldSelect">
1283                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1284             </xsl:call-template>
1285     </xsl:template>
1286
1287     <xsl:template name="nameDate">
1288         <xsl:for-each select="marc:subfield[@code='d']">
1289             <xsl:call-template name="chopPunctuation">
1290                 <xsl:with-param name="chopString" select="."/>
1291             </xsl:call-template>
1292         </xsl:for-each>
1293     </xsl:template>
1294
1295     <xsl:template name="role">
1296         <xsl:for-each select="marc:subfield[@code='e']">
1297                     <xsl:value-of select="."/>
1298         </xsl:for-each>
1299         <xsl:for-each select="marc:subfield[@code='4']">
1300                     <xsl:value-of select="."/>
1301         </xsl:for-each>
1302     </xsl:template>
1303
1304     <xsl:template name="specialSubfieldSelect">
1305         <xsl:param name="anyCodes"/>
1306         <xsl:param name="axis"/>
1307         <xsl:param name="beforeCodes"/>
1308         <xsl:param name="afterCodes"/>
1309         <xsl:variable name="str">
1310             <xsl:for-each select="marc:subfield">
1311                 <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])">
1312                     <xsl:value-of select="text()"/>
1313                     <xsl:text> </xsl:text>
1314                 </xsl:if>
1315             </xsl:for-each>
1316         </xsl:variable>
1317         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1318     </xsl:template>
1319
1320     <xsl:template name="subtitle">
1321         <xsl:if test="marc:subfield[@code='b']">
1322                 <xsl:call-template name="chopPunctuation">
1323                     <xsl:with-param name="chopString">
1324                         <xsl:value-of select="marc:subfield[@code='b']"/>
1325
1326                         <!--<xsl:call-template name="subfieldSelect">
1327                             <xsl:with-param name="codes">b</xsl:with-param>
1328                         </xsl:call-template>-->
1329                     </xsl:with-param>
1330                 </xsl:call-template>
1331         </xsl:if>
1332     </xsl:template>
1333
1334     <xsl:template name="chopBrackets">
1335         <xsl:param name="chopString"></xsl:param>
1336         <xsl:variable name="string">
1337             <xsl:call-template name="chopPunctuation">
1338                 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
1339             </xsl:call-template>
1340         </xsl:variable>
1341         <xsl:if test="substring($string, 1,1)='['">
1342             <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
1343         </xsl:if>
1344         <xsl:if test="substring($string, 1,1)!='['">
1345             <xsl:value-of select="$string"></xsl:value-of>
1346         </xsl:if>
1347     </xsl:template>
1348
1349 </xsl:stylesheet>