Bug 8793 - Fix materialTypeCode/typeOf008 icons for NORMARC XSLT
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / NORMARCslim2intranetResults.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" />
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         <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
20         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
21         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
22         <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
23         <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
24         <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
25         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
26         <xsl:variable name="leader" select="marc:leader"/>
27         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
28         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
29         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
30         <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
31         <xsl:variable name="controlField007" select="marc:controlfield[@tag=007]"/>
32         <xsl:variable name="controlField007-00" select="substring($controlField007,1,1)"/>
33         <xsl:variable name="controlField007-01" select="substring($controlField007,2,1)"/>
34         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
35         <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
36         <xsl:variable name="typeOf008">
37             <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
38             <xsl:choose>
39                 <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
40                 <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
41                 <xsl:when test="$field019b='c' or $field019b='d' or contains($field019b,'da') or contains($field019b,'db') or contains($field019b,'dc') or contains($field019b,'dd') or contains($field019b,'dg') or contains($field019b,'dh') or contains($field019b,'di') or contains($field019b,'dj') or contains($field019b,'dk') or $leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Mus</xsl:when>
42                 <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kar</xsl:when>
43                 <xsl:when test="$field019b='f' or $field019b='i' or contains($field019b,'ib') or contains($field019b,'ic') or contains($field019b,'fd') or contains($field019b,'ff') or contains($field019b,'fi') or $leader6='k'">gra</xsl:when>
44                 <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
45                 <xsl:when test="$leader6='o'">kom</xsl:when>
46                 <xsl:when test="$field019b='h' or $leader6='r'">trd</xsl:when>
47                 <xsl:when test="$field019b='j' or $leader6='a'">
48                     <xsl:choose>
49                         <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Mon</xsl:when>
50                         <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Per</xsl:when>
51                     </xsl:choose>
52                 </xsl:when>
53             </xsl:choose>
54         </xsl:variable>
55         <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
56         <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
57         <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
58         <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
59         <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
60         <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
61         <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
62         <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
63         <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
64
65         <xsl:variable name="physicalDescription">
66
67             <!-- 019$b from BSMARC -->
68
69             <xsl:if test="$field019b">
70                                 <xsl:if test="$field019b='a'"> Kartografisk materiale</xsl:if>
71                                 <xsl:if test="contains($field019b,'ab')"> Atlas</xsl:if>
72                                 <xsl:if test="contains($field019b,'aj')"> Kart</xsl:if>
73                                 <xsl:if test="$field019b='b'"> Manuskripter</xsl:if>
74                                 <xsl:if test="$field019b='c'"> Musikktrykk</xsl:if>
75                                 <xsl:if test="$field019b='d'"> Lydopptak</xsl:if>
76                                 <xsl:if test="contains($field019b,'da')"> Grammofonplate</xsl:if>
77                                 <xsl:if test="contains($field019b,'db')"> Kassett</xsl:if>
78                                 <xsl:if test="contains($field019b,'dc')"> Kompaktplate</xsl:if>
79                                 <xsl:if test="contains($field019b,'dd')"> Avspiller med lydfil (eks. Digibøker)</xsl:if>
80                                 <xsl:if test="contains($field019b,'dg')"> Musikk</xsl:if>
81                                 <xsl:if test="contains($field019b,'dh')"> Språkkurs</xsl:if>
82                                 <xsl:if test="contains($field019b,'di')"> Lydbok</xsl:if>
83                                 <xsl:if test="contains($field019b,'dj')"> Annen tale/annet</xsl:if>
84                                 <xsl:if test="contains($field019b,'dk')"> Kombidokument</xsl:if>
85                                 <xsl:if test="$field019b='e'"> Film og video</xsl:if>
86                                 <xsl:if test="contains($field019b,'ec')"> Filmspole</xsl:if>
87                                 <xsl:if test="contains($field019b,'ed')"> Videokassett (VHS)</xsl:if>
88                                 <xsl:if test="contains($field019b,'ee')"> Videoplate (DVD)</xsl:if>
89                                 <xsl:if test="contains($field019b,'ef')"> Blu-ray-plate</xsl:if>
90                                 <xsl:if test="$field019b='f'"> Grafisk materiale</xsl:if>
91                                 <xsl:if test="contains($field019b,'fd')"> Dias</xsl:if>
92                                 <xsl:if test="contains($field019b,'ff')"> Fotografi</xsl:if>
93                                 <xsl:if test="contains($field019b,'fi')"> Kunstreproduksjon</xsl:if>
94                                 <xsl:if test="$field019b='g'"> Elektroniske ressurser</xsl:if>
95                                 <xsl:if test="contains($field019b,'gb')"> Diskett</xsl:if>
96                                 <xsl:if test="contains($field019b,'gd')"> Optiske lagringsmedia (CD-ROM)</xsl:if>
97                                 <xsl:if test="contains($field019b,'ge')"> Nettressurser</xsl:if>
98                                 <xsl:if test="$field019b='h'"> Tredimensjonale gjenstander</xsl:if>
99                                 <xsl:if test="$field019b='i'"> Mikroformer</xsl:if>
100                                 <xsl:if test="contains($field019b,'ib')"> Mikrofilmspole</xsl:if>
101                                 <xsl:if test="contains($field019b,'ic')"> Mikrofilmkort</xsl:if>
102                                 <xsl:if test="$field019b='j'"> Periodika</xsl:if>
103                                 <xsl:if test="$field019b='k'"> Artikler (i bøker eller periodika)</xsl:if>
104                                 <xsl:if test="$field019b='l'"> Fysiske bøker</xsl:if>
105             </xsl:if>
106
107             <!-- Check positions 00 and 01 of controlfield 007 -->
108
109             <xsl:if test="$controlField007-00='a'">
110                 <!-- Kartografisk materiale (unntatt globus) -->
111                                 <xsl:if test="$controlField007-01='a'">Anamorfisk kart</xsl:if>
112                                 <xsl:if test="$controlField007-01='b'">Atlas</xsl:if>
113                                 <xsl:if test="$controlField007-01='c'">Fantasikart</xsl:if>
114                                 <xsl:if test="$controlField007-01='d'">Flykart</xsl:if>
115                                 <xsl:if test="$controlField007-01='e'">Sjøkart</xsl:if>
116                                 <xsl:if test="$controlField007-01='f'">Navigasjonskart</xsl:if>
117                                 <xsl:if test="$controlField007-01='g'">Blokkdiagram</xsl:if>
118                                 <xsl:if test="$controlField007-01='h'">Stjernekart</xsl:if>
119                                 <xsl:if test="$controlField007-01='j'">Kart</xsl:if>
120                                 <xsl:if test="$controlField007-01='k'">Kartprofil</xsl:if>
121                                 <xsl:if test="$controlField007-01='l'">Fotokart</xsl:if>
122                                 <xsl:if test="$controlField007-01='m'">Fotomosaikk</xsl:if>
123                                 <xsl:if test="$controlField007-01='n'">Ortofoto</xsl:if>
124                                 <xsl:if test="$controlField007-01='o'">Tegnet kart</xsl:if>
125                                 <xsl:if test="$controlField007-01='p'">Trykt kart</xsl:if>
126                                 <xsl:if test="$controlField007-01='q'">Terrengmodell</xsl:if>
127                                 <xsl:if test="$controlField007-01='r'">Fjernanalysebilde</xsl:if>
128                                 <xsl:if test="$controlField007-01='s'">Kartseksjon</xsl:if>
129                                 <xsl:if test="$controlField007-01='t'">Plan</xsl:if>
130                                 <xsl:if test="$controlField007-01='y'">Perspektivkart</xsl:if>
131                                 <xsl:if test="$controlField007-01='z'">Annen karttype</xsl:if>
132             </xsl:if>
133
134             <xsl:if test="$controlField007-00='c'">
135                 <!-- Maskinlesbar fil -->
136                                 <xsl:if test="$controlField007-01='a'">Magnetisk-optisk plate</xsl:if>
137                                 <xsl:if test="$controlField007-01='b'">Lagringsbrikke</xsl:if>
138                                 <xsl:if test="$controlField007-01='c'">Optisk kassett</xsl:if>
139                                 <xsl:if test="$controlField007-01='d'">Diskett</xsl:if>
140                                 <xsl:if test="$controlField007-01='h'">Platelager (harddisk)</xsl:if>
141                                 <xsl:if test="$controlField007-01='k'">Magnetbåndkassett</xsl:if>
142                                 <xsl:if test="$controlField007-01='m'">Magnetbåndspole</xsl:if>
143                                 <xsl:if test="$controlField007-01='n'">Fjerntilgang (online)</xsl:if>
144                                 <xsl:if test="$controlField007-01='o'">Optisk plate</xsl:if>
145                                 <xsl:if test="$controlField007-01='z'">Annet lagringsmedium</xsl:if>
146             </xsl:if>
147
148             <xsl:if test="$controlField007-00='d'">
149                 <!-- Globus -->
150                                 <xsl:if test="$controlField007-01='a'">Stjerneglobus</xsl:if>
151                                 <xsl:if test="$controlField007-01='b'">Planet- eller måneglobus</xsl:if>
152                                 <xsl:if test="$controlField007-01='c'">Jordglobus</xsl:if>
153                                 <xsl:if test="$controlField007-01='z'">Annen globustype</xsl:if>
154             </xsl:if>
155
156             <xsl:if test="$controlField007-00='g'">
157                 <!-- Grafisk materiale som er tenkt projisert eller gjennomlyst -->
158                                 <xsl:if test="$controlField007-01='h'">Hologram</xsl:if>
159                                 <xsl:if test="$controlField007-01='o'">Billedbånd</xsl:if>
160                                 <xsl:if test="$controlField007-01='p'">Stereobilde</xsl:if>
161                                 <xsl:if test="$controlField007-01='r'">Røntgenbilde</xsl:if>
162                                 <xsl:if test="$controlField007-01='s'">Dia</xsl:if>
163                                 <xsl:if test="$controlField007-01='t'">Transparent</xsl:if>
164                                 <xsl:if test="$controlField007-01='z'">Annen materialtype</xsl:if>
165             </xsl:if>
166
167             <xsl:if test="$controlField007-00='h'">
168                 <!-- Mikroform -->
169                                 <xsl:if test="$controlField007-01='a'">Vinduskort</xsl:if>
170                                 <xsl:if test="$controlField007-01='c'">Mikrofilmkassett</xsl:if>
171                                 <xsl:if test="$controlField007-01='d'">Mikrofilmspole</xsl:if>
172                                 <xsl:if test="$controlField007-01='e'">Mikrofilmkort</xsl:if>
173                                 <xsl:if test="$controlField007-01='g'">Mikro-opak</xsl:if>
174                                 <xsl:if test="$controlField007-01='z'">Annen mikroformtype</xsl:if>
175             </xsl:if>
176
177             <xsl:if test="$controlField007-00='k'">
178                 <!-- Grafisk materiale som er ugjennomtrengelig for lys -->
179                                 <xsl:if test="$controlField007-01='c'">Collage</xsl:if> <!-- Originalt kunstverk -->
180                                 <xsl:if test="$controlField007-01='d'">Tegning</xsl:if> <!-- Originalt kunstverk -->
181                                 <xsl:if test="$controlField007-01='e'">Maleri</xsl:if> <!-- Originalt kunstverk -->
182                                 <xsl:if test="$controlField007-01='g'">Fotografi - negativ</xsl:if>
183                                 <xsl:if test="$controlField007-01='h'">Fotografi</xsl:if> <!-- Brukes også om ugjennomsiktige stereobilder. -->
184                                 <xsl:if test="$controlField007-01='i'">Bilde</xsl:if> <!-- Brukes når en mer spesifikk betegnelse er ukjent eller uønsket. -->
185                                 <xsl:if test="$controlField007-01='j'">Grafisk blad</xsl:if>
186                                 <xsl:if test="$controlField007-01='k'">Flipover</xsl:if>
187                                 <xsl:if test="$controlField007-01='l'">Teknisk tegning</xsl:if>
188                                 <xsl:if test="$controlField007-01='m'">Studieplansje</xsl:if>
189                                 <xsl:if test="$controlField007-01='n'">Plansje</xsl:if>
190                                 <xsl:if test="$controlField007-01='o'">Billedkort</xsl:if>
191                                 <xsl:if test="$controlField007-01='p'">Ordkort</xsl:if>
192                                 <xsl:if test="$controlField007-01='q'">Symbolkort</xsl:if>
193                                 <xsl:if test="$controlField007-01='r'">Kunstreproduksjon</xsl:if>
194                                 <xsl:if test="$controlField007-01='s'">Postkort</xsl:if>
195                                 <xsl:if test="$controlField007-01='t'">Plakat</xsl:if>
196                                 <xsl:if test="$controlField007-01='z'">Annen materialtype</xsl:if>
197             </xsl:if>
198
199             <xsl:if test="$controlField007-00='m'">
200                 <!-- Film -->
201                                 <xsl:if test="$controlField007-01='c'">Filmsløyfe</xsl:if>
202                                 <xsl:if test="$controlField007-01='f'">Filmkassett</xsl:if>
203                                 <xsl:if test="$controlField007-01='r'">Filmspole</xsl:if>
204                                 <xsl:if test="$controlField007-01='z'">Annen filmtype</xsl:if>
205             </xsl:if>
206
207             <xsl:if test="$controlField007-00='s'">
208                 <!-- Lydopptak -->
209                                 <xsl:if test="$controlField007-01='c'">Kompaktplate</xsl:if>
210                                 <xsl:if test="$controlField007-01='d'">Grammofonplate</xsl:if>
211                                 <xsl:if test="$controlField007-01='e'">Sylinder</xsl:if> <!-- Lydrull, voksrull, fonografsylinder -->
212                                 <xsl:if test="$controlField007-01='g'">Sløyfekassett</xsl:if>
213                                 <xsl:if test="$controlField007-01='i'">Filmlydspor</xsl:if>
214                                 <xsl:if test="$controlField007-01='q'">Rull (pianorull/orgelrull)</xsl:if>
215                                 <xsl:if test="$controlField007-01='s'">Lydkassett</xsl:if>
216                                 <xsl:if test="$controlField007-01='t'">Lydbånd</xsl:if>
217                                 <xsl:if test="$controlField007-01='w'">Wire</xsl:if>
218                                 <xsl:if test="$controlField007-01='z'">Annet lydmateriale</xsl:if>
219             </xsl:if>
220
221             <xsl:if test="$controlField007-00='u'">
222                 <!-- Tre-dimensjonal gjenstand -->
223                                 <xsl:if test="$controlField007-01='a'">Originalt kunstverk</xsl:if> <!-- F.eks. en skulptur. -->
224                                 <xsl:if test="$controlField007-01='c'">Kunstreproduksjon</xsl:if>
225                                 <xsl:if test="$controlField007-01='d'">Diorama</xsl:if>
226                                 <xsl:if test="$controlField007-01='e'">Øvelsesmodell</xsl:if>
227                                 <xsl:if test="$controlField007-01='g'">Spill</xsl:if>
228                                 <xsl:if test="$controlField007-01='p'">Mikroskopdia</xsl:if>
229                                 <xsl:if test="$controlField007-01='q'">Modell</xsl:if>
230                                 <xsl:if test="$controlField007-01='r'">Realia</xsl:if>
231                                 <xsl:if test="$controlField007-01='u'">Utstilling</xsl:if>
232                                 <xsl:if test="$controlField007-01='z'">Annen type gjenstand</xsl:if>
233             </xsl:if>
234
235             <xsl:if test="$controlField007-00='v'">
236                 <!-- Videoopptak -->
237                                 <xsl:if test="$controlField007-01='d'">Videoplate</xsl:if>
238                                 <xsl:if test="$controlField007-01='f'">Videokassett</xsl:if>
239                                 <xsl:if test="$controlField007-01='r'">Videospole</xsl:if>
240                                 <xsl:if test="$controlField007-01='z'">Annen type videoopptak</xsl:if>
241             </xsl:if>
242
243         </xsl:variable>
244
245         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute><xsl:attribute name="class">title</xsl:attribute>
246
247         <xsl:if test="marc:datafield[@tag=245]">
248         <xsl:for-each select="marc:datafield[@tag=245]">
249             <xsl:variable name="title">
250                      <xsl:call-template name="subfieldSelect">
251                         <xsl:with-param name="codes">a</xsl:with-param>
252                     </xsl:call-template>
253                     <xsl:if test="marc:subfield[@code='b']">
254                         <xsl:text> </xsl:text>
255                         <xsl:call-template name="subfieldSelect">
256                             <xsl:with-param name="codes">b</xsl:with-param>
257                         </xsl:call-template>
258                     </xsl:if>
259                     <xsl:if test="marc:subfield[@code='h']">
260                         <xsl:text> </xsl:text>
261                         <xsl:call-template name="subfieldSelect">
262                             <xsl:with-param name="codes">h</xsl:with-param>
263                         </xsl:call-template>
264                     </xsl:if>
265                 <xsl:text> </xsl:text>
266                     <xsl:call-template name="subfieldSelect">
267                         <xsl:with-param name="codes">np</xsl:with-param>
268                      </xsl:call-template>
269             </xsl:variable>
270             <xsl:variable name="titleChop">
271                 <xsl:call-template name="chopPunctuation">
272                     <xsl:with-param name="chopString">
273                         <xsl:value-of select="$title"/>
274                     </xsl:with-param>
275                 </xsl:call-template>
276             </xsl:variable>
277             <xsl:value-of select="$titleChop"/>
278         </xsl:for-each>
279         </xsl:if>
280     </a>
281
282     <xsl:choose>
283     <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]">
284     <p class="author">av
285     <xsl:for-each select="marc:datafield[(@tag=100 or @tag=700) and @ind1!='z']">
286     <a>
287     <xsl:choose>
288         <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
289             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
290         </xsl:when>
291         <xsl:otherwise>
292         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
293         </xsl:otherwise>
294     </xsl:choose>
295     <xsl:call-template name="nameABCDQ"/></a>
296     <xsl:choose>
297     <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
298     </xsl:for-each>
299
300     <xsl:for-each select="marc:datafield[(@tag=110 or @tag=710) and @ind1!='z']">
301     <a>
302     <xsl:choose>
303         <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
304             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
305         </xsl:when>
306         <xsl:otherwise>
307         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
308         </xsl:otherwise>
309     </xsl:choose>
310     <xsl:call-template name="nameABCDN"/></a>
311     <xsl:choose><xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
312     </xsl:for-each>
313
314     <xsl:for-each select="marc:datafield[(@tag=111 or @tag=711) and @ind1!='z']">
315         <xsl:choose>
316         <xsl:when test="marc:subfield[@code='n']">
317            <xsl:text> </xsl:text>
318            <xsl:call-template name="subfieldSelect">
319               <xsl:with-param name="codes">n</xsl:with-param>                              </xsl:call-template>
320            <xsl:text> </xsl:text>
321         </xsl:when>
322         </xsl:choose>
323     <a>
324     <xsl:choose>
325         <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
326             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
327         </xsl:when>
328         <xsl:otherwise>
329         <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
330         </xsl:otherwise>
331     </xsl:choose>
332     <xsl:call-template name="nameACDEQ"/></a>
333     <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
334
335     </xsl:for-each>
336     </p>
337     </xsl:when>
338     </xsl:choose>
339
340     <xsl:if test="marc:datafield[@tag=300]">
341     <span class="results_summary description"><span class="label">Beskrivelse: </span>
342         <xsl:for-each select="marc:datafield[@tag=300]">
343             <xsl:call-template name="chopPunctuation">
344               <xsl:with-param name="chopString">
345                 <xsl:call-template name="subfieldSelect">
346                     <xsl:with-param name="codes">abce</xsl:with-param>
347                 </xsl:call-template>
348                </xsl:with-param>
349            </xsl:call-template>
350                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
351         </xsl:for-each>
352     </span>
353    </xsl:if>
354
355     <xsl:if test="marc:datafield[@tag=020]">
356     <span class="results_summary isbn"><span class="label">ISBN: </span>
357     <xsl:for-each select="marc:datafield[@tag=020]">
358     <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
359             <xsl:value-of select="marc:subfield[@code='a']"/>
360             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
361     </xsl:for-each>
362     </span>
363     </xsl:if>
364
365     <xsl:if test="marc:datafield[@tag=022]">
366     <span class="results_summary issn"><span class="label">ISSN: </span>
367     <xsl:for-each select="marc:datafield[@tag=022]">
368             <xsl:value-of select="marc:subfield[@code='a']"/>
369             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
370     </xsl:for-each>
371     </span>
372     </xsl:if>
373
374     <xsl:if test="marc:datafield[@tag=250]">
375         <span class="results_summary">
376     <span class="label">Utgave: </span>
377             <xsl:for-each select="marc:datafield[@tag=250]">
378                     <xsl:call-template name="subfieldSelect">
379                         <xsl:with-param name="codes">ab</xsl:with-param>
380                     </xsl:call-template>
381             </xsl:for-each>
382         </span>
383     </xsl:if>
384
385     <span class="results_summary">
386     <xsl:if test="$typeOf008!=''">
387         <span class="label">Materialtype: </span>
388             <xsl:choose>
389                 <xsl:when test="$typeOf008='Mon'"><img src="/intranet-tmpl/prog/img/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
390                 <xsl:when test="$typeOf008='Per'"><img src="/intranet-tmpl/prog/img/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
391                 <xsl:when test="$typeOf008='Fil'"><img src="/intranet-tmpl/prog/img/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
392                 <xsl:when test="$typeOf008='Kar'"><img src="/intranet-tmpl/prog/img/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
393                 <xsl:when test="$typeOf008='FV'"><img  src="/intranet-tmpl/prog/img/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
394                 <xsl:when test="$typeOf008='Mus'"><img src="/intranet-tmpl/prog/img/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
395                 <xsl:when test="$typeOf008='gra'"><img src="/intranet-tmpl/prog/img/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
396                 <xsl:when test="$typeOf008='kom'"><img src="/intranet-tmpl/prog/img/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
397                 <xsl:when test="$typeOf008='trd'"><img src="/intranet-tmpl/prog/img/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
398             </xsl:choose>
399     </xsl:if>
400     <xsl:if test="string-length(normalize-space($physicalDescription))">
401         <span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
402     </xsl:if>
403
404         <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">
405
406         <xsl:if test="$typeOf008='Per'">
407         <xsl:if test="$controlField008-21 and contains($controlField008-21,'amnpz')">
408         <span class="label">; Type periodikum: </span>
409         </xsl:if>
410             <xsl:choose>
411                 <xsl:when test="$controlField008-21='a'">Årbok</xsl:when>
412                                 <xsl:when test="$controlField008-21='m'">Monografiserie</xsl:when>
413                                 <xsl:when test="$controlField008-21='n'">Avis</xsl:when>
414                                 <xsl:when test="$controlField008-21='p'">Tidsskrift</xsl:when>
415                                 <xsl:when test="$controlField008-21='z'">Andre typer periodika</xsl:when>
416             </xsl:choose>
417         </xsl:if>
418
419         <xsl:if test="$typeOf008='Mon' or $typeOf008='Per'">
420         <span class="label">; Innhold: </span>
421             <xsl:choose>
422                 <xsl:when test="contains($controlField008-24,'a')"> Sammendrag(abstracts)/Referatorganer</xsl:when>
423                 <xsl:when test="contains($controlField008-24,'b')"> Bibliografier</xsl:when>
424                 <xsl:when test="contains($controlField008-24,'c')"> Kataloger</xsl:when>
425                 <xsl:when test="contains($controlField008-24,'d')"> Ordbøker</xsl:when>
426                 <xsl:when test="contains($controlField008-24,'e')"> Konversasjonsleksika</xsl:when>
427                 <xsl:when test="contains($controlField008-24,'f')"> Håndbøker</xsl:when>
428                 <xsl:when test="contains($controlField008-24,'h')"> Referanseverk</xsl:when>
429                 <xsl:when test="contains($controlField008-24,'i')"> Registre</xsl:when>
430                 <xsl:when test="contains($controlField008-24,'k')"> Diskografier</xsl:when>
431                 <xsl:when test="contains($controlField008-24,'l')"> Lover og forskrifter</xsl:when>
432                 <xsl:when test="contains($controlField008-24,'m')"> Hovedoppgaver/diplomoppgaver</xsl:when>
433                 <xsl:when test="contains($controlField008-24,'n')"> Oversiktsverker innenfor et emne</xsl:when>
434                 <xsl:when test="contains($controlField008-24,'o')"> Anmeldelser</xsl:when>
435                 <xsl:when test="contains($controlField008-24,'q')"> Filmografier</xsl:when>
436                 <xsl:when test="contains($controlField008-24,'r')"> Adressebøker</xsl:when>
437                 <xsl:when test="contains($controlField008-24,'s')"> Statistikker</xsl:when>
438                 <xsl:when test="contains($controlField008-24,'t')"> Tekniske rapporter</xsl:when>
439                 <xsl:when test="contains($controlField008-24,'x')"> Doktoravhandlinger/lisensiat-avhandlinger</xsl:when>
440             </xsl:choose>
441             <xsl:choose>
442                 <xsl:when test="$controlField008-29='1'">
443                     Konferansepublikasjon
444                 </xsl:when>
445             </xsl:choose>
446         </xsl:if>
447         <xsl:if test="$typeOf008='CF'">
448             <xsl:if test="$controlField008-26='a' or $controlField008-26='b' or $controlField008-26='c' or $controlField008-26='d' or $controlField008-26='e' or $controlField008-26='f' or $controlField008-26='g' or $controlField008-26='h' or $controlField008-26='i' or $controlField008-26='j'">
449             <span class="label">; Type maskinlesbar fil: </span>
450             </xsl:if>
451             <xsl:choose>
452                 <xsl:when test="$controlField008-26='a'">Numeriske data</xsl:when>
453                 <xsl:when test="$controlField008-26='b'">Programvare</xsl:when>
454                 <xsl:when test="$controlField008-26='c'">Grafiske data</xsl:when>
455                 <xsl:when test="$controlField008-26='d'">Tekst</xsl:when>
456                 <xsl:when test="$controlField008-26='e'">Bibliografiske data</xsl:when>
457                 <xsl:when test="$controlField008-26='f'">Font</xsl:when>
458                 <xsl:when test="$controlField008-26='g'">Spill</xsl:when>
459                 <xsl:when test="$controlField008-26='h'">Lyd</xsl:when>
460                 <xsl:when test="$controlField008-26='i'">Interaktivt multimedium</xsl:when>
461                 <xsl:when test="$controlField008-26='j'">Online tjeneste</xsl:when>
462             </xsl:choose>
463         </xsl:if>
464         <xsl:if test="$typeOf008='Mon'">
465             <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')">
466             <span class="label">; Innhold: </span>
467             </xsl:if>
468             <xsl:if test="substring($controlField008,31,1)='1' or substring($controlField008,31,1)='a' or substring($controlField008,31,1)='b'">
469                 Festskrift
470             </xsl:if>
471             <xsl:if test="$controlField008-34='a' or $controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
472                 Biografi
473             </xsl:if>
474
475             <xsl:if test="$controlField008-33 and $controlField008-33!='^' and $controlField008-33!=' '">
476             <span class="label">; Litterær form: </span>
477             </xsl:if>
478             <xsl:choose>
479                 <xsl:when test="$controlField008-33='0'">Ikke skjønnlitteratur</xsl:when>
480                 <xsl:when test="$controlField008-33='l'">Lærebok, brevkurs</xsl:when>
481                 <xsl:when test="$controlField008-33='1'">Skjønnlitteratur</xsl:when>
482                 <xsl:when test="$controlField008-33='r'">Roman</xsl:when>
483                 <xsl:when test="$controlField008-33='n'">Novelle / fortelling</xsl:when>
484                 <xsl:when test="$controlField008-33='d'">Dikt</xsl:when>
485                 <xsl:when test="$controlField008-33='s'">Skuespill</xsl:when>
486                 <xsl:when test="$controlField008-33='t'">Tegneserie</xsl:when>
487                 <xsl:when test="$controlField008-33='a'">Antologi</xsl:when>
488                 <xsl:when test="$controlField008-33='p'">Pekebok</xsl:when>
489             </xsl:choose>
490         </xsl:if>
491         <xsl:if test="$typeOf008='Mus' and $controlField008-30-31 and $controlField008-30-31!='^^' and $controlField008-30-31!='  '">
492             <span class="label">; Litterær form: </span> <!-- Literary text for sound recordings -->
493             <xsl:if test="contains($controlField008-30-31,'a')">Selvbiografier</xsl:if>
494             <xsl:if test="contains($controlField008-30-31,'b')">Biografier</xsl:if>
495             <xsl:if test="contains($controlField008-30-31,'c')">Samtaler og diskusjoner</xsl:if>
496             <xsl:if test="contains($controlField008-30-31,'d')">Drama</xsl:if>
497             <xsl:if test="contains($controlField008-30-31,'e')">Essays</xsl:if>
498             <xsl:if test="contains($controlField008-30-31,'f')">Romaner</xsl:if>
499             <xsl:if test="contains($controlField008-30-31,'g')">Rapporter, referater</xsl:if>
500             <xsl:if test="contains($controlField008-30-31,'h')">Fortellinger, noveller</xsl:if>
501             <xsl:if test="contains($controlField008-30-31,'i')">Undervisning</xsl:if>
502             <xsl:if test="contains($controlField008-30-31,'j')">Språkundervisning</xsl:if>
503             <xsl:if test="contains($controlField008-30-31,'k')">Komedier</xsl:if>
504             <xsl:if test="contains($controlField008-30-31,'l')">Foredrag, taler</xsl:if>
505             <xsl:if test="contains($controlField008-30-31,'m')">Memoarer</xsl:if>
506             <xsl:if test="contains($controlField008-30-31,'o')">Eventyr</xsl:if>
507             <xsl:if test="contains($controlField008-30-31,'p')">Dikt</xsl:if>
508             <xsl:if test="contains($controlField008-30-31,'r')">Fremføring av alle typer ikke-musikalske produksjoner</xsl:if>
509             <xsl:if test="contains($controlField008-30-31,'s')">Lyder (f.eks. fuglelyder)</xsl:if>
510             <xsl:if test="contains($controlField008-30-31,'t')">Intervjuer</xsl:if>
511             <xsl:if test="contains($controlField008-30-31,'z')">Andre typer innhold</xsl:if>
512         </xsl:if>
513
514         </xsl:if>
515
516     <xsl:if test="$typeOf008='Mon'">
517         <span class="label">; Målgruppe: </span>
518         <xsl:choose>
519                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
520                         <xsl:when test="$controlField008-22='b'">Billedbøker for voksne;</xsl:when>
521                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
522                         <xsl:when test="$controlField008-22='k'">Billedbøker;</xsl:when>
523                         <xsl:when test="$controlField008-22='l'">Barn i alderen til og med 5 år;</xsl:when>
524                         <xsl:when test="$controlField008-22='m'">Elever på 1. til 3. klassetrinn;</xsl:when>
525                         <xsl:when test="$controlField008-22='n'">Elever på 4. og 5. klassetrinn;</xsl:when>
526                         <xsl:when test="$controlField008-22='o'">Elever på 6. og 7. klassetrinn;</xsl:when>
527                         <xsl:when test="$controlField008-22='p'">Elever på ungdomstrinnet;</xsl:when>
528                         <xsl:when test="$controlField008-22='v'">Billedbøker for barn i alderen til og med 5 år;</xsl:when>
529                         <xsl:when test="$controlField008-22='w'">Billedbøker for elever på 1. til 3. klassetrinn;</xsl:when>
530                         <xsl:when test="$controlField008-22='x'">Billedbøker for elever på 4. og 5. klassetrinn;</xsl:when>
531                         <xsl:when test="$controlField008-22='y'">Billedbøker for elever på 6. og 7. klassetrinn;</xsl:when>
532                         <xsl:when test="$controlField008-22='z'">Billedbøker for elever på ungdomstrinnet;</xsl:when>
533                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
534                         <xsl:when test="$controlField008-22='q'">Lettlest;</xsl:when>
535                         <xsl:when test="$controlField008-22='r'">For psykisk utviklingshemmede;</xsl:when>
536                         <xsl:when test="$controlField008-22='s'">Storskrift;</xsl:when>
537                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
538                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
539         </xsl:choose>
540     </xsl:if>
541     <xsl:if test="$typeOf008='Per'">
542         <span class="label">; Målgruppe: </span>
543         <xsl:choose>
544                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
545                         <xsl:when test="$controlField008-22='b'">Tegneserier for voksne;</xsl:when>
546                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
547                         <xsl:when test="$controlField008-22='k'">Tegneserier;</xsl:when>
548                         <xsl:when test="$controlField008-22='l'">Barn i alderen til og med 5 år;</xsl:when>
549                         <xsl:when test="$controlField008-22='m'">Elever på 1. til 3. klassetrinn;</xsl:when>
550                         <xsl:when test="$controlField008-22='n'">Elever på 4. og 5. klassetrinn;</xsl:when>
551                         <xsl:when test="$controlField008-22='o'">Elever på 6. og 7. klassetrinn;</xsl:when>
552                         <xsl:when test="$controlField008-22='p'">Elever på ungdomstrinnet;</xsl:when>
553                         <xsl:when test="$controlField008-22='v'">Tegneserier for barn i alderen til og med 5 år;</xsl:when>
554                         <xsl:when test="$controlField008-22='w'">Tegneserier for elever på 1. til 3. klassetrinn;</xsl:when>
555                         <xsl:when test="$controlField008-22='x'">Tegneserier for elever på 4. og 5. klassetrinn;</xsl:when>
556                         <xsl:when test="$controlField008-22='y'">Tegneserier for elever på 6. og 7. klassetrinn;</xsl:when>
557                         <xsl:when test="$controlField008-22='z'">Tegneserier for elever på ungdomstrinnet;</xsl:when>
558                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
559                         <xsl:when test="$controlField008-22='q'">Lettlest;</xsl:when>
560                         <xsl:when test="$controlField008-22='r'">For psykisk utviklingshemmede;</xsl:when>
561                         <xsl:when test="$controlField008-22='s'">Storskrift;</xsl:when>
562                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
563                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
564         </xsl:choose>
565     </xsl:if>
566     <xsl:if test="$typeOf008='Fil' or $typeOf008='Mus'">
567         <span class="label">; Målgruppe: </span>
568         <xsl:choose>
569                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
570                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
571                         <xsl:when test="$controlField008-22='1'">Barn i alderen til og med 5 år;</xsl:when>
572                         <xsl:when test="$controlField008-22='m'">Elever på 1. til 3. klassetrinn;</xsl:when>
573                         <xsl:when test="$controlField008-22='n'">Elever på 4. og 5. klassetrinn;</xsl:when>
574                         <xsl:when test="$controlField008-22='o'">Elever på 6. og 7. klassetrinn;</xsl:when>
575                         <xsl:when test="$controlField008-22='p'">Elever på ungdomstrinnet;</xsl:when>
576                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
577                         <xsl:when test="$controlField008-22='q'">Lettlest;</xsl:when>
578                         <xsl:when test="$controlField008-22='r'">For psykisk utviklingshemmede;</xsl:when>
579                         <xsl:when test="$controlField008-22='s'">Storskrift;</xsl:when>
580                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
581                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
582         </xsl:choose>
583     </xsl:if>
584     <xsl:if test="$typeOf008='FV'">
585         <span class="label">; Målgruppe: </span>
586         <xsl:choose>
587                         <xsl:when test="$controlField008-22='a'">Voksne;</xsl:when>
588                         <xsl:when test="$controlField008-22='1'">Voksne over 18 år;</xsl:when>
589                         <xsl:when test="$controlField008-22='2'">Voksne over 15 år;</xsl:when>
590                         <xsl:when test="$controlField008-22='j'">Barn og ungdom;</xsl:when>
591                         <xsl:when test="$controlField008-22='4'">Ungdom over 12 år;</xsl:when>
592                         <xsl:when test="$controlField008-22='5'">Barn over 7 år;</xsl:when>
593                         <xsl:when test="$controlField008-22='6'">Småbarn;</xsl:when>
594                         <xsl:when test="$controlField008-22='f'">Spesialisert;</xsl:when>
595                         <xsl:when test="$controlField008-22='g'">Generell;</xsl:when>
596                         <xsl:when test="$controlField008-22='u'">Ukjent;</xsl:when>
597         </xsl:choose>
598     </xsl:if>
599         </span>
600
601   <!-- Utgivelse, distribusjon osv -->
602     <xsl:if test="marc:datafield[@tag=260]">
603         <span class="results_summary">
604     <span class="label">Utgiver: </span>
605             <xsl:for-each select="marc:datafield[@tag=260]">
606                     <xsl:call-template name="subfieldSelect">
607                         <xsl:with-param name="codes">abcefg</xsl:with-param>
608                     </xsl:call-template>
609             </xsl:for-each>
610         </span>
611     </xsl:if>
612
613   <!-- Parallelltittel (R) -->
614   <xsl:if test="marc:datafield[@tag=246]">
615         <span class="results_summary">
616     <span class="label">Parallelltittel: </span>
617             <xsl:for-each select="marc:datafield[@tag=246]">
618                     <xsl:call-template name="subfieldSelect">
619                         <xsl:with-param name="codes">ab</xsl:with-param>
620                     </xsl:call-template>
621             </xsl:for-each>
622         </span>
623   </xsl:if>
624
625     <xsl:if test="marc:datafield[@tag=856]">
626          <span class="results_summary">
627                            <span class="label">Online tilgang: </span>
628                             <xsl:for-each select="marc:datafield[@tag=856]">
629                             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
630                                    <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
631                                     <xsl:choose>
632                                      <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')">
633                                         <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>
634                                     </xsl:when>
635                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
636                                         <xsl:call-template name="subfieldSelect">
637                                         <xsl:with-param name="codes">y3z</xsl:with-param>
638                                         </xsl:call-template>
639                                     </xsl:when>
640                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
641                                         <xsl:choose>
642                                         <xsl:when test="$URLLinkText!=''">
643                                                 <xsl:value-of select="$URLLinkText"/>
644                                         </xsl:when>
645                                         <xsl:otherwise>
646                                                 <xsl:text>Klikk her for online tilgang</xsl:text>
647                                         </xsl:otherwise>
648                                         </xsl:choose>
649                                     </xsl:when>
650                                     </xsl:choose>
651                                     </a>
652                                     <xsl:choose>
653                                     <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
654                                     <xsl:otherwise> | </xsl:otherwise>
655                                     </xsl:choose>
656                             </xsl:for-each>
657                             </span>
658                         </xsl:if>
659     </xsl:template>
660
661     <xsl:template name="nameABCDQ">
662             <xsl:call-template name="chopPunctuation">
663                 <xsl:with-param name="chopString">
664                     <xsl:call-template name="subfieldSelect">
665                         <xsl:with-param name="codes">aq</xsl:with-param>
666                     </xsl:call-template>
667                 </xsl:with-param>
668                 <xsl:with-param name="punctuation">
669                     <xsl:text>:,;/ </xsl:text>
670                 </xsl:with-param>
671             </xsl:call-template>
672         <xsl:call-template name="termsOfAddress"/>
673     </xsl:template>
674
675     <xsl:template name="nameABCDN">
676         <xsl:for-each select="marc:subfield[@code='a']">
677                 <xsl:call-template name="chopPunctuation">
678                     <xsl:with-param name="chopString" select="."/>
679                 </xsl:call-template>
680         </xsl:for-each>
681         <xsl:for-each select="marc:subfield[@code='b']">
682                 <xsl:value-of select="."/>
683         </xsl:for-each>
684         <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
685                 <xsl:call-template name="subfieldSelect">
686                     <xsl:with-param name="codes">cdn</xsl:with-param>
687                 </xsl:call-template>
688         </xsl:if>
689     </xsl:template>
690
691     <xsl:template name="nameACDEQ">
692             <xsl:call-template name="subfieldSelect">
693                 <xsl:with-param name="codes">acdeq</xsl:with-param>
694             </xsl:call-template>
695     </xsl:template>
696
697     <xsl:template name="termsOfAddress">
698         <xsl:if test="marc:subfield[@code='b' or @code='c']">
699             <xsl:call-template name="chopPunctuation">
700                 <xsl:with-param name="chopString">
701                     <xsl:call-template name="subfieldSelect">
702                         <xsl:with-param name="codes">bc</xsl:with-param>
703                     </xsl:call-template>
704                 </xsl:with-param>
705             </xsl:call-template>
706         </xsl:if>
707     </xsl:template>
708
709     <xsl:template name="nameDate">
710         <xsl:for-each select="marc:subfield[@code='d']">
711             <xsl:call-template name="chopPunctuation">
712                 <xsl:with-param name="chopString" select="."/>
713             </xsl:call-template>
714         </xsl:for-each>
715     </xsl:template>
716
717     <xsl:template name="role">
718         <xsl:for-each select="marc:subfield[@code='e']">
719                     <xsl:value-of select="."/>
720         </xsl:for-each>
721         <xsl:for-each select="marc:subfield[@code='4']">
722                     <xsl:value-of select="."/>
723         </xsl:for-each>
724     </xsl:template>
725
726     <xsl:template name="specialSubfieldSelect">
727         <xsl:param name="anyCodes"/>
728         <xsl:param name="axis"/>
729         <xsl:param name="beforeCodes"/>
730         <xsl:param name="afterCodes"/>
731         <xsl:variable name="str">
732             <xsl:for-each select="marc:subfield">
733                 <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])">
734                     <xsl:value-of select="text()"/>
735                     <xsl:text> </xsl:text>
736                 </xsl:if>
737             </xsl:for-each>
738         </xsl:variable>
739         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
740     </xsl:template>
741
742     <xsl:template name="subtitle">
743         <xsl:if test="marc:subfield[@code='b']">
744                 <xsl:call-template name="chopPunctuation">
745                     <xsl:with-param name="chopString">
746                         <xsl:value-of select="marc:subfield[@code='b']"/>
747                     </xsl:with-param>
748                 </xsl:call-template>
749         </xsl:if>
750     </xsl:template>
751
752     <xsl:template name="chopBrackets">
753         <xsl:param name="chopString"></xsl:param>
754         <xsl:variable name="string">
755             <xsl:call-template name="chopPunctuation">
756                 <xsl:with-param name="chopString" select="$chopString"></xsl:with-param>
757             </xsl:call-template>
758         </xsl:variable>
759         <xsl:if test="substring($string, 1,1)='['">
760             <xsl:value-of select="substring($string,2, string-length($string)-2)"></xsl:value-of>
761         </xsl:if>
762         <xsl:if test="substring($string, 1,1)!='['">
763             <xsl:value-of select="$string"></xsl:value-of>
764         </xsl:if>
765     </xsl:template>
766
767 </xsl:stylesheet>