Merge remote-tracking branch 'origin/new/bug_7178'
[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='a']">
304                     <xsl:call-template name="subfieldSelect">
305                         <xsl:with-param name="codes">a</xsl:with-param>
306                     </xsl:call-template>
307                 </xsl:if>
308                 <xsl:text> </xsl:text>
309                 <xsl:if test="marc:subfield[@code='b']">
310                 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
311                     <xsl:call-template name="subfieldSelect">
312                         <xsl:with-param name="codes">b</xsl:with-param>
313                     </xsl:call-template>
314                </a>
315                </xsl:if>
316                <xsl:text> </xsl:text>
317                 <xsl:call-template name="chopPunctuation">
318                   <xsl:with-param name="chopString">
319                     <xsl:call-template name="subfieldSelect">
320                         <xsl:with-param name="codes">cg</xsl:with-param>
321                     </xsl:call-template>
322                    </xsl:with-param>
323                </xsl:call-template>
324                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
325             </xsl:for-each>
326         </span>
327         </xsl:if>
328
329         <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
330         <xsl:if test="$display880">
331             <xsl:call-template name="m880Select">
332                 <xsl:with-param name="basetags">250</xsl:with-param>
333                 <xsl:with-param name="codes">ab</xsl:with-param>
334                 <xsl:with-param name="class">results_summary edition</xsl:with-param>
335                 <xsl:with-param name="label">Edition: </xsl:with-param>
336             </xsl:call-template>
337         </xsl:if>
338         
339         <xsl:if test="marc:datafield[@tag=250]">
340         <span class="results_summary edition"><span class="label">Edition: </span>
341             <xsl:for-each select="marc:datafield[@tag=250]">
342                 <xsl:call-template name="chopPunctuation">
343                   <xsl:with-param name="chopString">
344                     <xsl:call-template name="subfieldSelect">
345                         <xsl:with-param name="codes">ab</xsl:with-param>
346                     </xsl:call-template>
347                    </xsl:with-param>
348                </xsl:call-template>
349                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
350             </xsl:for-each>
351         </span>
352         </xsl:if>
353
354         <!-- Description: Alternate Graphic Representation (MARC 880) -->
355         <xsl:if test="$display880">
356             <xsl:call-template name="m880Select">
357                 <xsl:with-param name="basetags">300</xsl:with-param>
358                 <xsl:with-param name="codes">abceg</xsl:with-param>
359                 <xsl:with-param name="class">results_summary description</xsl:with-param>
360                 <xsl:with-param name="label">Description: </xsl:with-param>
361             </xsl:call-template>
362         </xsl:if>
363         
364         <xsl:if test="marc:datafield[@tag=300]">
365         <span class="results_summary description"><span class="label">Description: </span>
366             <xsl:for-each select="marc:datafield[@tag=300]">
367                 <xsl:call-template name="chopPunctuation">
368                   <xsl:with-param name="chopString">
369                     <xsl:call-template name="subfieldSelect">
370                         <xsl:with-param name="codes">abceg</xsl:with-param>
371                     </xsl:call-template>
372                    </xsl:with-param>
373                </xsl:call-template>
374                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
375             </xsl:for-each>
376         </span>
377        </xsl:if>
378
379        <xsl:if test="marc:datafield[@tag=020]">
380         <span class="results_summary isbn"><span class="label">ISBN: </span>
381         <xsl:for-each select="marc:datafield[@tag=020]">
382         <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
383                 <xsl:value-of select="marc:subfield[@code='a']"/>
384                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
385         </xsl:for-each>
386         </span>
387         </xsl:if>
388
389         <xsl:if test="marc:datafield[@tag=022]">
390         <span class="results_summary issn"><span class="label">ISSN: </span>
391         <xsl:for-each select="marc:datafield[@tag=022]">
392                 <xsl:value-of select="marc:subfield[@code='a']"/>
393                 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
394         </xsl:for-each>
395         </span>
396         </xsl:if>
397
398         <!-- Other Title  Statement: Alternate Graphic Representation (MARC 880) -->
399         <xsl:if test="$display880">
400             <xsl:call-template name="m880Select">
401                 <xsl:with-param name="basetags">246</xsl:with-param>
402                 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
403                 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
404                 <xsl:with-param name="label">Other Title: </xsl:with-param>
405             </xsl:call-template>
406         </xsl:if>
407
408         <xsl:if test="marc:datafield[@tag=246]">
409         <span class="results_summary other_title"><span class="label">Other Title: </span>
410             <xsl:for-each select="marc:datafield[@tag=246]">
411                 <xsl:call-template name="chopPunctuation">
412                   <xsl:with-param name="chopString">
413                     <xsl:call-template name="subfieldSelect">
414                         <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
415                     </xsl:call-template>
416                    </xsl:with-param>
417                </xsl:call-template>
418                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
419             </xsl:for-each>
420         </span>
421        </xsl:if>
422
423         <xsl:if test="marc:datafield[@tag=242]">
424         <span class="results_summary translated_title"><span class="label">Title translated: </span>
425             <xsl:for-each select="marc:datafield[@tag=242]">
426                 <xsl:call-template name="chopPunctuation">
427                   <xsl:with-param name="chopString">
428                     <xsl:call-template name="subfieldSelect">
429                         <xsl:with-param name="codes">abchnp</xsl:with-param>
430                     </xsl:call-template>
431                    </xsl:with-param>
432                </xsl:call-template>
433                     <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
434             </xsl:for-each>
435         </span>
436        </xsl:if>
437
438         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
439         <xsl:if test="$display880">
440             <xsl:call-template name="m880Select">
441                 <xsl:with-param name="basetags">130,240</xsl:with-param>
442                 <xsl:with-param name="codes">adfklmor</xsl:with-param>
443                 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
444                 <xsl:with-param name="label">Uniform Title: </xsl:with-param>
445             </xsl:call-template>
446         </xsl:if>
447
448         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
449         <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
450         <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
451             <xsl:variable name="str">
452                 <xsl:for-each select="marc:subfield">
453                     <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'])))">
454                         <xsl:value-of select="text()"/>
455                         <xsl:text> </xsl:text>
456                      </xsl:if>
457                 </xsl:for-each>
458             </xsl:variable>
459             <xsl:call-template name="chopPunctuation">
460                 <xsl:with-param name="chopString">
461                     <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
462                         
463                 </xsl:with-param>
464             </xsl:call-template>
465             <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
466         </xsl:for-each>
467         </span>
468         </xsl:if>
469
470         <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
471             <span class="results_summary subjects"><span class="label">Subject(s): </span>
472             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
473             <a>
474             <xsl:choose>
475             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
476                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
477             </xsl:when>
478             <xsl:when test="$TraceSubjectSubdivisions='1'">
479                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
480                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
481                         <xsl:with-param name="delimeter"> AND </xsl:with-param>
482                         <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
483                         <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
484                     </xsl:call-template>
485                 </xsl:attribute>
486             </xsl:when>
487             <xsl:otherwise>
488                <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>
489             </xsl:otherwise>
490             </xsl:choose>
491             <xsl:call-template name="chopPunctuation">
492                 <xsl:with-param name="chopString">
493                     <xsl:call-template name="subfieldSelect">
494                         <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
495                         <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
496                         <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
497                     </xsl:call-template>
498                 </xsl:with-param>
499             </xsl:call-template>
500             </a>
501             <xsl:choose>
502             <xsl:when test="position()=last()"></xsl:when>
503             <xsl:otherwise> | </xsl:otherwise>
504             </xsl:choose>
505
506             </xsl:for-each>
507             </span>
508         </xsl:if>
509
510         <xsl:if test="marc:datafield[@tag=856]">
511         <span class="results_summary online_resources"><span class="label">Online Resources: </span>
512         <xsl:for-each select="marc:datafield[@tag=856]">
513                                    <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
514                                    <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
515                                     <xsl:choose>
516                                     <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')">
517                                         <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>
518                                     </xsl:when>
519                                     <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
520                                         <xsl:call-template name="subfieldSelect">
521                                         <xsl:with-param name="codes">y3z</xsl:with-param>
522                                         </xsl:call-template>
523                                     </xsl:when>
524                                     <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
525                                         <xsl:choose>
526                                         <xsl:when test="$URLLinkText!=''">
527                                                 <xsl:value-of select="$URLLinkText"/>
528                                         </xsl:when>
529                                         <xsl:otherwise>
530                                                 <xsl:text>Click here to access online</xsl:text>
531                                         </xsl:otherwise>
532                                         </xsl:choose>
533                                     </xsl:when>
534                                     </xsl:choose>
535                                     </a>
536                                     <xsl:choose>
537                                     <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
538                                     <xsl:otherwise> | </xsl:otherwise>
539                                     </xsl:choose>
540
541         </xsl:for-each>
542         </span>
543         </xsl:if>
544         <xsl:if test="marc:datafield[@tag=505]">
545         <xsl:for-each select="marc:datafield[@tag=505]">
546         <span class="results_summary contents">
547         <xsl:choose>
548         <xsl:when test="@ind1=0">
549             <span class="label">Contents:</span>
550         </xsl:when>
551         <xsl:when test="@ind1=1">
552             <span class="label">Incomplete contents:</span>
553         </xsl:when>
554         <xsl:when test="@ind1=1">
555             <span class="label">Partial contents:</span>
556         </xsl:when>
557         </xsl:choose>  
558         <xsl:choose>
559         <xsl:when test="@ind2=0">
560             <xsl:call-template name="subfieldSelect">
561                 <xsl:with-param name="codes">tru</xsl:with-param>
562             </xsl:call-template>
563         </xsl:when>
564         <xsl:otherwise>
565             <xsl:call-template name="subfieldSelect">
566                 <xsl:with-param name="codes">au</xsl:with-param>
567             </xsl:call-template>
568         </xsl:otherwise>
569         </xsl:choose>
570         </span>
571         </xsl:for-each>
572         </xsl:if>
573
574         <!-- 773 -->
575         <xsl:if test="marc:datafield[@tag=773]">
576         <xsl:for-each select="marc:datafield[@tag=773]">
577         <xsl:if test="@ind1=0">
578         <span class="results_summary in"><span class="label">
579         <xsl:choose>
580         <xsl:when test="@ind2=' '">
581             In:
582         </xsl:when>
583         <xsl:when test="@ind2=8">
584             <xsl:if test="marc:subfield[@code='i']">
585                 <xsl:value-of select="marc:subfield[@code='i']"/>
586             </xsl:if>
587         </xsl:when>
588         </xsl:choose>
589         </span>
590                 <xsl:variable name="f773">
591                     <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
592                         <xsl:with-param name="codes">at</xsl:with-param>
593                     </xsl:call-template></xsl:with-param></xsl:call-template>
594                 </xsl:variable>
595             <xsl:choose>
596                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
597                     <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>
598                         <xsl:value-of select="translate($f773, '()', '')"/>
599                     </a>
600                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
601                 </xsl:when>
602                 <xsl:when test="marc:subfield[@code='0']">
603                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
604                         <xsl:value-of select="$f773"/>
605                     </a>
606                 </xsl:when>
607                 <xsl:otherwise>
608                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
609                         <xsl:value-of select="$f773"/>
610                     </a>
611                     <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
612                 </xsl:otherwise>
613             </xsl:choose>
614         </span>
615
616         <xsl:if test="marc:subfield[@code='n']">
617             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
618         </xsl:if>
619
620         </xsl:if>
621         </xsl:for-each>
622         </xsl:if>
623
624         <!-- 866 textual holdings -->
625         <xsl:if test="marc:datafield[@tag=866]">
626             <span class="results_summary holdings_note"><span class="label">Holdings Note: </span>
627                 <xsl:for-each select="marc:datafield[@tag=866]">
628                     <xsl:call-template name="subfieldSelect">
629                         <xsl:with-param name="codes">axz</xsl:with-param>
630                     </xsl:call-template>
631                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
632                 </xsl:for-each>
633             </span>
634         </xsl:if>
635
636         <!--  775 Other Edition  -->
637         <xsl:if test="marc:datafield[@tag=775]">
638         <span class="results_summary other_editions"><span class="label">Other Editions: </span>
639         <xsl:for-each select="marc:datafield[@tag=775]">
640             <xsl:if test="marc:subfield[@code='i']">
641                 <xsl:call-template name="subfieldSelect">
642                     <xsl:with-param name="codes">i</xsl:with-param>
643                 </xsl:call-template>
644                 <xsl:text>: </xsl:text>
645             </xsl:if>
646             <a>
647             <xsl:choose>
648             <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
649                 <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>
650             </xsl:when>
651             <xsl:otherwise>
652                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate(marc:subfield[@code='t'], '.', '')"/></xsl:attribute>
653             </xsl:otherwise>
654             </xsl:choose>
655             <xsl:call-template name="subfieldSelect">
656                 <xsl:with-param name="codes">t</xsl:with-param>
657             </xsl:call-template>
658             </a>
659             <xsl:choose>
660                 <xsl:when test="position()=last()"></xsl:when>
661                 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
662             </xsl:choose>
663         </xsl:for-each>
664         </span>
665         </xsl:if>
666
667         <!-- 780 -->
668         <xsl:if test="marc:datafield[@tag=780]">
669         <xsl:for-each select="marc:datafield[@tag=780]">
670         <xsl:if test="@ind1=0">
671         <span class="results_summary preceeding_entry">
672         <xsl:choose>
673         <xsl:when test="@ind2=0">
674             <span class="label">Continues:</span>
675         </xsl:when>
676         <xsl:when test="@ind2=1">
677             <span class="label">Continues in part:</span>
678         </xsl:when>
679         <xsl:when test="@ind2=2">
680             <span class="label">Supersedes:</span>
681         </xsl:when>
682         <xsl:when test="@ind2=3">
683             <span class="label">Supersedes in part:</span>
684         </xsl:when>
685         <xsl:when test="@ind2=4">
686             <span class="label">Formed by the union: ... and: ...</span>
687         </xsl:when>
688         <xsl:when test="@ind2=5">
689             <span class="label">Absorbed:</span>
690         </xsl:when>
691         <xsl:when test="@ind2=6">
692             <span class="label">Absorbed in part:</span>
693         </xsl:when>
694         <xsl:when test="@ind2=7">
695             <span class="label">Separated from:</span>
696         </xsl:when>
697         </xsl:choose>
698                 <xsl:variable name="f780">
699                     <xsl:call-template name="subfieldSelect">
700                         <xsl:with-param name="codes">at</xsl:with-param>
701                     </xsl:call-template>
702                 </xsl:variable>
703             <xsl:choose>
704                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
705                     <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>
706                         <xsl:value-of select="translate($f780, '()', '')"/>
707                     </a>
708                 </xsl:when>
709                 <xsl:otherwise>
710                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
711                         <xsl:value-of select="translate($f780, '()', '')"/>
712                     </a>
713                 </xsl:otherwise>
714             </xsl:choose>
715         </span>
716  
717         <xsl:if test="marc:subfield[@code='n']">
718             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
719         </xsl:if>
720
721         </xsl:if>
722         </xsl:for-each>
723         </xsl:if>
724
725         <!-- 785 -->
726         <xsl:if test="marc:datafield[@tag=785]">
727         <xsl:for-each select="marc:datafield[@tag=785]">
728         <span class="results_summary succeeding_entry">
729         <xsl:choose>
730         <xsl:when test="@ind2=0">
731             <span class="label">Continued by:</span>
732         </xsl:when>
733         <xsl:when test="@ind2=1">
734             <span class="label">Continued in part by:</span>
735         </xsl:when>
736         <xsl:when test="@ind2=2">
737             <span class="label">Superseded by:</span>
738         </xsl:when>
739         <xsl:when test="@ind2=3">
740             <span class="label">Superseded in part by:</span>
741         </xsl:when>
742         <xsl:when test="@ind2=4">
743             <span class="label">Absorbed by:</span>
744         </xsl:when>
745         <xsl:when test="@ind2=5">
746             <span class="label">Absorbed in part by:</span>
747         </xsl:when>
748         <xsl:when test="@ind2=6">
749             <span class="label">Split into .. and ...:</span>
750         </xsl:when>
751         <xsl:when test="@ind2=7">
752             <span class="label">Merged with ... to form ...</span>
753         </xsl:when>
754         <xsl:when test="@ind2=8">
755             <span class="label">Changed back to:</span>
756         </xsl:when>
757
758         </xsl:choose>
759                    <xsl:variable name="f785">
760                     <xsl:call-template name="subfieldSelect">
761                         <xsl:with-param name="codes">at</xsl:with-param>
762                     </xsl:call-template>
763                 </xsl:variable>
764
765             <xsl:choose>
766                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
767                     <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>
768                         <xsl:value-of select="translate($f785, '()', '')"/>
769                     </a>
770                 </xsl:when>
771                 <xsl:otherwise>
772                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
773                         <xsl:value-of select="translate($f785, '()', '')"/>
774                     </a>
775                 </xsl:otherwise>
776             </xsl:choose>
777
778         </span>
779         </xsl:for-each>
780         </xsl:if>
781
782         <xsl:if test="$OPACBaseURL!=''">
783         <span class="results_summary"><span class="label">OPAC view: </span>
784             <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>.
785         </span>
786         </xsl:if>
787
788     </xsl:template>
789
790     <xsl:template name="nameABCDQ">
791             <xsl:call-template name="chopPunctuation">
792                 <xsl:with-param name="chopString">
793                     <xsl:call-template name="subfieldSelect">
794                         <xsl:with-param name="codes">aq</xsl:with-param>
795                     </xsl:call-template>
796                 </xsl:with-param>
797                 <xsl:with-param name="punctuation">
798                     <xsl:text>:,;/ </xsl:text>
799                 </xsl:with-param>
800             </xsl:call-template>
801         <xsl:call-template name="termsOfAddress"/>
802     </xsl:template>
803
804     <xsl:template name="nameABCDN">
805         <xsl:for-each select="marc:subfield[@code='a']">
806                 <xsl:call-template name="chopPunctuation">
807                     <xsl:with-param name="chopString" select="."/>
808                 </xsl:call-template>
809         </xsl:for-each>
810         <xsl:for-each select="marc:subfield[@code='b']">
811             <xsl:value-of select="."/>
812             <xsl:choose>
813                 <xsl:when test="position() != last()">
814                     <xsl:text> -- </xsl:text>
815                 </xsl:when>
816             </xsl:choose>
817         </xsl:for-each>
818         <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
819                 <xsl:call-template name="subfieldSelect">
820                     <xsl:with-param name="codes">cdn</xsl:with-param>
821                 </xsl:call-template>
822         </xsl:if>
823     </xsl:template>
824
825     <xsl:template name="nameACDEQ">
826             <xsl:call-template name="subfieldSelect">
827                 <xsl:with-param name="codes">acdeq</xsl:with-param>
828             </xsl:call-template>
829     </xsl:template>
830     <xsl:template name="termsOfAddress">
831         <xsl:if test="marc:subfield[@code='b' or @code='c']">
832             <xsl:call-template name="chopPunctuation">
833                 <xsl:with-param name="chopString">
834                     <xsl:call-template name="subfieldSelect">
835                         <xsl:with-param name="codes">bc</xsl:with-param>
836                     </xsl:call-template>
837                 </xsl:with-param>
838             </xsl:call-template>
839         </xsl:if>
840     </xsl:template>
841
842     <xsl:template name="part">
843         <xsl:variable name="partNumber">
844             <xsl:call-template name="specialSubfieldSelect">
845                 <xsl:with-param name="axis">n</xsl:with-param>
846                 <xsl:with-param name="anyCodes">n</xsl:with-param>
847                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
848             </xsl:call-template>
849         </xsl:variable>
850         <xsl:variable name="partName">
851             <xsl:call-template name="specialSubfieldSelect">
852                 <xsl:with-param name="axis">p</xsl:with-param>
853                 <xsl:with-param name="anyCodes">p</xsl:with-param>
854                 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
855             </xsl:call-template>
856         </xsl:variable>
857         <xsl:if test="string-length(normalize-space($partNumber))">
858                 <xsl:call-template name="chopPunctuation">
859                     <xsl:with-param name="chopString" select="$partNumber"/>
860                 </xsl:call-template>
861         </xsl:if>
862         <xsl:if test="string-length(normalize-space($partName))">
863                 <xsl:call-template name="chopPunctuation">
864                     <xsl:with-param name="chopString" select="$partName"/>
865                 </xsl:call-template>
866         </xsl:if>
867     </xsl:template>
868
869     <xsl:template name="specialSubfieldSelect">
870         <xsl:param name="anyCodes"/>
871         <xsl:param name="axis"/>
872         <xsl:param name="beforeCodes"/>
873         <xsl:param name="afterCodes"/>
874         <xsl:variable name="str">
875             <xsl:for-each select="marc:subfield">
876                 <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])">
877                     <xsl:value-of select="text()"/>
878                     <xsl:text> </xsl:text>
879                 </xsl:if>
880             </xsl:for-each>
881         </xsl:variable>
882         <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
883     </xsl:template>
884
885     <xsl:template name="showAuthor">
886         <xsl:param name="authorfield"/>
887     <xsl:param name="UseAuthoritiesForTracings"/>
888         <xsl:if test="count($authorfield)&gt;0">
889         <h5 class="author">
890         <xsl:for-each select="$authorfield">
891         <xsl:choose>
892           <xsl:when test="position()&gt;1"/>
893           <xsl:when test="@tag&lt;700">Author(s): </xsl:when>
894           <xsl:otherwise>Additional author(s): </xsl:otherwise>
895         </xsl:choose>
896         <a>
897         <xsl:choose>
898             <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
899                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
900             </xsl:when>
901             <xsl:otherwise>
902             <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
903             </xsl:otherwise>
904         </xsl:choose>
905         <xsl:choose>
906           <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when>
907           <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
908           <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
909         </xsl:choose>
910         <!-- add relator code too between brackets-->
911         <xsl:if test="marc:subfield[@code='4' or @code='e']">
912           <xsl:text>[</xsl:text>
913           <xsl:choose>
914             <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
915             <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
916           </xsl:choose>
917           <xsl:text>]</xsl:text>
918         </xsl:if>
919         </a>
920         <xsl:choose>
921           <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
922         </xsl:choose>
923         </xsl:for-each>
924         </h5>
925         </xsl:if>
926     </xsl:template>
927
928 </xsl:stylesheet>