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