Bug 15100: MARC21 - make display of "Dates associated with a name" optional
[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">abceqt</xsl:when>
473                                 <xsl:otherwise>abcjqt</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='d']">
483                 <span class="authordates">
484                     <xsl:text> </xsl:text>
485                     <xsl:value-of select="marc:subfield[@code='d']"/>
486                 </span>
487             </xsl:if>
488             <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'][. != ''])">
489                 <span class="relatorcode">
490                     <xsl:text> [</xsl:text>
491                     <xsl:choose>
492                         <xsl:when test="@tag=111">
493                             <xsl:choose>
494                                 <!-- Prefer j over 4 -->
495                                 <xsl:when test="marc:subfield[@code='j']">
496                                     <xsl:for-each select="marc:subfield[@code='j']">
497                                         <xsl:value-of select="."/>
498                                         <xsl:if test="position() != last()">, </xsl:if>
499                                     </xsl:for-each>
500                                 </xsl:when>
501                                 <xsl:otherwise>
502                                     <xsl:for-each select="marc:subfield[@code=4]">
503                                         <xsl:value-of select="."/>
504                                         <xsl:if test="position() != last()">, </xsl:if>
505                                     </xsl:for-each>
506                                 </xsl:otherwise>
507                             </xsl:choose>
508                         </xsl:when>
509                         <!-- Prefer e over 4 -->
510                         <xsl:when test="marc:subfield[@code='e']">
511                             <xsl:for-each select="marc:subfield[@code='e']">
512                                 <xsl:value-of select="."/>
513                                 <xsl:if test="position() != last()">, </xsl:if>
514                             </xsl:for-each>
515                         </xsl:when>
516                         <xsl:otherwise>
517                             <xsl:for-each select="marc:subfield[@code=4]">
518                                 <xsl:value-of select="."/>
519                                 <xsl:if test="position() != last()">, </xsl:if>
520                             </xsl:for-each>
521                         </xsl:otherwise>
522                     </xsl:choose>
523                     <xsl:text>]</xsl:text>
524                 </span>
525             </xsl:if>
526             <xsl:choose>
527                 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
528             </xsl:choose>
529         </xsl:for-each>
530
531     </span>
532     </xsl:when>
533     </xsl:choose>
534     </p>
535
536     <xsl:if test="marc:datafield[@tag=250]">
537     <span class="results_summary edition">
538     <span class="label">Edition: </span>
539             <xsl:for-each select="marc:datafield[@tag=250]">
540                     <xsl:call-template name="subfieldSelect">
541                         <xsl:with-param name="codes">ab</xsl:with-param>
542                     </xsl:call-template>
543             </xsl:for-each>
544         </span>
545     </xsl:if>
546
547     <xsl:if test="marc:datafield[@tag=773]">
548         <xsl:for-each select="marc:datafield[@tag=773]">
549             <xsl:if test="marc:subfield[@code='t']">
550     <span class="results_summary source">
551     <span class="label">Source: </span>
552             <xsl:value-of select="marc:subfield[@code='t']"/>
553     </span>
554             </xsl:if>
555         </xsl:for-each>
556     </xsl:if>
557
558 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
559     <span class="results_summary type">
560     <xsl:if test="$typeOf008!=''">
561     <span class="results_material_type">
562         <span class="label">Material type: </span>
563             <xsl:choose>
564                 <xsl:when test="$leader19='a'"><img src="/opac-tmpl/lib/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
565                 <xsl:when test="$leader6='a'">
566                     <xsl:choose>
567                         <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>
568                         <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>
569                         <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>
570                     </xsl:choose>
571                 </xsl:when>
572                 <xsl:when test="$leader6='t'"><img src="/opac-tmpl/lib/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
573                 <xsl:when test="$leader6='o'"><img src="/opac-tmpl/lib/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype"/> Kit</xsl:when>
574                 <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>
575                 <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>
576                 <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>
577                 <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>
578                 <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>
579                 <xsl:when test="$leader6='i'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype"/> Sound</xsl:when>
580                 <xsl:when test="$leader6='j'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype"/> Music</xsl:when>
581             </xsl:choose>
582     </span>
583     </xsl:if>
584     <xsl:if test="string-length(normalize-space($physicalDescription))">
585         <span class="results_format">
586             <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
587         </span>
588     </xsl:if>
589
590         <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">
591
592         <xsl:if test="$typeOf008='CR'">
593         <span class="results_typeofcontinuing">
594         <xsl:if test="$controlField008-21 and $controlField008-21 !='|' and $controlField008-21 !=' '">
595         <span class="label">; Type of continuing resource: </span>
596         </xsl:if>
597             <xsl:choose>
598                 <xsl:when test="$controlField008-21='d'">
599                      <img src="/opac-tmpl/lib/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
600                 </xsl:when>
601                 <xsl:when test="$controlField008-21='l'">
602                     loose-leaf
603                 </xsl:when>
604                 <xsl:when test="$controlField008-21='m'">
605                     series
606                 </xsl:when>
607                 <xsl:when test="$controlField008-21='n'">
608                     newspaper
609                 </xsl:when>
610                 <xsl:when test="$controlField008-21='p'">
611                     periodical
612                 </xsl:when>
613                 <xsl:when test="$controlField008-21='w'">
614                      <img src="/opac-tmpl/lib/famfamfam/silk/world_link.png" alt="web site" title="web site" class="format"/>
615                 </xsl:when>
616             </xsl:choose>
617         </span>
618         </xsl:if>
619         <xsl:if test="$typeOf008='BK' or $typeOf008='CR'">
620         <xsl:if test="contains($controlField008-24,'abcdefghijklmnopqrstvwxyz')">
621         <span class="results_natureofcontents">
622         <span class="label">; Nature of contents: </span>
623             <xsl:choose>
624                 <xsl:when test="contains($controlField008-24,'a')">
625                     abstract or summary
626                 </xsl:when>
627                 <xsl:when test="contains($controlField008-24,'b')">
628                         bibliography
629                      <img src="/opac-tmpl/lib/famfamfam/silk/text_list_bullets.png" alt="bibliography" title="bibliography" class="natureofcontents"/>
630                 </xsl:when>
631                 <xsl:when test="contains($controlField008-24,'c')">
632                     catalog
633                 </xsl:when>
634                 <xsl:when test="contains($controlField008-24,'d')">
635                     dictionary
636                 </xsl:when>
637                 <xsl:when test="contains($controlField008-24,'e')">
638                     encyclopedia
639                 </xsl:when>
640                 <xsl:when test="contains($controlField008-24,'f')">
641                     handbook
642                 </xsl:when>
643                 <xsl:when test="contains($controlField008-24,'g')">
644                     legal article
645                 </xsl:when>
646                 <xsl:when test="contains($controlField008-24,'i')">
647                     index
648                 </xsl:when>
649                 <xsl:when test="contains($controlField008-24,'k')">
650                     discography
651                 </xsl:when>
652                 <xsl:when test="contains($controlField008-24,'l')">
653                     legislation
654                 </xsl:when>
655                 <xsl:when test="contains($controlField008-24,'m')">
656                     theses
657                 </xsl:when>
658                 <xsl:when test="contains($controlField008-24,'n')">
659                     survey of literature
660                 </xsl:when>
661                 <xsl:when test="contains($controlField008-24,'o')">
662                     review
663                 </xsl:when>
664                 <xsl:when test="contains($controlField008-24,'p')">
665                     programmed text
666                 </xsl:when>
667                 <xsl:when test="contains($controlField008-24,'q')">
668                     filmography
669                 </xsl:when>
670                 <xsl:when test="contains($controlField008-24,'r')">
671                     directory
672                 </xsl:when>
673                 <xsl:when test="contains($controlField008-24,'s')">
674                     statistics
675                 </xsl:when>
676                 <xsl:when test="contains($controlField008-24,'t')">
677                      <img src="/opac-tmpl/lib/famfamfam/silk/report.png" alt="technical report" title="technical report" class="natureofcontents"/>
678                 </xsl:when>
679                 <xsl:when test="contains($controlField008-24,'v')">
680                     legal case and case notes
681                 </xsl:when>
682                 <xsl:when test="contains($controlField008-24,'w')">
683                     law report or digest
684                 </xsl:when>
685                 <xsl:when test="contains($controlField008-24,'z')">
686                     treaty
687                 </xsl:when>
688             </xsl:choose>
689             <xsl:choose>
690                 <xsl:when test="$controlField008-29='1'">
691                     conference publication
692                 </xsl:when>
693             </xsl:choose>
694         </span>
695         </xsl:if>
696         </xsl:if>
697         <xsl:if test="$typeOf008='CF'">
698         <span class="results_typeofcomp">
699             <xsl:if test="$controlField008-26='a' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g'">
700             <span class="label">; Type of computer file: </span>
701             </xsl:if>
702             <xsl:choose>
703                 <xsl:when test="$controlField008-26='a'">
704                     numeric data
705                 </xsl:when>
706                 <xsl:when test="$controlField008-26='e'">
707                      <img src="/opac-tmpl/lib/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
708                 </xsl:when>
709                 <xsl:when test="$controlField008-26='f'">
710                      <img src="/opac-tmpl/lib/famfamfam/silk/font.png" alt="font" title="font" class="format"/>
711                 </xsl:when>
712                 <xsl:when test="$controlField008-26='g'">
713                      <img src="/opac-tmpl/lib/famfamfam/silk/controller.png" alt="game" title="game" class="format"/>
714                 </xsl:when>
715             </xsl:choose>
716         </span>
717         </xsl:if>
718         <xsl:if test="$typeOf008='BK'">
719         <span class="results_contents_literary">
720             <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')">
721             <span class="label">; Nature of contents: </span>
722             </xsl:if>
723             <xsl:if test="substring($controlField008,25,1)='j'">
724                 patent
725             </xsl:if>
726             <xsl:if test="substring($controlField008,31,1)='1'">
727                 festschrift
728             </xsl:if>
729             <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
730                  <img src="/opac-tmpl/lib/famfamfam/silk/user.png" alt="biography" title="biography" class="natureofcontents"/>
731             </xsl:if>
732
733             <xsl:if test="$controlField008-33 and $controlField008-33!='|' and $controlField008-33!='u' and $controlField008-33!=' '">
734             <span class="label">; Literary form: </span>
735             </xsl:if>
736             <xsl:choose>
737                 <xsl:when test="$controlField008-33='0'">
738                     not fiction
739                 </xsl:when>
740                 <xsl:when test="$controlField008-33='1'">
741                     fiction
742                 </xsl:when>
743                 <xsl:when test="$controlField008-33='e'">
744                     essay
745                 </xsl:when>
746                 <xsl:when test="$controlField008-33='d'">
747                     drama
748                 </xsl:when>
749                 <xsl:when test="$controlField008-33='c'">
750                     comic strip
751                 </xsl:when>
752                 <xsl:when test="$controlField008-33='l'">
753                     fiction
754                 </xsl:when>
755                 <xsl:when test="$controlField008-33='h'">
756                     humor, satire
757                 </xsl:when>
758                 <xsl:when test="$controlField008-33='i'">
759                     letter
760                 </xsl:when>
761                 <xsl:when test="$controlField008-33='f'">
762                     novel
763                 </xsl:when>
764                 <xsl:when test="$controlField008-33='j'">
765                     short story
766                 </xsl:when>
767                 <xsl:when test="$controlField008-33='s'">
768                     speech
769                 </xsl:when>
770             </xsl:choose>
771         </span>
772         </xsl:if>
773         <xsl:if test="$typeOf008='MU' and $controlField008-30-31 and $controlField008-30-31!='||' and $controlField008-30-31!='  '">
774         <span class="results_literaryform">
775             <span class="label">; Literary form: </span> <!-- Literary text for sound recordings -->
776             <xsl:if test="contains($controlField008-30-31,'b')">
777                 biography
778             </xsl:if>
779             <xsl:if test="contains($controlField008-30-31,'c')">
780                 conference publication
781             </xsl:if>
782             <xsl:if test="contains($controlField008-30-31,'d')">
783                 drama
784             </xsl:if>
785             <xsl:if test="contains($controlField008-30-31,'e')">
786                 essay
787             </xsl:if>
788             <xsl:if test="contains($controlField008-30-31,'f')">
789                 fiction
790             </xsl:if>
791             <xsl:if test="contains($controlField008-30-31,'o')">
792                 folktale
793             </xsl:if>
794             <xsl:if test="contains($controlField008-30-31,'h')">
795                 history
796             </xsl:if>
797             <xsl:if test="contains($controlField008-30-31,'k')">
798                 humor, satire
799             </xsl:if>
800             <xsl:if test="contains($controlField008-30-31,'m')">
801                 memoir
802             </xsl:if>
803             <xsl:if test="contains($controlField008-30-31,'p')">
804                 poetry
805             </xsl:if>
806             <xsl:if test="contains($controlField008-30-31,'r')">
807                 rehearsal
808             </xsl:if>
809             <xsl:if test="contains($controlField008-30-31,'g')">
810                 reporting
811             </xsl:if>
812             <xsl:if test="contains($controlField008-30-31,'s')">
813                 sound
814             </xsl:if>
815             <xsl:if test="contains($controlField008-30-31,'l')">
816                 speech
817             </xsl:if>
818         </span>
819         </xsl:if>
820         <xsl:if test="$typeOf008='VM'">
821         <span class="results_typeofvisual">
822             <span class="label">; Type of visual material: </span>
823             <xsl:choose>
824                 <xsl:when test="$controlField008-33='a'">
825                     art original
826                 </xsl:when>
827                 <xsl:when test="$controlField008-33='b'">
828                     kit
829                 </xsl:when>
830                 <xsl:when test="$controlField008-33='c'">
831                     art reproduction
832                 </xsl:when>
833                 <xsl:when test="$controlField008-33='d'">
834                     diorama
835                 </xsl:when>
836                 <xsl:when test="$controlField008-33='f'">
837                     filmstrip
838                 </xsl:when>
839                 <xsl:when test="$controlField008-33='g'">
840                     legal article
841                 </xsl:when>
842                 <xsl:when test="$controlField008-33='i'">
843                     picture
844                 </xsl:when>
845                 <xsl:when test="$controlField008-33='k'">
846                     graphic
847                 </xsl:when>
848                 <xsl:when test="$controlField008-33='l'">
849                     technical drawing
850                 </xsl:when>
851                 <xsl:when test="$controlField008-33='m'">
852                     motion picture
853                 </xsl:when>
854                 <xsl:when test="$controlField008-33='n'">
855                     chart
856                 </xsl:when>
857                 <xsl:when test="$controlField008-33='o'">
858                     flash card
859                 </xsl:when>
860                 <xsl:when test="$controlField008-33='p'">
861                     microscope slide
862                 </xsl:when>
863                 <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
864                     model
865                 </xsl:when>
866                 <xsl:when test="$controlField008-33='r'">
867                     realia
868                 </xsl:when>
869                 <xsl:when test="$controlField008-33='s'">
870                     slide
871                 </xsl:when>
872                 <xsl:when test="$controlField008-33='t'">
873                     transparency
874                 </xsl:when>
875                 <xsl:when test="$controlField008-33='v'">
876                     videorecording
877                 </xsl:when>
878                 <xsl:when test="$controlField008-33='w'">
879                     toy
880                 </xsl:when>
881             </xsl:choose>
882             </span>
883         </xsl:if>
884         </xsl:if>
885
886     <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')">
887         <span class="results_audience">
888         <span class="label">; Audience: </span>
889         <xsl:choose>
890             <xsl:when test="$controlField008-22='a'">
891              Preschool;
892             </xsl:when>
893             <xsl:when test="$controlField008-22='b'">
894              Primary;
895             </xsl:when>
896             <xsl:when test="$controlField008-22='c'">
897              Pre-adolescent;
898             </xsl:when>
899             <xsl:when test="$controlField008-22='d'">
900              Adolescent;
901             </xsl:when>
902             <xsl:when test="$controlField008-22='e'">
903              Adult;
904             </xsl:when>
905             <xsl:when test="$controlField008-22='g'">
906              General;
907             </xsl:when>
908             <xsl:when test="$controlField008-22='j'">
909              Juvenile;
910             </xsl:when>
911             <xsl:when test="$controlField008-22='f'">
912              Specialized;
913             </xsl:when>
914         </xsl:choose>
915         </span>
916     </xsl:if>
917 <xsl:text> </xsl:text> <!-- added blank space to fix font display problem, see Bug 3671 -->
918         </span>
919 </xsl:if>
920
921     <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
922     <xsl:if test="$display880">
923       <xsl:call-template name="m880Select">
924         <xsl:with-param name="basetags">260</xsl:with-param>
925         <xsl:with-param name="codes">abcg</xsl:with-param>
926         <xsl:with-param name="class">results_summary publisher</xsl:with-param>
927         <xsl:with-param name="label">Publisher: </xsl:with-param>
928       </xsl:call-template>
929     </xsl:if>
930
931     <!-- Publisher info and RDA related info from tags 260, 264 -->
932     <xsl:choose>
933         <xsl:when test="marc:datafield[@tag=264]">
934             <xsl:call-template name="showRDAtag264"/>
935         </xsl:when>
936         <xsl:when test="marc:datafield[@tag=260]">
937             <span class="results_summary publisher"><span class="label">Publisher: </span>
938                 <xsl:for-each select="marc:datafield[@tag=260]">
939                     <xsl:if test="marc:subfield[@code='a']">
940                         <xsl:call-template name="subfieldSelect">
941                             <xsl:with-param name="codes">a</xsl:with-param>
942                         </xsl:call-template>
943                     </xsl:if>
944                     <xsl:text> </xsl:text>
945                     <xsl:if test="marc:subfield[@code='b']">
946                         <xsl:call-template name="subfieldSelect">
947                             <xsl:with-param name="codes">b</xsl:with-param>
948                         </xsl:call-template>
949                     </xsl:if>
950                     <xsl:text> </xsl:text>
951                     <xsl:call-template name="chopPunctuation">
952                       <xsl:with-param name="chopString">
953                         <xsl:call-template name="subfieldSelect">
954                             <xsl:with-param name="codes">cg</xsl:with-param>
955                         </xsl:call-template>
956                        </xsl:with-param>
957                     </xsl:call-template>
958                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
959                 </xsl:for-each>
960                 <xsl:if test="marc:datafield[@tag=264]">
961                     <xsl:text>; </xsl:text>
962                     <xsl:call-template name="showRDAtag264"/>
963                 </xsl:if>
964             </span>
965         </xsl:when>
966     </xsl:choose>
967
968     <!-- Dissertation note -->
969     <xsl:if test="marc:datafield[@tag=502]">
970         <span class="results_summary diss_note">
971             <span class="label">Dissertation note: </span>
972             <xsl:for-each select="marc:datafield[@tag=502]">
973                 <xsl:call-template name="subfieldSelect">
974                     <xsl:with-param name="codes">abcdgo</xsl:with-param>
975                 </xsl:call-template>
976             </xsl:for-each>
977             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
978         </span>
979     </xsl:if>
980
981     <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
982     <xsl:if test="$display880">
983        <xsl:call-template name="m880Select">
984          <xsl:with-param name="basetags">246</xsl:with-param>
985          <xsl:with-param name="codes">ab</xsl:with-param>
986          <xsl:with-param name="class">results_summary other_title</xsl:with-param>
987          <xsl:with-param name="label">Other title: </xsl:with-param>
988        </xsl:call-template>
989     </xsl:if>
990
991     <xsl:if test="marc:datafield[@tag=246]">
992     <span class="results_summary other_title">
993     <span class="label">Other title: </span>
994             <xsl:for-each select="marc:datafield[@tag=246]">
995                     <xsl:call-template name="subfieldSelect">
996                         <xsl:with-param name="codes">ab</xsl:with-param>
997                     </xsl:call-template>
998                 <!-- #13386 added separator | -->
999                 <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>
1000             </xsl:for-each>
1001         </span>
1002     </xsl:if>
1003     <xsl:if test="marc:datafield[@tag=242]">
1004     <span class="results_summary translated_title">
1005     <span class="label">Title translated: </span>
1006             <xsl:for-each select="marc:datafield[@tag=242]">
1007                     <xsl:call-template name="subfieldSelect">
1008                         <xsl:with-param name="codes">abh</xsl:with-param>
1009                     </xsl:call-template>
1010                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
1011             </xsl:for-each>
1012         </span>
1013     </xsl:if>
1014     <xsl:if test="marc:datafield[@tag=856]">
1015          <span class="results_summary online_resources">
1016                            <span class="label">Online access: </span>
1017                             <xsl:for-each select="marc:datafield[@tag=856]">
1018                             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
1019                             <xsl:if test="$OPACURLOpenInNewWindow='0'">
1020                               <a>
1021                               <xsl:choose>
1022                                 <xsl:when test="$OPACTrackClicks='track'">
1023                                   <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>
1024                                 </xsl:when>
1025                                 <xsl:when test="$OPACTrackClicks='anonymous'">
1026                                   <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>
1027                                 </xsl:when>
1028                                 <xsl:otherwise>
1029                                   <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
1030                                 </xsl:otherwise>
1031                               </xsl:choose>
1032                                     <xsl:choose>
1033                                      <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')">
1034                                         <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>
1035                                     </xsl:when>
1036                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1037                                         <xsl:call-template name="subfieldSelect">
1038                                         <xsl:with-param name="codes">y3z</xsl:with-param>
1039                                         </xsl:call-template>
1040                                     </xsl:when>
1041                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1042                                         <xsl:choose>
1043                                         <xsl:when test="$URLLinkText!=''">
1044                                                 <xsl:value-of select="$URLLinkText"/>
1045                                         </xsl:when>
1046                                         <xsl:otherwise>
1047                                                 <xsl:text>Click here to access online</xsl:text>
1048                                         </xsl:otherwise>
1049                                         </xsl:choose>
1050                                     </xsl:when>
1051                                     </xsl:choose>
1052                                     </a>
1053                               </xsl:if>
1054                             <xsl:if test="$OPACURLOpenInNewWindow='1'">
1055                                    <a target='_blank'>
1056                                    <xsl:choose>
1057                                      <xsl:when test="$OPACTrackClicks='track'">
1058                                        <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>
1059                                      </xsl:when>
1060                                      <xsl:when test="$OPACTrackClicks='anonymous'">
1061                                        <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>
1062                                      </xsl:when>
1063                                      <xsl:otherwise>
1064                                        <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
1065                                      </xsl:otherwise>
1066                                    </xsl:choose>
1067                                     <xsl:choose>
1068                                     <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')">
1069                                         <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>
1070                                     </xsl:when>
1071                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
1072                                         <xsl:call-template name="subfieldSelect">
1073                                         <xsl:with-param name="codes">y3z</xsl:with-param>
1074                                         </xsl:call-template>
1075                                     </xsl:when>
1076                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
1077                                         <xsl:choose>
1078                                         <xsl:when test="$URLLinkText!=''">
1079                                                 <xsl:value-of select="$URLLinkText"/>
1080                                         </xsl:when>
1081                                         <xsl:otherwise>
1082                                                 <xsl:text>Click here to access online</xsl:text>
1083                                         </xsl:otherwise>
1084                                         </xsl:choose>
1085                                     </xsl:when>
1086                                     </xsl:choose>
1087                                     </a>
1088                               </xsl:if>
1089                                     <xsl:choose>
1090                                     <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
1091                                     <xsl:otherwise> | </xsl:otherwise>
1092                                     </xsl:choose>
1093                             </xsl:for-each>
1094                             </span>
1095                         </xsl:if>
1096                         <span class="results_summary availability">
1097                         <span class="label">Availability: </span>
1098                         <xsl:choose>
1099                                    <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
1100                         <xsl:choose>
1101                             <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]">
1102                             <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/>
1103                             <xsl:for-each select="marc:datafield[@tag=$AlternateHoldingsField][1]">
1104                                 <xsl:call-template name="subfieldSelect">
1105                                     <xsl:with-param name="codes"><xsl:value-of select="$AlternateHoldingsSubfields"/></xsl:with-param>
1106                                     <xsl:with-param name="delimeter"><xsl:value-of select="$AlternateHoldingsSeparator"/></xsl:with-param>
1107                                 </xsl:call-template>
1108                             </xsl:for-each>
1109                             (<xsl:value-of select="$AlternateHoldingsCount"/>)
1110                             </xsl:when>
1111                             <xsl:otherwise>No items available </xsl:otherwise>
1112                         </xsl:choose>
1113                                    </xsl:when>
1114                    <xsl:when test="count(key('item-by-status', 'available'))>0">
1115                    <span class="available">
1116                        <b><xsl:text>Items available for loan: </xsl:text></b>
1117                        <xsl:variable name="available_items"
1118                            select="key('item-by-status', 'available')"/>
1119                <xsl:choose>
1120                <xsl:when test="$singleBranchMode=1">
1121                    <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1122                        <span class="ItemSummary">
1123                            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1124                            <xsl:text> (</xsl:text>
1125                                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1126                            <xsl:text>)</xsl:text>
1127                            <xsl:choose>
1128                                <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1129                                <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1130                            </xsl:choose>
1131                         </span>
1132                    </xsl:for-each>
1133                </xsl:when>
1134                <xsl:otherwise>
1135                    <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1136                        <span class="ItemSummary">
1137                            <xsl:value-of select="items:homebranch"/>
1138                            <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>
1139                            <xsl:text> (</xsl:text>
1140                                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1141                            <xsl:text>)</xsl:text>
1142                            <xsl:choose>
1143                                <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1144                                <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1145                            </xsl:choose>
1146                        </span>
1147                    </xsl:for-each>
1148                </xsl:otherwise>
1149                </xsl:choose>
1150
1151            </span>
1152                    </xsl:when>
1153                                    </xsl:choose>
1154
1155             <xsl:choose>
1156                 <xsl:when test="count(key('item-by-status', 'reference'))>0">
1157                     <span class="available">
1158                         <b><xsl:text>Items available for reference: </xsl:text></b>
1159                         <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1160                         <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1161                             <span class="ItemSummary">
1162                                 <xsl:if test="$singleBranchMode=0">
1163                                     <xsl:value-of select="items:homebranch"/>
1164                                 </xsl:if>
1165                                 <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1166                                 <xsl:text> (</xsl:text>
1167                                 <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1168                                 <xsl:text>)</xsl:text>
1169                                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1170                             </span>
1171                         </xsl:for-each>
1172                     </span>
1173                 </xsl:when>
1174             </xsl:choose>
1175
1176                    <xsl:choose> <xsl:when test="count(key('item-by-status', 'available'))>0">
1177                        <xsl:choose><xsl:when test="count(key('item-by-status', 'reference'))>0">
1178                             <br/>
1179                        </xsl:when></xsl:choose>
1180                    </xsl:when> </xsl:choose>
1181
1182                    <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
1183                    <span class="unavailable">
1184                        <xsl:text>Checked out (</xsl:text>
1185                        <xsl:value-of select="count(key('item-by-status', 'Checked out'))"/>
1186                        <xsl:text>). </xsl:text>
1187                                    </span>
1188                    </xsl:if>
1189                    <xsl:if test="count(key('item-by-status', 'Withdrawn'))>0">
1190                    <span class="unavailable">
1191                        <xsl:text>Withdrawn (</xsl:text>
1192                        <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
1193                        <xsl:text>). </xsl:text>                   </span>
1194                                    </xsl:if>
1195                     <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
1196                    <span class="unavailable">
1197                        <xsl:text>Lost (</xsl:text>
1198                        <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
1199                        <xsl:text>). </xsl:text>                   </span>
1200                                    </xsl:if>
1201                     <xsl:if test="count(key('item-by-status', 'Damaged'))>0">
1202                    <span class="unavailable">
1203                        <xsl:text>Damaged (</xsl:text>
1204                        <xsl:value-of select="count(key('item-by-status', 'Damaged'))"/>
1205                        <xsl:text>). </xsl:text>                   </span>
1206                    </xsl:if>
1207                     <xsl:if test="count(key('item-by-status', 'On order'))>0">
1208                    <span class="unavailable">
1209                        <xsl:text>On order (</xsl:text>
1210                        <xsl:value-of select="count(key('item-by-status', 'On order'))"/>
1211                        <xsl:text>). </xsl:text>                   </span>
1212                    </xsl:if>
1213                     <xsl:if test="count(key('item-by-status', 'In transit'))>0">
1214                    <span class="unavailable">
1215                        <xsl:text>In transit (</xsl:text>
1216                        <xsl:value-of select="count(key('item-by-status', 'In transit'))"/>
1217                        <xsl:text>). </xsl:text>                   </span>
1218                    </xsl:if>
1219                     <xsl:if test="count(key('item-by-status', 'Waiting'))>0">
1220                    <span class="unavailable">
1221                        <xsl:text>On hold (</xsl:text>
1222                        <xsl:value-of select="count(key('item-by-status', 'Waiting'))"/>
1223                        <xsl:text>). </xsl:text>                   </span>
1224                    </xsl:if>
1225                </span>
1226     <xsl:choose>
1227         <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)">
1228             <span class="results_summary location">
1229                 <span class="label">Location(s): </span>
1230                 <xsl:choose>
1231                 <xsl:when test="count(key('item-by-status', 'available'))>0">
1232                     <span class="available">
1233                         <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
1234                         <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1235                             <xsl:choose>
1236                                 <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1237                                 <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1238                             </xsl:choose>
1239                             <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1240                             <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1241                         </xsl:for-each>
1242                     </span>
1243                 </xsl:when>
1244                 <xsl:when test="count(key('item-by-status', 'reference'))>0">
1245                     <span class="available">
1246                         <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1247                         <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1248                             <xsl:choose>
1249                                 <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1250                                 <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1251                             </xsl:choose>
1252                             <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1253                             <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1254                         </xsl:for-each>
1255                     </span>
1256                 </xsl:when>
1257                 </xsl:choose>
1258             </span>
1259         </xsl:when>
1260        </xsl:choose>
1261     </xsl:template>
1262
1263     <xsl:template name="nameABCQ">
1264             <xsl:call-template name="chopPunctuation">
1265                 <xsl:with-param name="chopString">
1266                     <xsl:call-template name="subfieldSelect">
1267                         <xsl:with-param name="codes">abcq</xsl:with-param>
1268                     </xsl:call-template>
1269                 </xsl:with-param>
1270                 <xsl:with-param name="punctuation">
1271                     <xsl:text>:,;/ </xsl:text>
1272                 </xsl:with-param>
1273             </xsl:call-template>
1274     </xsl:template>
1275
1276     <xsl:template name="nameABCDN">
1277             <xsl:call-template name="chopPunctuation">
1278                 <xsl:with-param name="chopString">
1279                     <xsl:call-template name="subfieldSelect">
1280                         <xsl:with-param name="codes">abcdn</xsl:with-param>
1281                     </xsl:call-template>
1282                 </xsl:with-param>
1283                 <xsl:with-param name="punctuation">
1284                     <xsl:text>:,;/ </xsl:text>
1285                 </xsl:with-param>
1286             </xsl:call-template>
1287     </xsl:template>
1288
1289     <xsl:template name="nameACDEQ">
1290             <xsl:call-template name="subfieldSelect">
1291                 <xsl:with-param name="codes">acdeq</xsl:with-param>
1292             </xsl:call-template>
1293     </xsl:template>
1294
1295     <xsl:template name="nameDate">
1296         <xsl:for-each select="marc:subfield[@code='d']">
1297             <xsl:call-template name="chopPunctuation">
1298                 <xsl:with-param name="chopString" select="."/>
1299             </xsl:call-template>
1300         </xsl:for-each>
1301     </xsl:template>
1302
1303     <xsl:template name="role">
1304         <xsl:for-each select="marc:subfield[@code='e']">
1305                     <xsl:value-of select="."/>
1306         </xsl:for-each>
1307         <xsl:for-each select="marc:subfield[@code='4']">
1308                     <xsl:value-of select="."/>
1309         </xsl:for-each>
1310     </xsl:template>
1311
1312     <xsl:template name="specialSubfieldSelect">
1313         <xsl:param name="anyCodes"/>
1314         <xsl:param name="axis"/>
1315         <xsl:param name="beforeCodes"/>
1316         <xsl:param name="afterCodes"/>
1317         <xsl:variable name="str">
1318             <xsl:for-each select="marc:subfield">
1319                 <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])">
1320                     <xsl:value-of select="text()"/>
1321                     <xsl:text> </xsl:text>
1322                 </xsl:if>
1323             </xsl:for-each>
1324         </xsl:variable>
1325         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1326     </xsl:template>
1327
1328     <xsl:template name="subtitle">
1329         <xsl:if test="marc:subfield[@code='b']">
1330                 <xsl:call-template name="chopPunctuation">
1331                     <xsl:with-param name="chopString">
1332                         <xsl:value-of select="marc:subfield[@code='b']"/>
1333
1334                         <!--<xsl:call-template name="subfieldSelect">
1335                             <xsl:with-param name="codes">b</xsl:with-param>
1336                         </xsl:call-template>-->
1337                     </xsl:with-param>
1338                 </xsl:call-template>
1339         </xsl:if>
1340     </xsl:template>
1341
1342     <xsl:template name="chopBrackets">
1343         <xsl:param name="chopString"></xsl:param>
1344         <xsl:variable name="string">
1345             <xsl:call-template name="chopPunctuation">
1346                 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
1347             </xsl:call-template>
1348         </xsl:variable>
1349         <xsl:if test="substring($string, 1,1)='['">
1350             <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
1351         </xsl:if>
1352         <xsl:if test="substring($string, 1,1)!='['">
1353             <xsl:value-of select="$string"></xsl:value-of>
1354         </xsl:if>
1355     </xsl:template>
1356
1357 </xsl:stylesheet>