1 <?xml version="1.0" encoding="UTF-8"?>
3 <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
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/>
17 <xsl:template match="marc:record">
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">
30 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
31 <xsl:otherwise>"</xsl:otherwise>
34 <xsl:variable name="TracingQuotesRight">
36 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
37 <xsl:otherwise>"</xsl:otherwise>
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">
47 <xsl:when test="$leader19='a'">ST</xsl:when>
48 <xsl:when test="$leader6='a'">
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>
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>
64 <xsl:variable name="materialTypeLabel">
66 <xsl:when test="$leader19='a'">Set</xsl:when>
67 <xsl:when test="$leader6='a'">
69 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
70 <xsl:when test="$leader7='i' or $leader7='s'">
72 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
73 <xsl:otherwise>Series</xsl:otherwise>
76 <xsl:when test="$leader7='a' or $leader7='b'">Article</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>
91 <!-- Title Statement -->
92 <!-- Alternate Graphic Representation (MARC 880) -->
93 <xsl:if test="$display880">
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>
102 <xsl:if test="marc:datafield[@tag=245]">
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>
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>
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>
120 <xsl:text> </xsl:text>
121 <xsl:call-template name="subfieldSelect">
122 <xsl:with-param name="codes">fgknps</xsl:with-param>
128 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
129 <xsl:if test="$display880">
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 -->
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>
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"/>
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>
165 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
166 <span class="results_summary series"><span class="label">Series: </span>
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>
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>
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>
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>
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]">
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>
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>
221 <xsl:call-template name="part"/>
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>
234 <xsl:if test="$leader7='s'">
235 <span class="results_summary analytics"><span class="label">Analytics: </span>
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>
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>
245 <xsl:text>Show analytics</xsl:text>
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>
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>
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>
262 <xsl:text>Show volumes</xsl:text>
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]">
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>
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>
280 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
283 <xsl:when test="position()=last()"></xsl:when>
284 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
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>
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>
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>
318 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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>
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>
343 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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>
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>
368 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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>
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>
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>
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>
412 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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>
427 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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>
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>
453 <xsl:call-template name="chopPunctuation">
454 <xsl:with-param name="chopString">
455 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
459 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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']">
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>
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>
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>
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>
496 <xsl:when test="position()=last()"></xsl:when>
497 <xsl:otherwise> | </xsl:otherwise>
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>
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>
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>
518 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
520 <xsl:when test="$URLLinkText!=''">
521 <xsl:value-of select="$URLLinkText"/>
524 <xsl:text>Click here to access online</xsl:text>
531 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
532 <xsl:otherwise> | </xsl:otherwise>
538 <xsl:if test="marc:datafield[@tag=505]">
539 <xsl:for-each select="marc:datafield[@tag=505]">
540 <span class="results_summary contents">
542 <xsl:when test="@ind1=0">
543 <span class="label">Contents:</span>
545 <xsl:when test="@ind1=1">
546 <span class="label">Incomplete contents:</span>
548 <xsl:when test="@ind1=1">
549 <span class="label">Partial contents:</span>
553 <xsl:when test="@ind2=0">
554 <xsl:call-template name="subfieldSelect">
555 <xsl:with-param name="codes">tru</xsl:with-param>
559 <xsl:call-template name="subfieldSelect">
560 <xsl:with-param name="codes">au</xsl:with-param>
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">
574 <xsl:when test="@ind2=' '">
577 <xsl:when test="@ind2=8">
578 <xsl:if test="marc:subfield[@code='i']">
579 <xsl:value-of select="marc:subfield[@code='i']"/>
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>
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, '()', '')"/>
594 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
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"/>
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"/>
605 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
610 <xsl:if test="marc:subfield[@code='n']">
611 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
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>
625 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
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>
638 <xsl:text>: </xsl:text>
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>
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>
649 <xsl:call-template name="subfieldSelect">
650 <xsl:with-param name="codes">t</xsl:with-param>
654 <xsl:when test="position()=last()"></xsl:when>
655 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
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">
667 <xsl:when test="@ind2=0">
668 <span class="label">Continues:</span>
670 <xsl:when test="@ind2=1">
671 <span class="label">Continues in part:</span>
673 <xsl:when test="@ind2=2">
674 <span class="label">Supersedes:</span>
676 <xsl:when test="@ind2=3">
677 <span class="label">Supersedes in part:</span>
679 <xsl:when test="@ind2=4">
680 <span class="label">Formed by the union: ... and: ...</span>
682 <xsl:when test="@ind2=5">
683 <span class="label">Absorbed:</span>
685 <xsl:when test="@ind2=6">
686 <span class="label">Absorbed in part:</span>
688 <xsl:when test="@ind2=7">
689 <span class="label">Separated from:</span>
692 <xsl:variable name="f780">
693 <xsl:call-template name="subfieldSelect">
694 <xsl:with-param name="codes">at</xsl:with-param>
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, '()', '')"/>
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, '()', '')"/>
711 <xsl:if test="marc:subfield[@code='n']">
712 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
720 <xsl:if test="marc:datafield[@tag=785]">
721 <xsl:for-each select="marc:datafield[@tag=785]">
722 <span class="results_summary succeeding_entry">
724 <xsl:when test="@ind2=0">
725 <span class="label">Continued by:</span>
727 <xsl:when test="@ind2=1">
728 <span class="label">Continued in part by:</span>
730 <xsl:when test="@ind2=2">
731 <span class="label">Superseded by:</span>
733 <xsl:when test="@ind2=3">
734 <span class="label">Superseded in part by:</span>
736 <xsl:when test="@ind2=4">
737 <span class="label">Absorbed by:</span>
739 <xsl:when test="@ind2=5">
740 <span class="label">Absorbed in part by:</span>
742 <xsl:when test="@ind2=6">
743 <span class="label">Split into .. and ...:</span>
745 <xsl:when test="@ind2=7">
746 <span class="label">Merged with ... to form ...</span>
748 <xsl:when test="@ind2=8">
749 <span class="label">Changed back to:</span>
753 <xsl:variable name="f785">
754 <xsl:call-template name="subfieldSelect">
755 <xsl:with-param name="codes">at</xsl:with-param>
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, '()', '')"/>
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, '()', '')"/>
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>.
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>
791 <xsl:with-param name="punctuation">
792 <xsl:text>:,;/ </xsl:text>
795 <xsl:call-template name="termsOfAddress"/>
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="."/>
804 <xsl:for-each select="marc:subfield[@code='b']">
805 <xsl:value-of select="."/>
807 <xsl:when test="position() != last()">
808 <xsl:text> -- </xsl:text>
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>
819 <xsl:template name="nameACDEQ">
820 <xsl:call-template name="subfieldSelect">
821 <xsl:with-param name="codes">acdeq</xsl:with-param>
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>
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>
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>
851 <xsl:if test="string-length(normalize-space($partNumber))">
852 <xsl:call-template name="chopPunctuation">
853 <xsl:with-param name="chopString" select="$partNumber"/>
856 <xsl:if test="string-length(normalize-space($partName))">
857 <xsl:call-template name="chopPunctuation">
858 <xsl:with-param name="chopString" select="$partName"/>
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>
876 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
879 <xsl:template name="showAuthor">
880 <xsl:param name="authorfield"/>
881 <xsl:param name="UseAuthoritiesForTracings"/>
882 <xsl:if test="count($authorfield)>0">
884 <xsl:for-each select="$authorfield">
886 <xsl:when test="position()>1"/>
887 <xsl:when test="@tag<700">Author(s): </xsl:when>
888 <xsl:otherwise>Additional author(s): </xsl:otherwise>
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>
896 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
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>
904 <!-- add relator code too between brackets-->
905 <xsl:if test="marc:subfield[@code='4' or @code='e']">
906 <xsl:text>[</xsl:text>
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>
911 <xsl:text>]</xsl:text>
915 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>