Merge remote-tracking branch 'origin/new/bug_7143'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / xslt / MARC21slim2intranetDetail.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
4
5 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
6 <xsl:stylesheet version="1.0"
7   xmlns:marc="http://www.loc.gov/MARC21/slim"
8   xmlns:items="http://www.koha-community.org/items"
9   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10   exclude-result-prefixes="marc items">
11     <xsl:import href="MARC21slimUtils.xsl"/>
12     <xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
13     <xsl:template match="/">
14             <xsl:apply-templates/>
15     </xsl:template>
16
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         <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
22         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
23         <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
24         <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
25         <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
26         <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
27         <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
28         <xsl:variable name="TracingQuotesLeft">
29            <xsl:choose>
30              <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
31              <xsl:otherwise>"</xsl:otherwise>
32            </xsl:choose>
33         </xsl:variable>
34         <xsl:variable name="TracingQuotesRight">
35           <xsl:choose>
36             <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
37             <xsl:otherwise>"</xsl:otherwise>
38           </xsl:choose>
39         </xsl:variable>
40         <xsl:variable name="leader" select="marc:leader"/>
41         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
42         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
43         <xsl:variable name="leader19" select="substring($leader,20,1)"/>
44         <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
45         <xsl:variable name="materialTypeCode">
46             <xsl:choose>
47                 <xsl:when test="$leader19='a'">ST</xsl:when>
48                 <xsl:when test="$leader6='a'">
49                     <xsl:choose>
50                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
51                         <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
52                         <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
53                     </xsl:choose>
54                 </xsl:when>
55                 <xsl:when test="$leader6='t'">BK</xsl:when>
56                 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
57                 <xsl:when test="$leader6='m'">CF</xsl:when>
58                 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
59                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
60                 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
61                 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
62             </xsl:choose>
63         </xsl:variable>
64         <xsl:variable name="materialTypeLabel">
65             <xsl:choose>
66                 <xsl:when test="$leader19='a'">Set</xsl:when>
67                 <xsl:when test="$leader6='a'">
68                     <xsl:choose>
69                         <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
70                         <xsl:when test="$leader7='i' or $leader7='s'">
71                             <xsl:choose>
72                                 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
73                                 <xsl:otherwise>Series</xsl:otherwise>
74                             </xsl:choose>
75                         </xsl:when>
76                         <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
77                     </xsl:choose>
78                 </xsl:when>
79                 <xsl:when test="$leader6='t'">Book</xsl:when>
80                 <xsl:when test="$leader6='o'">Kit</xsl:when>                            
81                 <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
82                 <xsl:when test="$leader6='m'">Computer File</xsl:when>
83                 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
84                 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual Material</xsl:when>
85                 <xsl:when test="$leader6='j'">Music</xsl:when>
86                 <xsl:when test="$leader6='i'">Sound</xsl:when>
87                 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
88             </xsl:choose>
89         </xsl:variable>
90
91         <!-- Title Statement -->
92         <!-- Alternate Graphic Representation (MARC 880) -->
93         <xsl:if test="$display880">
94             <h1 class="title">
95                 <xsl:call-template name="m880Select">
96                     <xsl:with-param name="basetags">245</xsl:with-param>
97                     <xsl:with-param name="codes">abhfgknps</xsl:with-param>
98                 </xsl:call-template>
99             </h1>
100         </xsl:if>
101
102         <xsl:if test="marc:datafield[@tag=245]">
103         <h1>
104             <xsl:for-each select="marc:datafield[@tag=245]">
105                     <xsl:call-template name="subfieldSelect">
106                         <xsl:with-param name="codes">a</xsl:with-param>
107                     </xsl:call-template>
108                     <xsl:if test="marc:subfield[@code='h']">
109                         <xsl:text> </xsl:text>
110                         <xsl:call-template name="subfieldSelect">
111                             <xsl:with-param name="codes">h</xsl:with-param>
112                         </xsl:call-template>
113                     </xsl:if>
114                     <xsl:if test="marc:subfield[@code='b']">
115                         <xsl:text> </xsl:text>
116                         <xsl:call-template name="subfieldSelect">
117                             <xsl:with-param name="codes">b</xsl:with-param>
118                         </xsl:call-template>
119                     </xsl:if>
120                     <xsl:text> </xsl:text>
121                     <xsl:call-template name="subfieldSelect">
122                         <xsl:with-param name="codes">fgknps</xsl:with-param>
123                     </xsl:call-template>
124             </xsl:for-each>
125         </h1>
126         </xsl:if>
127
128         <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
129         <xsl:if test="$display880">
130             <h5 class="author">
131                 <xsl:call-template name="m880Select">
132                     <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
133                     <xsl:with-param name="codes">abc</xsl:with-param>
134                     <xsl:with-param name="index">au</xsl:with-param>
135                     <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
136                     <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
137                 </xsl:call-template>
138             </h5>
139         </xsl:if>
140
141         <!-- Author Statement -->
142         <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
143         <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
144
145    <xsl:if test="$materialTypeCode!=''">
146         <span class="results_summary type"><span class="label">Type: </span>
147         <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
148         <xsl:text> </xsl:text>
149         <xsl:value-of select="$materialTypeLabel"/>
150         </span>
151    </xsl:if>
152
153         <!--Series: Alternate Graphic Representation (MARC 880) -->
154         <xsl:if test="$display880">
155             <xsl:call-template name="m880Select">
156                 <xsl:with-param name="basetags">440,490</xsl:with-param>
157                 <xsl:with-param name="codes">av</xsl:with-param>
158                 <xsl:with-param name="class">results_summary series</xsl:with-param>
159                 <xsl:with-param name="label">Series: </xsl:with-param>
160                 <xsl:with-param name="index">se</xsl:with-param>
161             </xsl:call-template>
162         </xsl:if>
163         
164         <!-- Series -->
165         <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
166         <span class="results_summary series"><span class="label">Series: </span>
167         <!-- 440 -->
168         <xsl:for-each select="marc:datafield[@tag=440]">
169             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
170             <xsl:call-template name="chopPunctuation">
171                             <xsl:with-param name="chopString">
172                                 <xsl:call-template name="subfieldSelect">
173                                     <xsl:with-param name="codes">av</xsl:with-param>
174                                 </xsl:call-template>
175                             </xsl:with-param>
176                         </xsl:call-template>
177                         </a>
178                     <xsl:text> </xsl:text><xsl:call-template name="part"/>
179             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
180         </xsl:for-each>
181
182         <!-- 490 Series not traced, Ind1 = 0 -->
183         <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
184             <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
185                         <xsl:call-template name="chopPunctuation">
186                             <xsl:with-param name="chopString">
187                                 <xsl:call-template name="subfieldSelect">
188                                     <xsl:with-param name="codes">av</xsl:with-param>
189                                 </xsl:call-template>
190                             </xsl:with-param>
191                         </xsl:call-template>
192             </a>
193                     <xsl:call-template name="part"/>
194         <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
195         </xsl:for-each>
196         <!-- 490 Series traced, Ind1 = 1 -->
197         <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
198             <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
199                 <xsl:choose>
200                     <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
201                         <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
202                             <xsl:call-template name="chopPunctuation">
203                                 <xsl:with-param name="chopString">
204                                     <xsl:call-template name="subfieldSelect">
205                                         <xsl:with-param name="codes">a_t</xsl:with-param>
206                                     </xsl:call-template>
207                                 </xsl:with-param>
208                             </xsl:call-template>
209                         </a>
210                     </xsl:when>
211                     <xsl:otherwise>
212                         <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
213                             <xsl:call-template name="chopPunctuation">
214                                 <xsl:with-param name="chopString">
215                                     <xsl:call-template name="subfieldSelect">
216                                         <xsl:with-param name="codes">a_t</xsl:with-param>
217                                     </xsl:call-template>
218                                 </xsl:with-param>
219                             </xsl:call-template>
220                         </a>
221                         <xsl:call-template name="part"/>
222                     </xsl:otherwise>
223                 </xsl:choose>
224                 <xsl:text>: </xsl:text>
225                 <xsl:value-of  select="marc:subfield[@code='v']" />
226             <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
227             </xsl:for-each>
228         </xsl:if>
229
230         </span>
231         </xsl:if>
232
233         <!-- Analytics -->
234         <xsl:if test="$leader7='s'">
235         <span class="results_summary analytics"><span class="label">Analytics: </span>
236             <a>
237             <xsl:choose>
238             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
239                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute>
240             </xsl:when>
241             <xsl:otherwise>
242                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
243             </xsl:otherwise>
244             </xsl:choose>
245             <xsl:text>Show analytics</xsl:text>
246             </a>
247         </span>
248         </xsl:if>
249
250         <!-- Volumes of sets and traced series -->
251         <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
252         <span class="results_summary volumes"><span class="label">Volumes: </span>
253             <a>
254             <xsl:choose>
255             <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
256                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute>
257             </xsl:when>
258             <xsl:otherwise>
259                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
260             </xsl:otherwise>
261             </xsl:choose>
262             <xsl:text>Show volumes</xsl:text>
263             </a>
264         </span>
265         </xsl:if>
266
267         <!-- Set -->
268         <xsl:if test="$leader19='c'">
269         <span class="results_summary set"><span class="label">Set: </span>
270         <xsl:for-each select="marc:datafield[@tag=773]">
271             <a>
272             <xsl:choose>
273             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
274                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
275             </xsl:when>
276             <xsl:otherwise>
277                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
278             </xsl:otherwise>
279             </xsl:choose>
280             <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
281             </a>
282             <xsl:choose>
283                 <xsl:when test="position()=last()"></xsl:when>
284                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
285             </xsl:choose>
286         </xsl:for-each>
287         </span>
288         </xsl:if>
289
290         <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
291         <xsl:if test="$display880">
292             <xsl:call-template name="m880Select">
293                 <xsl:with-param name="basetags">260</xsl:with-param>
294                 <xsl:with-param name="codes">abcg</xsl:with-param>
295                 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
296                 <xsl:with-param name="label">Publisher: </xsl:with-param>
297             </xsl:call-template>
298         </xsl:if>
299         
300         <xsl:if test="marc:datafield[@tag=260]">
301         <span class="results_summary publisher"><span class="label">Publisher: </span>
302             <xsl:for-each select="marc:datafield[@tag=260]">
303                 <xsl:if test="marc:subfield[@code='b']">
304                 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
305                     <xsl:call-template name="subfieldSelect">
306                         <xsl:with-param name="codes">b</xsl:with-param>
307                     </xsl:call-template>
308                </a>
309                </xsl:if>
310                <xsl:text> </xsl:text>
311                 <xsl:call-template name="chopPunctuation">
312                   <xsl:with-param name="chopString">
313                     <xsl:call-template name="subfieldSelect">
314                         <xsl:with-param name="codes">acg</xsl:with-param>
315                     </xsl:call-template>
316                    </xsl:with-param>
317                </xsl:call-template>
318                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
319             </xsl:for-each>
320         </span>
321         </xsl:if>
322
323         <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
324         <xsl:if test="$display880">
325             <xsl:call-template name="m880Select">
326                 <xsl:with-param name="basetags">250</xsl:with-param>
327                 <xsl:with-param name="codes">ab</xsl:with-param>
328                 <xsl:with-param name="class">results_summary edition</xsl:with-param>
329                 <xsl:with-param name="label">Edition: </xsl:with-param>
330             </xsl:call-template>
331         </xsl:if>
332         
333         <xsl:if test="marc:datafield[@tag=250]">
334         <span class="results_summary edition"><span class="label">Edition: </span>
335             <xsl:for-each select="marc:datafield[@tag=250]">
336                 <xsl:call-template name="chopPunctuation">
337                   <xsl:with-param name="chopString">
338                     <xsl:call-template name="subfieldSelect">
339                         <xsl:with-param name="codes">ab</xsl:with-param>
340                     </xsl:call-template>
341                    </xsl:with-param>
342                </xsl:call-template>
343                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
344             </xsl:for-each>
345         </span>
346         </xsl:if>
347
348         <!-- Description: Alternate Graphic Representation (MARC 880) -->
349         <xsl:if test="$display880">
350             <xsl:call-template name="m880Select">
351                 <xsl:with-param name="basetags">300</xsl:with-param>
352                 <xsl:with-param name="codes">abceg</xsl:with-param>
353                 <xsl:with-param name="class">results_summary description</xsl:with-param>
354                 <xsl:with-param name="label">Description: </xsl:with-param>
355             </xsl:call-template>
356         </xsl:if>
357         
358         <xsl:if test="marc:datafield[@tag=300]">
359         <span class="results_summary description"><span class="label">Description: </span>
360             <xsl:for-each select="marc:datafield[@tag=300]">
361                 <xsl:call-template name="chopPunctuation">
362                   <xsl:with-param name="chopString">
363                     <xsl:call-template name="subfieldSelect">
364                         <xsl:with-param name="codes">abceg</xsl:with-param>
365                     </xsl:call-template>
366                    </xsl:with-param>
367                </xsl:call-template>
368                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
369             </xsl:for-each>
370         </span>
371        </xsl:if>
372
373        <xsl:if test="marc:datafield[@tag=020]">
374         <span class="results_summary isbn"><span class="label">ISBN: </span>
375         <xsl:for-each select="marc:datafield[@tag=020]">
376         <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
377                 <xsl:value-of select="marc:subfield[@code='a']"/>
378                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
379         </xsl:for-each>
380         </span>
381         </xsl:if>
382
383         <xsl:if test="marc:datafield[@tag=022]">
384         <span class="results_summary issn"><span class="label">ISSN: </span>
385         <xsl:for-each select="marc:datafield[@tag=022]">
386                 <xsl:value-of select="marc:subfield[@code='a']"/>
387                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
388         </xsl:for-each>
389         </span>
390         </xsl:if>
391
392         <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
393         <xsl:if test="$display880">
394             <xsl:call-template name="m880Select">
395                 <xsl:with-param name="basetags">246</xsl:with-param>
396                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
397                 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
398                 <xsl:with-param name="label">Other Title: </xsl:with-param>
399             </xsl:call-template>
400         </xsl:if>
401
402         <xsl:if test="marc:datafield[@tag=246]">
403         <span class="results_summary other_title"><span class="label">Other Title: </span>
404             <xsl:for-each select="marc:datafield[@tag=246]">
405                 <xsl:call-template name="chopPunctuation">
406                   <xsl:with-param name="chopString">
407                     <xsl:call-template name="subfieldSelect">
408                         <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
409                     </xsl:call-template>
410                    </xsl:with-param>
411                </xsl:call-template>
412                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
413             </xsl:for-each>
414         </span>
415        </xsl:if>
416
417         <xsl:if test="marc:datafield[@tag=242]">
418         <span class="results_summary translated_title"><span class="label">Title translated: </span>
419             <xsl:for-each select="marc:datafield[@tag=242]">
420                 <xsl:call-template name="chopPunctuation">
421                   <xsl:with-param name="chopString">
422                     <xsl:call-template name="subfieldSelect">
423                         <xsl:with-param name="codes">abchnp</xsl:with-param>
424                     </xsl:call-template>
425                    </xsl:with-param>
426                </xsl:call-template>
427                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
428             </xsl:for-each>
429         </span>
430        </xsl:if>
431
432         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
433         <xsl:if test="$display880">
434             <xsl:call-template name="m880Select">
435                 <xsl:with-param name="basetags">130,240</xsl:with-param>
436                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
437                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
438                 <xsl:with-param name="label">Uniform Title: </xsl:with-param>
439             </xsl:call-template>
440         </xsl:if>
441
442         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
443         <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
444         <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
445             <xsl:variable name="str">
446                 <xsl:for-each select="marc:subfield">
447                     <xsl:if test="(contains('adfklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))">
448                         <xsl:value-of select="text()"/>
449                         <xsl:text> </xsl:text>
450                      </xsl:if>
451                 </xsl:for-each>
452             </xsl:variable>
453             <xsl:call-template name="chopPunctuation">
454                 <xsl:with-param name="chopString">
455                     <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
456                         
457                 </xsl:with-param>
458             </xsl:call-template>
459             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
460         </xsl:for-each>
461         </span>
462         </xsl:if>
463
464         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
465             <span class="results_summary subjects"><span class="label">Subject(s): </span>
466             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
467             <a>
468             <xsl:choose>
469             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
470                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
471             </xsl:when>
472             <xsl:when test="$TraceSubjectSubdivisions='1'">
473                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
474                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
475                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
476                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
477                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
478                     </xsl:call-template>
479                 </xsl:attribute>
480             </xsl:when>
481             <xsl:otherwise>
482                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/><xsl:value-of select="marc:subfield[@code='a']"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
483             </xsl:otherwise>
484             </xsl:choose>
485             <xsl:call-template name="chopPunctuation">
486                 <xsl:with-param name="chopString">
487                     <xsl:call-template name="subfieldSelect">
488                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
489                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
490                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
491                     </xsl:call-template>
492                 </xsl:with-param>
493             </xsl:call-template>
494             </a>
495             <xsl:choose>
496             <xsl:when test="position()=last()"></xsl:when>
497             <xsl:otherwise> | </xsl:otherwise>
498             </xsl:choose>
499
500             </xsl:for-each>
501             </span>
502         </xsl:if>
503
504         <xsl:if test="marc:datafield[@tag=856]">
505         <span class="results_summary online_resources"><span class="label">Online Resources: </span>
506         <xsl:for-each select="marc:datafield[@tag=856]">
507                                    <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
508                                    <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
509                                     <xsl:choose>
510                                     <xsl:when test="($Show856uAsImage='Details' 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')">
511                                         <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>
512                                     </xsl:when>
513                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
514                                         <xsl:call-template name="subfieldSelect">
515                                         <xsl:with-param name="codes">y3z</xsl:with-param>
516                                         </xsl:call-template>
517                                     </xsl:when>
518                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
519                                         <xsl:choose>
520                                         <xsl:when test="$URLLinkText!=''">
521                                                 <xsl:value-of select="$URLLinkText"/>
522                                         </xsl:when>
523                                         <xsl:otherwise>
524                                                 <xsl:text>Click here to access online</xsl:text>
525                                         </xsl:otherwise>
526                                         </xsl:choose>
527                                     </xsl:when>
528                                     </xsl:choose>
529                                     </a>
530                                     <xsl:choose>
531                                     <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
532                                     <xsl:otherwise> | </xsl:otherwise>
533                                     </xsl:choose>
534
535         </xsl:for-each>
536         </span>
537         </xsl:if>
538         <xsl:if test="marc:datafield[@tag=505]">
539         <xsl:for-each select="marc:datafield[@tag=505]">
540         <span class="results_summary contents">
541         <xsl:choose>
542         <xsl:when test="@ind1=0">
543             <span class="label">Contents:</span>
544         </xsl:when>
545         <xsl:when test="@ind1=1">
546             <span class="label">Incomplete contents:</span>
547         </xsl:when>
548         <xsl:when test="@ind1=1">
549             <span class="label">Partial contents:</span>
550         </xsl:when>
551         </xsl:choose>  
552         <xsl:choose>
553         <xsl:when test="@ind2=0">
554             <xsl:call-template name="subfieldSelect">
555                 <xsl:with-param name="codes">tru</xsl:with-param>
556             </xsl:call-template>
557         </xsl:when>
558         <xsl:otherwise>
559             <xsl:call-template name="subfieldSelect">
560                 <xsl:with-param name="codes">au</xsl:with-param>
561             </xsl:call-template>
562         </xsl:otherwise>
563         </xsl:choose>
564         </span>
565         </xsl:for-each>
566         </xsl:if>
567
568         <!-- 773 -->
569         <xsl:if test="marc:datafield[@tag=773]">
570         <xsl:for-each select="marc:datafield[@tag=773]">
571         <xsl:if test="@ind1=0">
572         <span class="results_summary in"><span class="label">
573         <xsl:choose>
574         <xsl:when test="@ind2=' '">
575             In:
576         </xsl:when>
577         <xsl:when test="@ind2=8">
578             <xsl:if test="marc:subfield[@code='i']">
579                 <xsl:value-of select="marc:subfield[@code='i']"/>
580             </xsl:if>
581         </xsl:when>
582         </xsl:choose>
583         </span>
584                 <xsl:variable name="f773">
585                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
586                         <xsl:with-param name="codes">at</xsl:with-param>
587                     </xsl:call-template></xsl:with-param></xsl:call-template>
588                 </xsl:variable>
589             <xsl:choose>
590                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
591                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
592                         <xsl:value-of select="translate($f773, '()', '')"/>
593                     </a>
594                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
595                 </xsl:when>
596                 <xsl:when test="marc:subfield[@code='0']">
597                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
598                         <xsl:value-of select="$f773"/>
599                     </a>
600                 </xsl:when>
601                 <xsl:otherwise>
602                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
603                         <xsl:value-of select="$f773"/>
604                     </a>
605                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
606                 </xsl:otherwise>
607             </xsl:choose>
608         </span>
609
610         <xsl:if test="marc:subfield[@code='n']">
611             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
612         </xsl:if>
613
614         </xsl:if>
615         </xsl:for-each>
616         </xsl:if>
617
618         <!-- 866 textual holdings -->
619         <xsl:if test="marc:datafield[@tag=866]">
620             <span class="results_summary holdings_note"><span class="label">Holdings Note: </span>
621                 <xsl:for-each select="marc:datafield[@tag=866]">
622                     <xsl:call-template name="subfieldSelect">
623                         <xsl:with-param name="codes">axz</xsl:with-param>
624                     </xsl:call-template>
625                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
626                 </xsl:for-each>
627             </span>
628         </xsl:if>
629
630         <!--  775 Other Edition  -->
631         <xsl:if test="marc:datafield[@tag=775]">
632         <span class="results_summary other_editions"><span class="label">Other Editions: </span>
633         <xsl:for-each select="marc:datafield[@tag=775]">
634             <xsl:if test="marc:subfield[@code='i']">
635                 <xsl:call-template name="subfieldSelect">
636                     <xsl:with-param name="codes">i</xsl:with-param>
637                 </xsl:call-template>
638                 <xsl:text>: </xsl:text>
639             </xsl:if>
640             <a>
641             <xsl:choose>
642             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
643                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
644             </xsl:when>
645             <xsl:otherwise>
646                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(marc:subfield[@code='t'], '.', '')"/></xsl:attribute>
647             </xsl:otherwise>
648             </xsl:choose>
649             <xsl:call-template name="subfieldSelect">
650                 <xsl:with-param name="codes">t</xsl:with-param>
651             </xsl:call-template>
652             </a>
653             <xsl:choose>
654                 <xsl:when test="position()=last()"></xsl:when>
655                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
656             </xsl:choose>
657         </xsl:for-each>
658         </span>
659         </xsl:if>
660
661         <!-- 780 -->
662         <xsl:if test="marc:datafield[@tag=780]">
663         <xsl:for-each select="marc:datafield[@tag=780]">
664         <xsl:if test="@ind1=0">
665         <span class="results_summary preceeding_entry">
666         <xsl:choose>
667         <xsl:when test="@ind2=0">
668             <span class="label">Continues:</span>
669         </xsl:when>
670         <xsl:when test="@ind2=1">
671             <span class="label">Continues in part:</span>
672         </xsl:when>
673         <xsl:when test="@ind2=2">
674             <span class="label">Supersedes:</span>
675         </xsl:when>
676         <xsl:when test="@ind2=3">
677             <span class="label">Supersedes in part:</span>
678         </xsl:when>
679         <xsl:when test="@ind2=4">
680             <span class="label">Formed by the union: ... and: ...</span>
681         </xsl:when>
682         <xsl:when test="@ind2=5">
683             <span class="label">Absorbed:</span>
684         </xsl:when>
685         <xsl:when test="@ind2=6">
686             <span class="label">Absorbed in part:</span>
687         </xsl:when>
688         <xsl:when test="@ind2=7">
689             <span class="label">Separated from:</span>
690         </xsl:when>
691         </xsl:choose>
692                 <xsl:variable name="f780">
693                     <xsl:call-template name="subfieldSelect">
694                         <xsl:with-param name="codes">at</xsl:with-param>
695                     </xsl:call-template>
696                 </xsl:variable>
697             <xsl:choose>
698                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
699                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
700                         <xsl:value-of select="translate($f780, '()', '')"/>
701                     </a>
702                 </xsl:when>
703                 <xsl:otherwise>
704                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
705                         <xsl:value-of select="translate($f780, '()', '')"/>
706                     </a>
707                 </xsl:otherwise>
708             </xsl:choose>
709         </span>
710  
711         <xsl:if test="marc:subfield[@code='n']">
712             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
713         </xsl:if>
714
715         </xsl:if>
716         </xsl:for-each>
717         </xsl:if>
718
719         <!-- 785 -->
720         <xsl:if test="marc:datafield[@tag=785]">
721         <xsl:for-each select="marc:datafield[@tag=785]">
722         <span class="results_summary succeeding_entry">
723         <xsl:choose>
724         <xsl:when test="@ind2=0">
725             <span class="label">Continued by:</span>
726         </xsl:when>
727         <xsl:when test="@ind2=1">
728             <span class="label">Continued in part by:</span>
729         </xsl:when>
730         <xsl:when test="@ind2=2">
731             <span class="label">Superseded by:</span>
732         </xsl:when>
733         <xsl:when test="@ind2=3">
734             <span class="label">Superseded in part by:</span>
735         </xsl:when>
736         <xsl:when test="@ind2=4">
737             <span class="label">Absorbed by:</span>
738         </xsl:when>
739         <xsl:when test="@ind2=5">
740             <span class="label">Absorbed in part by:</span>
741         </xsl:when>
742         <xsl:when test="@ind2=6">
743             <span class="label">Split into .. and ...:</span>
744         </xsl:when>
745         <xsl:when test="@ind2=7">
746             <span class="label">Merged with ... to form ...</span>
747         </xsl:when>
748         <xsl:when test="@ind2=8">
749             <span class="label">Changed back to:</span>
750         </xsl:when>
751
752         </xsl:choose>
753                    <xsl:variable name="f785">
754                     <xsl:call-template name="subfieldSelect">
755                         <xsl:with-param name="codes">at</xsl:with-param>
756                     </xsl:call-template>
757                 </xsl:variable>
758
759             <xsl:choose>
760                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
761                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
762                         <xsl:value-of select="translate($f785, '()', '')"/>
763                     </a>
764                 </xsl:when>
765                 <xsl:otherwise>
766                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
767                         <xsl:value-of select="translate($f785, '()', '')"/>
768                     </a>
769                 </xsl:otherwise>
770             </xsl:choose>
771
772         </span>
773         </xsl:for-each>
774         </xsl:if>
775
776         <xsl:if test="$OPACBaseURL!=''">
777         <span class="results_summary"><span class="label">OPAC view: </span>
778             <a><xsl:attribute name="href">http://<xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
779         </span>
780         </xsl:if>
781
782     </xsl:template>
783
784     <xsl:template name="nameABCDQ">
785             <xsl:call-template name="chopPunctuation">
786                 <xsl:with-param name="chopString">
787                     <xsl:call-template name="subfieldSelect">
788                         <xsl:with-param name="codes">aq</xsl:with-param>
789                     </xsl:call-template>
790                 </xsl:with-param>
791                 <xsl:with-param name="punctuation">
792                     <xsl:text>:,;/ </xsl:text>
793                 </xsl:with-param>
794             </xsl:call-template>
795         <xsl:call-template name="termsOfAddress"/>
796     </xsl:template>
797
798     <xsl:template name="nameABCDN">
799         <xsl:for-each select="marc:subfield[@code='a']">
800                 <xsl:call-template name="chopPunctuation">
801                     <xsl:with-param name="chopString" select="."/>
802                 </xsl:call-template>
803         </xsl:for-each>
804         <xsl:for-each select="marc:subfield[@code='b']">
805             <xsl:value-of select="."/>
806             <xsl:choose>
807                 <xsl:when test="position() != last()">
808                     <xsl:text> -- </xsl:text>
809                 </xsl:when>
810             </xsl:choose>
811         </xsl:for-each>
812         <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
813                 <xsl:call-template name="subfieldSelect">
814                     <xsl:with-param name="codes">cdn</xsl:with-param>
815                 </xsl:call-template>
816         </xsl:if>
817     </xsl:template>
818
819     <xsl:template name="nameACDEQ">
820             <xsl:call-template name="subfieldSelect">
821                 <xsl:with-param name="codes">acdeq</xsl:with-param>
822             </xsl:call-template>
823     </xsl:template>
824     <xsl:template name="termsOfAddress">
825         <xsl:if test="marc:subfield[@code='b' or @code='c']">
826             <xsl:call-template name="chopPunctuation">
827                 <xsl:with-param name="chopString">
828                     <xsl:call-template name="subfieldSelect">
829                         <xsl:with-param name="codes">bc</xsl:with-param>
830                     </xsl:call-template>
831                 </xsl:with-param>
832             </xsl:call-template>
833         </xsl:if>
834     </xsl:template>
835
836     <xsl:template name="part">
837         <xsl:variable name="partNumber">
838             <xsl:call-template name="specialSubfieldSelect">
839                 <xsl:with-param name="axis">n</xsl:with-param>
840                 <xsl:with-param name="anyCodes">n</xsl:with-param>
841                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
842             </xsl:call-template>
843         </xsl:variable>
844         <xsl:variable name="partName">
845             <xsl:call-template name="specialSubfieldSelect">
846                 <xsl:with-param name="axis">p</xsl:with-param>
847                 <xsl:with-param name="anyCodes">p</xsl:with-param>
848                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
849             </xsl:call-template>
850         </xsl:variable>
851         <xsl:if test="string-length(normalize-space($partNumber))">
852                 <xsl:call-template name="chopPunctuation">
853                     <xsl:with-param name="chopString" select="$partNumber"/>
854                 </xsl:call-template>
855         </xsl:if>
856         <xsl:if test="string-length(normalize-space($partName))">
857                 <xsl:call-template name="chopPunctuation">
858                     <xsl:with-param name="chopString" select="$partName"/>
859                 </xsl:call-template>
860         </xsl:if>
861     </xsl:template>
862
863     <xsl:template name="specialSubfieldSelect">
864         <xsl:param name="anyCodes"/>
865         <xsl:param name="axis"/>
866         <xsl:param name="beforeCodes"/>
867         <xsl:param name="afterCodes"/>
868         <xsl:variable name="str">
869             <xsl:for-each select="marc:subfield">
870                 <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])">
871                     <xsl:value-of select="text()"/>
872                     <xsl:text> </xsl:text>
873                 </xsl:if>
874             </xsl:for-each>
875         </xsl:variable>
876         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
877     </xsl:template>
878
879     <xsl:template name="showAuthor">
880         <xsl:param name="authorfield"/>
881     <xsl:param name="UseAuthoritiesForTracings"/>
882         <xsl:if test="count($authorfield)&gt;0">
883         <h5 class="author">
884         <xsl:for-each select="$authorfield">
885         <xsl:choose>
886           <xsl:when test="position()&gt;1"/>
887           <xsl:when test="@tag&lt;700">Author(s): </xsl:when>
888           <xsl:otherwise>Additional author(s): </xsl:otherwise>
889         </xsl:choose>
890         <a>
891         <xsl:choose>
892             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
893                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
894             </xsl:when>
895             <xsl:otherwise>
896             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
897             </xsl:otherwise>
898         </xsl:choose>
899         <xsl:choose>
900           <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when>
901           <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
902           <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
903         </xsl:choose>
904         <!-- add relator code too between brackets-->
905         <xsl:if test="marc:subfield[@code='4' or @code='e']">
906           <xsl:text>[</xsl:text>
907           <xsl:choose>
908             <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
909             <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
910           </xsl:choose>
911           <xsl:text>]</xsl:text>
912         </xsl:if>
913         </a>
914         <xsl:choose>
915           <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
916         </xsl:choose>
917         </xsl:for-each>
918         </h5>
919         </xsl:if>
920     </xsl:template>
921
922 </xsl:stylesheet>