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