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 <!-- Edited: Bug 1807 [ENH] XSLT enhancements sponsored by bywater solutions 2015/01/19 WS wsalesky@gmail.com -->
7 <xsl:stylesheet version="1.0"
8 xmlns:marc="http://www.loc.gov/MARC21/slim"
9 xmlns:items="http://www.koha-community.org/items"
10 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 exclude-result-prefixes="marc items">
12 <xsl:import href="MARC21slimUtils.xsl"/>
13 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14 <xsl:template match="/">
15 <xsl:apply-templates/>
18 <xsl:template match="marc:record">
20 <!-- Option: Display Alternate Graphic Representation (MARC 880) -->
21 <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22 <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
23 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
24 <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
25 <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
26 <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
27 <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
28 <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
29 <xsl:variable name="DisplayIconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayIconsXSLT']"/>
30 <xsl:variable name="TracingQuotesLeft">
32 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
33 <xsl:otherwise>"</xsl:otherwise>
36 <xsl:variable name="TracingQuotesRight">
38 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
39 <xsl:otherwise>"</xsl:otherwise>
42 <xsl:variable name="leader" select="marc:leader"/>
43 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
44 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
45 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
46 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
47 <xsl:variable name="materialTypeCode">
49 <xsl:when test="$leader19='a'">ST</xsl:when>
50 <xsl:when test="$leader6='a'">
52 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
53 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
54 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
57 <xsl:when test="$leader6='t'">BK</xsl:when>
58 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
59 <xsl:when test="$leader6='m'">CF</xsl:when>
60 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
61 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
62 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
63 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
66 <xsl:variable name="materialTypeLabel">
68 <xsl:when test="$leader19='a'">Set</xsl:when>
69 <xsl:when test="$leader6='a'">
71 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
72 <xsl:when test="$leader7='i' or $leader7='s'">
74 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing resource</xsl:when>
75 <xsl:otherwise>Series</xsl:otherwise>
78 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
81 <xsl:when test="$leader6='t'">Book</xsl:when>
82 <xsl:when test="$leader6='o'">Kit</xsl:when>
83 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
84 <xsl:when test="$leader6='m'">Computer file</xsl:when>
85 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
86 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual material</xsl:when>
87 <xsl:when test="$leader6='j'">Music</xsl:when>
88 <xsl:when test="$leader6='i'">Sound</xsl:when>
89 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
93 <!-- Title Statement -->
94 <!-- Alternate Graphic Representation (MARC 880) -->
95 <xsl:if test="$display880">
97 <xsl:call-template name="m880Select">
98 <xsl:with-param name="basetags">245</xsl:with-param>
99 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
105 <xsl:if test="marc:datafield[@tag=245]">
106 <h1 class="title" property="name">
107 <xsl:for-each select="marc:datafield[@tag=245]">
108 <xsl:call-template name="subfieldSelect">
109 <xsl:with-param name="codes">a</xsl:with-param>
111 <xsl:text> </xsl:text>
112 <!-- 13381 add additional subfields-->
113 <xsl:for-each select="marc:subfield[contains('bchknps', @code)]">
115 <xsl:when test="@code='h'">
116 <!-- 13381 Span class around subfield h so it can be suppressed via css -->
117 <span class="title_medium"><xsl:apply-templates/> </span>
119 <xsl:when test="@code='c'">
120 <!-- 13381 Span class around subfield c so it can be suppressed via css -->
121 <span class="title_resp_stmt"><xsl:apply-templates/> </span>
124 <xsl:apply-templates/>
125 <xsl:text> </xsl:text>
133 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
134 <xsl:if test="$display880">
136 <xsl:call-template name="m880Select">
137 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
138 <xsl:with-param name="codes">abc</xsl:with-param>
139 <xsl:with-param name="index">au</xsl:with-param>
140 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
141 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
146 <!-- Author Statement -->
147 <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>
148 <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>
150 <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
151 <span class="results_summary type"><span class="label">Material type: </span>
152 <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>
153 <xsl:text> </xsl:text>
154 <xsl:value-of select="$materialTypeLabel"/>
159 <!--Series: Alternate Graphic Representation (MARC 880) -->
160 <xsl:if test="$display880">
161 <xsl:call-template name="m880Select">
162 <xsl:with-param name="basetags">440,490</xsl:with-param>
163 <xsl:with-param name="codes">av</xsl:with-param>
164 <xsl:with-param name="class">results_summary series</xsl:with-param>
165 <xsl:with-param name="label">Series: </xsl:with-param>
166 <xsl:with-param name="index">se</xsl:with-param>
171 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
172 <span class="results_summary series"><span class="label">Series: </span>
174 <xsl:for-each select="marc:datafield[@tag=440]">
175 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
176 <xsl:call-template name="chopPunctuation">
177 <xsl:with-param name="chopString">
178 <xsl:call-template name="subfieldSelect">
179 <xsl:with-param name="codes">av</xsl:with-param>
184 <xsl:call-template name="part"/>
185 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
188 <!-- 490 Series not traced, Ind1 = 0 -->
189 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
190 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
191 <xsl:call-template name="chopPunctuation">
192 <xsl:with-param name="chopString">
193 <xsl:call-template name="subfieldSelect">
194 <xsl:with-param name="codes">av</xsl:with-param>
199 <xsl:call-template name="part"/>
200 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
202 <!-- 490 Series traced, Ind1 = 1 -->
203 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
204 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
206 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
207 <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
208 <xsl:call-template name="chopPunctuation">
209 <xsl:with-param name="chopString">
210 <xsl:call-template name="subfieldSelect">
211 <xsl:with-param name="codes">a_t</xsl:with-param>
218 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
219 <xsl:call-template name="chopPunctuation">
220 <xsl:with-param name="chopString">
221 <xsl:call-template name="subfieldSelect">
222 <xsl:with-param name="codes">a_t</xsl:with-param>
227 <xsl:call-template name="part"/>
230 <xsl:text>: </xsl:text>
231 <xsl:value-of select="marc:subfield[@code='v']" />
232 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
240 <xsl:if test="$leader7='s'">
241 <span class="results_summary analytics"><span class="label">Analytics: </span>
244 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
245 <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>
248 <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>
251 <xsl:text>Show analytics</xsl:text>
256 <!-- Volumes of sets and traced series -->
257 <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
258 <span class="results_summary volumes"><span class="label">Volumes: </span>
261 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
262 <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>
265 <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>
268 <xsl:text>Show volumes</xsl:text>
274 <xsl:if test="$leader19='c'">
275 <span class="results_summary set"><span class="label">Set: </span>
276 <xsl:for-each select="marc:datafield[@tag=773]">
279 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
280 <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>
283 <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>
286 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
289 <xsl:when test="position()=last()"></xsl:when>
290 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
296 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
297 <xsl:if test="$display880">
298 <xsl:call-template name="m880Select">
299 <xsl:with-param name="basetags">260</xsl:with-param>
300 <xsl:with-param name="codes">abcg</xsl:with-param>
301 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
302 <xsl:with-param name="label">Publisher: </xsl:with-param>
306 <!-- Publisher info and RDA related info from tags 260, 264 -->
308 <xsl:when test="marc:datafield[@tag=260]">
309 <span class="results_summary publisher"><span class="label">Publisher: </span>
310 <xsl:for-each select="marc:datafield[@tag=260]">
311 <xsl:if test="marc:subfield[@code='a']">
312 <xsl:call-template name="subfieldSelect">
313 <xsl:with-param name="codes">a</xsl:with-param>
316 <xsl:text> </xsl:text>
317 <xsl:if test="marc:subfield[@code='b']">
318 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
319 <xsl:call-template name="subfieldSelect">
320 <xsl:with-param name="codes">b</xsl:with-param>
324 <xsl:text> </xsl:text>
325 <xsl:call-template name="chopPunctuation">
326 <xsl:with-param name="chopString">
327 <xsl:call-template name="subfieldSelect">
328 <xsl:with-param name="codes">cg</xsl:with-param>
332 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
334 <xsl:if test="marc:datafield[@tag=264]">
335 <xsl:text>; </xsl:text>
336 <xsl:call-template name="showRDAtag264"/>
340 <xsl:when test="marc:datafield[@tag=264]">
341 <span class="results_summary">
342 <xsl:call-template name="showRDAtag264"/>
347 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
348 <xsl:if test="$display880">
349 <xsl:call-template name="m880Select">
350 <xsl:with-param name="basetags">250</xsl:with-param>
351 <xsl:with-param name="codes">ab</xsl:with-param>
352 <xsl:with-param name="class">results_summary edition</xsl:with-param>
353 <xsl:with-param name="label">Edition: </xsl:with-param>
357 <xsl:if test="marc:datafield[@tag=250]">
358 <span class="results_summary edition"><span class="label">Edition: </span>
359 <xsl:for-each select="marc:datafield[@tag=250]">
360 <xsl:call-template name="chopPunctuation">
361 <xsl:with-param name="chopString">
362 <xsl:call-template name="subfieldSelect">
363 <xsl:with-param name="codes">ab</xsl:with-param>
367 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
372 <!-- Description: Alternate Graphic Representation (MARC 880) -->
373 <xsl:if test="$display880">
374 <xsl:call-template name="m880Select">
375 <xsl:with-param name="basetags">300</xsl:with-param>
376 <xsl:with-param name="codes">abceg</xsl:with-param>
377 <xsl:with-param name="class">results_summary description</xsl:with-param>
378 <xsl:with-param name="label">Description: </xsl:with-param>
382 <xsl:if test="marc:datafield[@tag=300]">
383 <span class="results_summary description"><span class="label">Description: </span>
384 <xsl:for-each select="marc:datafield[@tag=300]">
385 <xsl:call-template name="chopPunctuation">
386 <xsl:with-param name="chopString">
387 <xsl:call-template name="subfieldSelect">
388 <xsl:with-param name="codes">abceg</xsl:with-param>
392 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
398 <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']">
399 <span class="results_summary isbn"><span class="label">ISBN: </span>
400 <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']">
401 <span property="isbn">
402 <xsl:value-of select="."/>
404 <xsl:when test="position()=last()">
405 <xsl:text>.</xsl:text>
408 <xsl:text>; </xsl:text>
417 <xsl:if test="marc:datafield[@tag=022]/marc:subfield[@code='a']">
418 <span class="results_summary issn"><span class="label">ISSN: </span>
419 <xsl:for-each select="marc:datafield[@tag=022]/marc:subfield[@code='a']">
420 <span property="issn">
421 <xsl:value-of select="."/>
423 <xsl:when test="position()=last()">
424 <xsl:text>.</xsl:text>
427 <xsl:text>; </xsl:text>
435 <xsl:if test="marc:datafield[@tag=013]">
436 <span class="results_summary patent_info">
437 <span class="label">Patent information: </span>
438 <xsl:for-each select="marc:datafield[@tag=013]">
439 <xsl:call-template name="subfieldSelect">
440 <xsl:with-param name="codes">acdef</xsl:with-param>
441 <xsl:with-param name="delimeter">, </xsl:with-param>
443 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
448 <xsl:if test="marc:datafield[@tag=088]">
449 <span class="results_summary report_number">
450 <span class="label">Report number: </span>
451 <xsl:for-each select="marc:datafield[@tag=088]">
452 <xsl:call-template name="subfieldSelect">
453 <xsl:with-param name="codes">a</xsl:with-param>
455 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
460 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
461 <xsl:if test="$display880">
462 <xsl:call-template name="m880Select">
463 <xsl:with-param name="basetags">246</xsl:with-param>
464 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
465 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
466 <xsl:with-param name="label">Other title: </xsl:with-param>
470 <xsl:if test="marc:datafield[@tag=246]">
471 <span class="results_summary other_title"><span class="label">Other title: </span>
472 <xsl:for-each select="marc:datafield[@tag=246]">
473 <xsl:call-template name="chopPunctuation">
474 <xsl:with-param name="chopString">
475 <xsl:call-template name="subfieldSelect">
476 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
480 <!-- #13386 added separator | -->
481 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
486 <xsl:if test="marc:datafield[@tag=242]">
487 <span class="results_summary translated_title"><span class="label">Title translated: </span>
488 <xsl:for-each select="marc:datafield[@tag=242]">
489 <xsl:call-template name="chopPunctuation">
490 <xsl:with-param name="chopString">
491 <xsl:call-template name="subfieldSelect">
492 <xsl:with-param name="codes">abchnp</xsl:with-param>
496 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
501 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
502 <xsl:if test="$display880">
503 <xsl:call-template name="m880Select">
504 <xsl:with-param name="basetags">130,240</xsl:with-param>
505 <xsl:with-param name="codes">adfklmor</xsl:with-param>
506 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
507 <xsl:with-param name="label">Uniform title: </xsl:with-param>
511 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
512 <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
513 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
514 <xsl:variable name="str">
515 <xsl:for-each select="marc:subfield">
516 <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'])))">
517 <xsl:value-of select="text()"/>
518 <xsl:text> </xsl:text>
522 <xsl:call-template name="chopPunctuation">
523 <xsl:with-param name="chopString">
524 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
528 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
533 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
534 <span class="results_summary subjects"><span class="label">Subject(s): </span>
535 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
538 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
539 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
540 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
542 <xsl:when test="$TraceSubjectSubdivisions='1'">
543 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject">
544 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
545 <xsl:with-param name="delimeter"> AND </xsl:with-param>
546 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
547 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
551 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
553 <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="translate(marc:subfield[@code='a'],'()','')"/><xsl:value-of select="$TracingQuotesRight"/></xsl:attribute>
556 <xsl:call-template name="chopPunctuation">
557 <xsl:with-param name="chopString">
558 <xsl:call-template name="subfieldSelect">
559 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
560 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
561 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
567 <xsl:when test="position()=last()"></xsl:when>
568 <xsl:otherwise> | </xsl:otherwise>
576 <xsl:if test="marc:datafield[@tag=655]">
577 <span class="results_summary genre"><span class="label">Genre/Form: </span>
578 <xsl:for-each select="marc:datafield[@tag=655]">
581 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
582 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
584 <xsl:when test="$TraceSubjectSubdivisions='1'">
585 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
586 <xsl:with-param name="codes">avxyz</xsl:with-param>
587 <xsl:with-param name="delimeter"> AND </xsl:with-param>
588 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
589 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
594 <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>
597 <xsl:call-template name="subfieldSelect">
598 <xsl:with-param name="codes">avxyz</xsl:with-param>
599 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
600 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
603 <xsl:if test="position()!=last()"><span class="separator"> | </span></xsl:if>
608 <!-- DDC classification -->
609 <xsl:if test="marc:datafield[@tag=082]">
610 <span class="results_summary ddc">
611 <span class="label">DDC classification: </span>
612 <xsl:for-each select="marc:datafield[@tag=082]">
613 <xsl:call-template name="subfieldSelect">
614 <xsl:with-param name="codes">a</xsl:with-param>
617 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
618 <xsl:otherwise> | </xsl:otherwise>
624 <xsl:if test="marc:datafield[@tag=856]">
625 <span class="results_summary online_resources"><span class="label">Online resources: </span>
626 <xsl:for-each select="marc:datafield[@tag=856]">
627 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
628 <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
630 <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')">
631 <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>
633 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
634 <xsl:call-template name="subfieldSelect">
635 <xsl:with-param name="codes">y3z</xsl:with-param>
638 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
640 <xsl:when test="$URLLinkText!=''">
641 <xsl:value-of select="$URLLinkText"/>
644 <xsl:text>Click here to access online</xsl:text>
651 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
652 <xsl:otherwise> | </xsl:otherwise>
658 <xsl:if test="marc:datafield[@tag=505]">
659 <div class="results_summary contents">
661 <xsl:when test="marc:datafield[@tag=505]/@ind1=0">
662 <span class="label">Contents:</span>
664 <xsl:when test="marc:datafield[@tag=505]/@ind1=1">
665 <span class="label">Incomplete contents:</span>
667 <xsl:when test="marc:datafield[@tag=505]/@ind1=2">
668 <span class="label">Partial contents:</span>
671 <xsl:for-each select="marc:datafield[@tag=505]">
672 <div class='contentblock'>
674 <xsl:when test="@ind2=0">
675 <xsl:call-template name="subfieldSelectSpan">
676 <xsl:with-param name="codes">tru</xsl:with-param>
680 <xsl:call-template name="subfieldSelectSpan">
681 <xsl:with-param name="codes">atru</xsl:with-param>
691 <xsl:if test="marc:datafield[@tag=586]">
692 <span class="results_summary awardsnote">
693 <xsl:if test="marc:datafield[@tag=586]/@ind1=' '">
694 <span class="label">Awards: </span>
696 <xsl:for-each select="marc:datafield[@tag=586]">
697 <xsl:value-of select="marc:subfield[@code='a']"/>
698 <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
704 <xsl:if test="marc:datafield[@tag=508]">
705 <div class="results_summary prod_credits">
706 <span class="label">Production Credits: </span>
707 <xsl:for-each select="marc:datafield[@tag=508]">
708 <xsl:call-template name="subfieldSelectSpan">
709 <xsl:with-param name="codes">a</xsl:with-param>
716 <xsl:if test="marc:datafield[@tag=773]">
717 <xsl:for-each select="marc:datafield[@tag=773]">
718 <xsl:if test="@ind1=0">
719 <span class="results_summary in"><span class="label">
721 <xsl:when test="@ind2=' '">
724 <xsl:when test="@ind2=8">
725 <xsl:if test="marc:subfield[@code='i']">
726 <xsl:value-of select="marc:subfield[@code='i']"/>
731 <xsl:variable name="f773">
732 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
733 <xsl:with-param name="codes">a_t</xsl:with-param>
734 </xsl:call-template></xsl:with-param></xsl:call-template>
737 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
738 <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>
739 <xsl:value-of select="translate($f773, '()', '')"/>
741 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
743 <xsl:when test="marc:subfield[@code='0']">
744 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
745 <xsl:value-of select="$f773"/>
749 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
750 <xsl:value-of select="$f773"/>
752 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
757 <xsl:if test="marc:subfield[@code='n']">
758 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
765 <xsl:if test="marc:datafield[@tag=502]">
766 <span class="results_summary diss_note">
767 <span class="label">Dissertation note: </span>
768 <xsl:for-each select="marc:datafield[@tag=502]">
769 <xsl:call-template name="subfieldSelect">
770 <xsl:with-param name="codes">abcdgo</xsl:with-param>
773 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
777 <!-- 866 textual holdings -->
778 <xsl:if test="marc:datafield[@tag=866]">
779 <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
780 <xsl:for-each select="marc:datafield[@tag=866]">
781 <xsl:call-template name="subfieldSelect">
782 <xsl:with-param name="codes">axz</xsl:with-param>
784 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
789 <!-- 775 Other Edition -->
790 <xsl:if test="marc:datafield[@tag=775]">
791 <span class="results_summary other_editions"><span class="label">Other editions: </span>
792 <xsl:for-each select="marc:datafield[@tag=775]">
793 <xsl:variable name="f775">
794 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
795 <xsl:with-param name="codes">a_t</xsl:with-param>
796 </xsl:call-template></xsl:with-param></xsl:call-template>
798 <xsl:if test="marc:subfield[@code='i']">
799 <xsl:call-template name="subfieldSelect">
800 <xsl:with-param name="codes">i</xsl:with-param>
802 <xsl:text>: </xsl:text>
806 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
807 <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>
810 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
813 <xsl:call-template name="subfieldSelect">
814 <xsl:with-param name="codes">a_t</xsl:with-param>
818 <xsl:when test="position()=last()"></xsl:when>
819 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
826 <xsl:if test="marc:datafield[@tag=780]">
827 <xsl:for-each select="marc:datafield[@tag=780]">
828 <xsl:if test="@ind1=0">
829 <span class="results_summary preceeding_entry">
831 <xsl:when test="@ind2=0">
832 <span class="label">Continues:</span>
834 <xsl:when test="@ind2=1">
835 <span class="label">Continues in part:</span>
837 <xsl:when test="@ind2=2">
838 <span class="label">Supersedes:</span>
840 <xsl:when test="@ind2=3">
841 <span class="label">Supersedes in part:</span>
843 <xsl:when test="@ind2=4">
844 <span class="label">Formed by the union: ... and: ...</span>
846 <xsl:when test="@ind2=5">
847 <span class="label">Absorbed:</span>
849 <xsl:when test="@ind2=6">
850 <span class="label">Absorbed in part:</span>
852 <xsl:when test="@ind2=7">
853 <span class="label">Separated from:</span>
856 <xsl:text> </xsl:text>
857 <xsl:variable name="f780">
858 <xsl:call-template name="subfieldSelect">
859 <xsl:with-param name="codes">a_t</xsl:with-param>
863 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
864 <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>
865 <xsl:value-of select="translate($f780, '()', '')"/>
869 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
870 <xsl:value-of select="translate($f780, '()', '')"/>
876 <xsl:if test="marc:subfield[@code='n']">
877 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
885 <xsl:if test="marc:datafield[@tag=785]">
886 <xsl:for-each select="marc:datafield[@tag=785]">
887 <span class="results_summary succeeding_entry">
889 <xsl:when test="@ind2=0">
890 <span class="label">Continued by:</span>
892 <xsl:when test="@ind2=1">
893 <span class="label">Continued in part by:</span>
895 <xsl:when test="@ind2=2">
896 <span class="label">Superseded by:</span>
898 <xsl:when test="@ind2=3">
899 <span class="label">Superseded in part by:</span>
901 <xsl:when test="@ind2=4">
902 <span class="label">Absorbed by:</span>
904 <xsl:when test="@ind2=5">
905 <span class="label">Absorbed in part by:</span>
907 <xsl:when test="@ind2=6">
908 <span class="label">Split into .. and ...:</span>
910 <xsl:when test="@ind2=7">
911 <span class="label">Merged with ... to form ...</span>
913 <xsl:when test="@ind2=8">
914 <span class="label">Changed back to:</span>
917 <xsl:text> </xsl:text>
918 <xsl:variable name="f785">
919 <xsl:call-template name="subfieldSelect">
920 <xsl:with-param name="codes">a_t</xsl:with-param>
925 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
926 <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>
927 <xsl:value-of select="translate($f785, '()', '')"/>
931 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
932 <xsl:value-of select="translate($f785, '()', '')"/>
941 <xsl:if test="$OPACBaseURL!=''">
942 <span class="results_summary"><span class="label">OPAC view: </span>
943 <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>.
949 <xsl:template name="nameABCQ">
950 <xsl:call-template name="chopPunctuation">
951 <xsl:with-param name="chopString">
952 <xsl:call-template name="subfieldSelect">
953 <xsl:with-param name="codes">abcq</xsl:with-param>
956 <xsl:with-param name="punctuation">
957 <xsl:text>:,;/ </xsl:text>
962 <xsl:template name="nameABCDN">
963 <xsl:call-template name="chopPunctuation">
964 <xsl:with-param name="chopString">
965 <xsl:call-template name="subfieldSelect">
966 <xsl:with-param name="codes">abcdn</xsl:with-param>
969 <xsl:with-param name="punctuation">
970 <xsl:text>:,;/ </xsl:text>
975 <xsl:template name="nameACDEQ">
976 <xsl:call-template name="subfieldSelect">
977 <xsl:with-param name="codes">acdeq</xsl:with-param>
981 <xsl:template name="part">
982 <xsl:variable name="partNumber">
983 <xsl:call-template name="specialSubfieldSelect">
984 <xsl:with-param name="axis">n</xsl:with-param>
985 <xsl:with-param name="anyCodes">n</xsl:with-param>
986 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
989 <xsl:variable name="partName">
990 <xsl:call-template name="specialSubfieldSelect">
991 <xsl:with-param name="axis">p</xsl:with-param>
992 <xsl:with-param name="anyCodes">p</xsl:with-param>
993 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
996 <xsl:if test="string-length(normalize-space($partNumber))">
997 <xsl:call-template name="chopPunctuation">
998 <xsl:with-param name="chopString" select="$partNumber"/>
1001 <xsl:if test="string-length(normalize-space($partName))">
1002 <xsl:call-template name="chopPunctuation">
1003 <xsl:with-param name="chopString" select="$partName"/>
1004 </xsl:call-template>
1008 <xsl:template name="specialSubfieldSelect">
1009 <xsl:param name="anyCodes"/>
1010 <xsl:param name="axis"/>
1011 <xsl:param name="beforeCodes"/>
1012 <xsl:param name="afterCodes"/>
1013 <xsl:variable name="str">
1014 <xsl:for-each select="marc:subfield">
1015 <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])">
1016 <xsl:value-of select="text()"/>
1017 <xsl:text> </xsl:text>
1021 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1024 <xsl:template name="showAuthor">
1025 <xsl:param name="authorfield"/>
1026 <xsl:param name="UseAuthoritiesForTracings"/>
1027 <xsl:if test="count($authorfield)>0">
1029 <xsl:for-each select="$authorfield">
1031 <xsl:when test="position()>1"/>
1032 <xsl:when test="@tag<700">Author(s): </xsl:when>
1033 <xsl:otherwise>Additional author(s): </xsl:otherwise>
1037 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1038 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
1041 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
1045 <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCQ"/></xsl:when>
1046 <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
1047 <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
1049 <!-- add relator code too between brackets-->
1050 <xsl:if test="marc:subfield[@code='4' or @code='e']">
1051 <span class="relatorcode">
1052 <xsl:text> [</xsl:text>
1054 <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
1055 <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
1057 <xsl:text>]</xsl:text>
1062 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
1069 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
1070 <xsl:template name="subfieldSelectSubject">
1071 <xsl:param name="codes"/>
1072 <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
1073 <xsl:param name="subdivCodes"/>
1074 <xsl:param name="subdivDelimiter"/>
1075 <xsl:param name="prefix"/>
1076 <xsl:param name="suffix"/>
1077 <xsl:variable name="str">
1078 <xsl:for-each select="marc:subfield">
1079 <xsl:if test="contains($codes, @code)">
1080 <xsl:if test="contains($subdivCodes, @code)">
1081 <xsl:value-of select="$subdivDelimiter"/>
1083 <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
1087 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>