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="OpacSuppression" select="marc:sysprefs/marc:syspref[@name='OpacSuppression']"/>
31 <xsl:variable name="TracingQuotesLeft">
33 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
34 <xsl:otherwise>"</xsl:otherwise>
37 <xsl:variable name="TracingQuotesRight">
39 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
40 <xsl:otherwise>"</xsl:otherwise>
43 <xsl:variable name="leader" select="marc:leader"/>
44 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
45 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
46 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
47 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
48 <xsl:variable name="materialTypeCode">
50 <xsl:when test="$leader19='a'">ST</xsl:when>
51 <xsl:when test="$leader6='a'">
53 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
54 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
55 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
58 <xsl:when test="$leader6='t'">BK</xsl:when>
59 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
60 <xsl:when test="$leader6='m'">CF</xsl:when>
61 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
62 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
63 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
64 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
67 <xsl:variable name="materialTypeLabel">
69 <xsl:when test="$leader19='a'">Set</xsl:when>
70 <xsl:when test="$leader6='a'">
72 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
73 <xsl:when test="$leader7='i' or $leader7='s'">
75 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing resource</xsl:when>
76 <xsl:otherwise>Series</xsl:otherwise>
79 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
82 <xsl:when test="$leader6='t'">Book</xsl:when>
83 <xsl:when test="$leader6='o'">Kit</xsl:when>
84 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
85 <xsl:when test="$leader6='m'">Computer file</xsl:when>
86 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
87 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual material</xsl:when>
88 <xsl:when test="$leader6='j'">Music</xsl:when>
89 <xsl:when test="$leader6='i'">Sound</xsl:when>
90 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
94 <!-- Indicate if record is suppressed in OPAC -->
95 <xsl:if test="$OpacSuppression = 1">
96 <xsl:if test="marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']">
97 <span class="results_summary suppressed_opac">Suppressed in OPAC</span>
101 <!-- Title Statement -->
102 <!-- Alternate Graphic Representation (MARC 880) -->
103 <xsl:if test="$display880">
105 <xsl:call-template name="m880Select">
106 <xsl:with-param name="basetags">245</xsl:with-param>
107 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
113 <xsl:if test="marc:datafield[@tag=245]">
114 <h1 class="title" property="name">
115 <xsl:for-each select="marc:datafield[@tag=245]">
116 <xsl:call-template name="subfieldSelect">
117 <xsl:with-param name="codes">a</xsl:with-param>
119 <xsl:text> </xsl:text>
120 <!-- 13381 add additional subfields-->
121 <xsl:for-each select="marc:subfield[contains('bchknps', @code)]">
123 <xsl:when test="@code='h'">
124 <!-- 13381 Span class around subfield h so it can be suppressed via css -->
125 <span class="title_medium"><xsl:apply-templates/> </span>
127 <xsl:when test="@code='c'">
128 <!-- 13381 Span class around subfield c so it can be suppressed via css -->
129 <span class="title_resp_stmt"><xsl:apply-templates/> </span>
132 <xsl:apply-templates/>
133 <xsl:text> </xsl:text>
141 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
142 <xsl:if test="$display880">
144 <xsl:call-template name="m880Select">
145 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
146 <xsl:with-param name="codes">abc</xsl:with-param>
147 <xsl:with-param name="index">au</xsl:with-param>
148 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
149 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
154 <!-- Author Statement -->
155 <xsl:call-template name="showAuthor">
156 <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/>
157 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
160 <!-- #13382 Suppress 700$i and 7xx/@ind2=2 -->
161 <xsl:call-template name="showAuthor">
162 <xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
163 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
166 <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
167 <span class="results_summary type"><span class="label">Material type: </span>
168 <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>
169 <xsl:text> </xsl:text>
170 <xsl:value-of select="$materialTypeLabel"/>
175 <!--Series: Alternate Graphic Representation (MARC 880) -->
176 <xsl:if test="$display880">
177 <xsl:call-template name="m880Select">
178 <xsl:with-param name="basetags">440,490</xsl:with-param>
179 <xsl:with-param name="codes">av</xsl:with-param>
180 <xsl:with-param name="class">results_summary series</xsl:with-param>
181 <xsl:with-param name="label">Series: </xsl:with-param>
182 <xsl:with-param name="index">se</xsl:with-param>
187 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
188 <span class="results_summary series"><span class="label">Series: </span>
190 <xsl:for-each select="marc:datafield[@tag=440]">
191 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
192 <xsl:call-template name="chopPunctuation">
193 <xsl:with-param name="chopString">
194 <xsl:call-template name="subfieldSelect">
195 <xsl:with-param name="codes">av</xsl:with-param>
200 <xsl:call-template name="part"/>
201 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
204 <!-- 490 Series not traced, Ind1 = 0 -->
205 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
206 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
207 <xsl:call-template name="chopPunctuation">
208 <xsl:with-param name="chopString">
209 <xsl:call-template name="subfieldSelect">
210 <xsl:with-param name="codes">av</xsl:with-param>
215 <xsl:call-template name="part"/>
216 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
218 <!-- 490 Series traced, Ind1 = 1 -->
219 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
220 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
222 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
223 <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
224 <xsl:call-template name="chopPunctuation">
225 <xsl:with-param name="chopString">
226 <xsl:call-template name="subfieldSelect">
227 <xsl:with-param name="codes">a_t</xsl:with-param>
234 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
235 <xsl:call-template name="chopPunctuation">
236 <xsl:with-param name="chopString">
237 <xsl:call-template name="subfieldSelect">
238 <xsl:with-param name="codes">a_t</xsl:with-param>
243 <xsl:call-template name="part"/>
246 <xsl:text>: </xsl:text>
247 <xsl:value-of select="marc:subfield[@code='v']" />
248 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
256 <xsl:if test="$leader7='s'">
257 <span class="results_summary analytics"><span class="label">Analytics: </span>
260 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
261 <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>
264 <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>
267 <xsl:text>Show analytics</xsl:text>
272 <!-- Volumes of sets and traced series -->
273 <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
274 <span class="results_summary volumes"><span class="label">Volumes: </span>
277 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
278 <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>
281 <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>
284 <xsl:text>Show volumes</xsl:text>
290 <xsl:if test="$leader19='c'">
291 <span class="results_summary set"><span class="label">Set: </span>
292 <xsl:for-each select="marc:datafield[@tag=773]">
295 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
296 <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>
299 <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>
302 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
305 <xsl:when test="position()=last()"></xsl:when>
306 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
312 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
313 <xsl:if test="$display880">
314 <xsl:call-template name="m880Select">
315 <xsl:with-param name="basetags">260</xsl:with-param>
316 <xsl:with-param name="codes">abcg</xsl:with-param>
317 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
318 <xsl:with-param name="label">Publisher: </xsl:with-param>
322 <!-- Publisher info and RDA related info from tags 260, 264 -->
324 <xsl:when test="marc:datafield[@tag=264]">
325 <xsl:call-template name="showRDAtag264">
326 <xsl:with-param name="show_url">1</xsl:with-param>
329 <xsl:when test="marc:datafield[@tag=260]">
330 <span class="results_summary publisher"><span class="label">Publisher: </span>
331 <xsl:for-each select="marc:datafield[@tag=260]">
332 <xsl:if test="marc:subfield[@code='a']">
333 <xsl:call-template name="subfieldSelect">
334 <xsl:with-param name="codes">a</xsl:with-param>
337 <xsl:text> </xsl:text>
338 <xsl:if test="marc:subfield[@code='b']">
339 <a href="/cgi-bin/koha/catalogue/search.pl?q=Provider:{marc:subfield[@code='b']}">
340 <xsl:call-template name="subfieldSelect">
341 <xsl:with-param name="codes">b</xsl:with-param>
345 <xsl:text> </xsl:text>
346 <xsl:call-template name="chopPunctuation">
347 <xsl:with-param name="chopString">
348 <xsl:call-template name="subfieldSelect">
349 <xsl:with-param name="codes">cg</xsl:with-param>
353 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
359 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
360 <xsl:if test="$display880">
361 <xsl:call-template name="m880Select">
362 <xsl:with-param name="basetags">250</xsl:with-param>
363 <xsl:with-param name="codes">ab</xsl:with-param>
364 <xsl:with-param name="class">results_summary edition</xsl:with-param>
365 <xsl:with-param name="label">Edition: </xsl:with-param>
369 <xsl:if test="marc:datafield[@tag=250]">
370 <span class="results_summary edition"><span class="label">Edition: </span>
371 <xsl:for-each select="marc:datafield[@tag=250]">
372 <xsl:call-template name="chopPunctuation">
373 <xsl:with-param name="chopString">
374 <xsl:call-template name="subfieldSelect">
375 <xsl:with-param name="codes">ab</xsl:with-param>
379 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
384 <!-- Description: Alternate Graphic Representation (MARC 880) -->
385 <xsl:if test="$display880">
386 <xsl:call-template name="m880Select">
387 <xsl:with-param name="basetags">300</xsl:with-param>
388 <xsl:with-param name="codes">abceg</xsl:with-param>
389 <xsl:with-param name="class">results_summary description</xsl:with-param>
390 <xsl:with-param name="label">Description: </xsl:with-param>
394 <xsl:if test="marc:datafield[@tag=300]">
395 <span class="results_summary description"><span class="label">Description: </span>
396 <xsl:for-each select="marc:datafield[@tag=300]">
397 <xsl:call-template name="chopPunctuation">
398 <xsl:with-param name="chopString">
399 <xsl:call-template name="subfieldSelect">
400 <xsl:with-param name="codes">abceg</xsl:with-param>
404 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
409 <!-- Content Type -->
410 <xsl:if test="marc:datafield[@tag=336] or marc:datafield[@tag=337] or marc:datafield[@tag=338]">
411 <span class="results_summary" id="content_type">
412 <xsl:if test="marc:datafield[@tag=336]">
413 <span class="label">Content type: </span>
414 <xsl:for-each select="marc:datafield[@tag=336]">
415 <xsl:call-template name="subfieldSelect">
416 <xsl:with-param name="codes">a</xsl:with-param>
417 <xsl:with-param name="delimeter">, </xsl:with-param>
419 <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
422 <xsl:text> </xsl:text>
424 <xsl:if test="marc:datafield[@tag=337]">
425 <span class="label">Media type: </span>
426 <xsl:for-each select="marc:datafield[@tag=337]">
427 <xsl:call-template name="subfieldSelect">
428 <xsl:with-param name="codes">a</xsl:with-param>
429 <xsl:with-param name="delimeter">, </xsl:with-param>
431 <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
434 <xsl:text> </xsl:text>
436 <xsl:if test="marc:datafield[@tag=338]">
437 <span class="label">Carrier type: </span>
438 <xsl:for-each select="marc:datafield[@tag=338]">
439 <xsl:call-template name="subfieldSelect">
440 <xsl:with-param name="codes">a</xsl:with-param>
441 <xsl:with-param name="delimeter">, </xsl:with-param>
443 <xsl:if test="position() != last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
451 <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']">
452 <span class="results_summary isbn"><span class="label">ISBN: </span>
453 <xsl:for-each select="marc:datafield[@tag=020]/marc:subfield[@code='a']">
454 <span property="isbn">
455 <xsl:value-of select="."/>
457 <xsl:when test="position()=last()">
458 <xsl:text>.</xsl:text>
461 <xsl:text>; </xsl:text>
470 <xsl:if test="marc:datafield[@tag=022]/marc:subfield[@code='a']">
471 <span class="results_summary issn"><span class="label">ISSN: </span>
472 <xsl:for-each select="marc:datafield[@tag=022]/marc:subfield[@code='a']">
473 <span property="issn">
474 <xsl:value-of select="."/>
476 <xsl:when test="position()=last()">
477 <xsl:text>.</xsl:text>
480 <xsl:text>; </xsl:text>
488 <xsl:if test="marc:datafield[@tag=013]">
489 <span class="results_summary patent_info">
490 <span class="label">Patent information: </span>
491 <xsl:for-each select="marc:datafield[@tag=013]">
492 <xsl:call-template name="subfieldSelect">
493 <xsl:with-param name="codes">acdef</xsl:with-param>
494 <xsl:with-param name="delimeter">, </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 <xsl:if test="marc:datafield[@tag=088]">
502 <span class="results_summary report_number">
503 <span class="label">Report number: </span>
504 <xsl:for-each select="marc:datafield[@tag=088]">
505 <xsl:call-template name="subfieldSelect">
506 <xsl:with-param name="codes">a</xsl:with-param>
508 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
513 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
514 <xsl:if test="$display880">
515 <xsl:call-template name="m880Select">
516 <xsl:with-param name="basetags">246</xsl:with-param>
517 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
518 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
519 <xsl:with-param name="label">Other title: </xsl:with-param>
523 <xsl:if test="marc:datafield[@tag=246]">
524 <span class="results_summary other_title"><span class="label">Other title: </span>
525 <xsl:for-each select="marc:datafield[@tag=246]">
526 <xsl:call-template name="chopPunctuation">
527 <xsl:with-param name="chopString">
528 <xsl:call-template name="subfieldSelect">
529 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
533 <xsl:if test="@ind1=1 and not(marc:subfield[@code='i'])">
535 <xsl:when test="@ind2=0"> [Portion of title]</xsl:when>
536 <xsl:when test="@ind2=1"> [Parallel title]</xsl:when>
537 <xsl:when test="@ind2=2"> [Distinctive title]</xsl:when>
538 <xsl:when test="@ind2=3"> [Other title]</xsl:when>
539 <xsl:when test="@ind2=4"> [Cover title]</xsl:when>
540 <xsl:when test="@ind2=5"> [Added title page title]</xsl:when>
541 <xsl:when test="@ind2=6"> [Caption title]</xsl:when>
542 <xsl:when test="@ind2=7"> [Running title]</xsl:when>
543 <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
546 <xsl:if test="marc:subfield[@code='i']">
547 <xsl:value-of select="concat(' [',marc:subfield[@code='i'],']')"/>
549 <!-- #13386 added separator | -->
550 <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>
555 <xsl:if test="marc:datafield[@tag=242]">
556 <span class="results_summary translated_title"><span class="label">Title translated: </span>
557 <xsl:for-each select="marc:datafield[@tag=242]">
558 <xsl:call-template name="chopPunctuation">
559 <xsl:with-param name="chopString">
560 <xsl:call-template name="subfieldSelect">
561 <xsl:with-param name="codes">abchnp</xsl:with-param>
565 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
570 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
571 <xsl:if test="$display880">
572 <xsl:call-template name="m880Select">
573 <xsl:with-param name="basetags">130,240</xsl:with-param>
574 <xsl:with-param name="codes">adfklmor</xsl:with-param>
575 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
576 <xsl:with-param name="label">Uniform title: </xsl:with-param>
580 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
581 <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
582 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
583 <xsl:for-each select="marc:subfield">
584 <xsl:if test="contains('adfghklmnoprst',@code)">
585 <xsl:value-of select="text()"/>
586 <xsl:text> </xsl:text>
589 <xsl:if test="position() != last()">
590 <span class="separator"><xsl:text> | </xsl:text></span>
596 <!-- #13382 Added Related works 700$i -->
597 <xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
598 <span class="results_summary related_works"><span class="label">Related works: </span>
599 <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
600 <xsl:variable name="str">
601 <xsl:call-template name="subfieldSelect">
602 <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
605 <xsl:call-template name="chopPunctuation">
606 <xsl:with-param name="chopString">
607 <xsl:value-of select="$str"/>
610 <!-- add relator code too between brackets-->
611 <xsl:if test="marc:subfield[@code='4' or @code='e']">
612 <span class="relatorcode">
613 <xsl:text> [</xsl:text>
615 <xsl:when test="marc:subfield[@code='e']">
616 <xsl:for-each select="marc:subfield[@code='e']">
617 <xsl:value-of select="."/>
618 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
622 <xsl:for-each select="marc:subfield[@code='4']">
623 <xsl:value-of select="."/>
624 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
628 <xsl:text>]</xsl:text>
632 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
638 <!-- #13382 Added Contained Works 7xx@ind2=2 -->
639 <xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
640 <span class="results_summary contained_works"><span class="label">Contained works: </span>
641 <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
642 <xsl:variable name="str">
643 <xsl:call-template name="subfieldSelect">
644 <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
647 <xsl:call-template name="chopPunctuation">
648 <xsl:with-param name="chopString">
649 <xsl:value-of select="$str"/>
652 <!-- add relator code too between brackets-->
653 <xsl:if test="marc:subfield[@code='4' or @code='e']">
654 <span class="relatorcode">
655 <xsl:text> [</xsl:text>
657 <xsl:when test="marc:subfield[@code='e']">
658 <xsl:for-each select="marc:subfield[@code='e']">
659 <xsl:value-of select="."/>
660 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
664 <xsl:for-each select="marc:subfield[@code='4']">
665 <xsl:value-of select="."/>
666 <xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
670 <xsl:text>]</xsl:text>
674 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
681 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
682 <span class="results_summary subjects"><span class="label">Subject(s): </span>
683 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
686 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
687 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
688 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
690 <xsl:when test="$TraceSubjectSubdivisions='1'">
691 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject">
692 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
693 <xsl:with-param name="delimeter"> AND </xsl:with-param>
694 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
695 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
699 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
701 <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>
704 <xsl:call-template name="chopPunctuation">
705 <xsl:with-param name="chopString">
706 <xsl:call-template name="subfieldSelect">
707 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
708 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
709 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
715 <xsl:when test="position()=last()"></xsl:when>
716 <xsl:otherwise> | </xsl:otherwise>
724 <xsl:if test="marc:datafield[@tag=655]">
725 <span class="results_summary genre"><span class="label">Genre/Form: </span>
726 <xsl:for-each select="marc:datafield[@tag=655]">
729 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
730 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
732 <xsl:when test="$TraceSubjectSubdivisions='1'">
733 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
734 <xsl:with-param name="codes">avxyz</xsl:with-param>
735 <xsl:with-param name="delimeter"> AND </xsl:with-param>
736 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
737 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
742 <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>
745 <xsl:call-template name="subfieldSelect">
746 <xsl:with-param name="codes">avxyz</xsl:with-param>
747 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
748 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
751 <xsl:if test="position()!=last()"><span class="separator"> | </span></xsl:if>
756 <!-- DDC classification -->
757 <xsl:if test="marc:datafield[@tag=082]">
758 <span class="results_summary ddc">
759 <span class="label">DDC classification: </span>
760 <xsl:for-each select="marc:datafield[@tag=082]">
761 <xsl:call-template name="subfieldSelect">
762 <xsl:with-param name="codes">a</xsl:with-param>
763 <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param>
766 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
767 <xsl:otherwise> | </xsl:otherwise>
773 <xsl:if test="marc:datafield[@tag=856]">
774 <span class="results_summary online_resources"><span class="label">Online resources: </span>
775 <xsl:for-each select="marc:datafield[@tag=856]">
776 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
777 <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
779 <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')">
780 <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>
782 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
783 <xsl:call-template name="subfieldSelect">
784 <xsl:with-param name="codes">y3z</xsl:with-param>
787 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
789 <xsl:when test="$URLLinkText!=''">
790 <xsl:value-of select="$URLLinkText"/>
793 <xsl:text>Click here to access online</xsl:text>
800 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
801 <xsl:otherwise> | </xsl:otherwise>
807 <xsl:if test="marc:datafield[@tag=505]">
808 <div class="results_summary contents">
810 <xsl:when test="marc:datafield[@tag=505]/@ind1=0">
811 <span class="label">Contents:</span>
813 <xsl:when test="marc:datafield[@tag=505]/@ind1=1">
814 <span class="label">Incomplete contents:</span>
816 <xsl:when test="marc:datafield[@tag=505]/@ind1=2">
817 <span class="label">Partial contents:</span>
820 <xsl:for-each select="marc:datafield[@tag=505]">
821 <div class='contentblock'>
823 <xsl:when test="@ind2=0">
824 <xsl:call-template name="subfieldSelectSpan">
825 <xsl:with-param name="codes">tru</xsl:with-param>
829 <xsl:call-template name="subfieldSelectSpan">
830 <xsl:with-param name="codes">atru</xsl:with-param>
840 <xsl:if test="marc:datafield[@tag=586]">
841 <span class="results_summary awardsnote">
842 <xsl:if test="marc:datafield[@tag=586]/@ind1=' '">
843 <span class="label">Awards: </span>
845 <xsl:for-each select="marc:datafield[@tag=586]">
846 <xsl:value-of select="marc:subfield[@code='a']"/>
847 <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
853 <xsl:if test="marc:datafield[@tag=508]">
854 <div class="results_summary prod_credits">
855 <span class="label">Production credits: </span>
856 <xsl:for-each select="marc:datafield[@tag=508]">
857 <xsl:call-template name="subfieldSelectSpan">
858 <xsl:with-param name="codes">a</xsl:with-param>
860 <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
866 <xsl:if test="marc:datafield[@tag=773]">
867 <xsl:for-each select="marc:datafield[@tag=773]">
868 <xsl:if test="@ind1 !=1">
869 <span class="results_summary in"><span class="label">
871 <xsl:when test="@ind2=' '">
874 <xsl:when test="@ind2=8">
875 <xsl:if test="marc:subfield[@code='i']">
876 <xsl:value-of select="marc:subfield[@code='i']"/>
881 <xsl:variable name="f773">
882 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
883 <xsl:with-param name="codes">a_t</xsl:with-param>
884 </xsl:call-template></xsl:with-param></xsl:call-template>
887 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
888 <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>
889 <xsl:value-of select="translate($f773, '()', '')"/>
891 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
893 <xsl:when test="marc:subfield[@code='0']">
894 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
895 <xsl:value-of select="$f773"/>
899 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
900 <xsl:value-of select="$f773"/>
902 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
907 <xsl:if test="marc:subfield[@code='n']">
908 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
915 <xsl:if test="marc:datafield[@tag=502]">
916 <span class="results_summary diss_note">
917 <span class="label">Dissertation note: </span>
918 <xsl:for-each select="marc:datafield[@tag=502]">
919 <xsl:call-template name="subfieldSelect">
920 <xsl:with-param name="codes">abcdgo</xsl:with-param>
923 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
927 <!-- 866 textual holdings -->
928 <xsl:if test="marc:datafield[@tag=866]">
929 <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
930 <xsl:for-each select="marc:datafield[@tag=866]">
931 <xsl:call-template name="subfieldSelect">
932 <xsl:with-param name="codes">axz</xsl:with-param>
934 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
939 <!-- 775 Other Edition -->
940 <xsl:if test="marc:datafield[@tag=775]">
941 <span class="results_summary other_editions"><span class="label">Other editions: </span>
942 <xsl:for-each select="marc:datafield[@tag=775]">
943 <xsl:variable name="f775">
944 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
945 <xsl:with-param name="codes">a_t</xsl:with-param>
946 </xsl:call-template></xsl:with-param></xsl:call-template>
948 <xsl:if test="marc:subfield[@code='i']">
949 <xsl:call-template name="subfieldSelect">
950 <xsl:with-param name="codes">i</xsl:with-param>
952 <xsl:text>: </xsl:text>
956 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
957 <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>
960 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
963 <xsl:call-template name="subfieldSelect">
964 <xsl:with-param name="codes">a_t</xsl:with-param>
968 <xsl:when test="position()=last()"></xsl:when>
969 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
976 <xsl:if test="marc:datafield[@tag=780]">
977 <xsl:for-each select="marc:datafield[@tag=780]">
978 <xsl:if test="@ind1=0">
979 <span class="results_summary preceeding_entry">
981 <xsl:when test="@ind2=0">
982 <span class="label">Continues:</span>
984 <xsl:when test="@ind2=1">
985 <span class="label">Continues in part:</span>
987 <xsl:when test="@ind2=2">
988 <span class="label">Supersedes:</span>
990 <xsl:when test="@ind2=3">
991 <span class="label">Supersedes in part:</span>
993 <xsl:when test="@ind2=4">
994 <span class="label">Formed by the union: ... and: ...</span>
996 <xsl:when test="@ind2=5">
997 <span class="label">Absorbed:</span>
999 <xsl:when test="@ind2=6">
1000 <span class="label">Absorbed in part:</span>
1002 <xsl:when test="@ind2=7">
1003 <span class="label">Separated from:</span>
1006 <xsl:text> </xsl:text>
1007 <xsl:variable name="f780">
1008 <xsl:call-template name="subfieldSelect">
1009 <xsl:with-param name="codes">a_t</xsl:with-param>
1010 </xsl:call-template>
1013 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1014 <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>
1015 <xsl:value-of select="translate($f780, '()', '')"/>
1019 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
1020 <xsl:value-of select="translate($f780, '()', '')"/>
1026 <xsl:if test="marc:subfield[@code='n']">
1027 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
1035 <xsl:if test="marc:datafield[@tag=785]">
1036 <xsl:for-each select="marc:datafield[@tag=785]">
1037 <span class="results_summary succeeding_entry">
1039 <xsl:when test="@ind2=0">
1040 <span class="label">Continued by:</span>
1042 <xsl:when test="@ind2=1">
1043 <span class="label">Continued in part by:</span>
1045 <xsl:when test="@ind2=2">
1046 <span class="label">Superseded by:</span>
1048 <xsl:when test="@ind2=3">
1049 <span class="label">Superseded in part by:</span>
1051 <xsl:when test="@ind2=4">
1052 <span class="label">Absorbed by:</span>
1054 <xsl:when test="@ind2=5">
1055 <span class="label">Absorbed in part by:</span>
1057 <xsl:when test="@ind2=6">
1058 <span class="label">Split into .. and ...:</span>
1060 <xsl:when test="@ind2=7">
1061 <span class="label">Merged with ... to form ...</span>
1063 <xsl:when test="@ind2=8">
1064 <span class="label">Changed back to:</span>
1067 <xsl:text> </xsl:text>
1068 <xsl:variable name="f785">
1069 <xsl:call-template name="subfieldSelect">
1070 <xsl:with-param name="codes">a_t</xsl:with-param>
1071 </xsl:call-template>
1075 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
1076 <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>
1077 <xsl:value-of select="translate($f785, '()', '')"/>
1081 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
1082 <xsl:value-of select="translate($f785, '()', '')"/>
1091 <xsl:if test="$OPACBaseURL!=''">
1092 <span class="results_summary"><span class="label">OPAC view: </span>
1093 <a><xsl:attribute name="href"><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>.
1099 <xsl:template name="nameABCQ">
1100 <xsl:call-template name="chopPunctuation">
1101 <xsl:with-param name="chopString">
1102 <xsl:call-template name="subfieldSelect">
1103 <xsl:with-param name="codes">abcq</xsl:with-param>
1104 </xsl:call-template>
1106 <xsl:with-param name="punctuation">
1107 <xsl:text>:,;/ </xsl:text>
1109 </xsl:call-template>
1112 <xsl:template name="nameABCDN">
1113 <xsl:call-template name="chopPunctuation">
1114 <xsl:with-param name="chopString">
1115 <xsl:call-template name="subfieldSelect">
1116 <xsl:with-param name="codes">abcdn</xsl:with-param>
1117 </xsl:call-template>
1119 <xsl:with-param name="punctuation">
1120 <xsl:text>:,;/ </xsl:text>
1122 </xsl:call-template>
1125 <xsl:template name="nameACDEQ">
1126 <xsl:call-template name="subfieldSelect">
1127 <xsl:with-param name="codes">acdeq</xsl:with-param>
1128 </xsl:call-template>
1131 <xsl:template name="part">
1132 <xsl:variable name="partNumber">
1133 <xsl:call-template name="specialSubfieldSelect">
1134 <xsl:with-param name="axis">n</xsl:with-param>
1135 <xsl:with-param name="anyCodes">n</xsl:with-param>
1136 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1137 </xsl:call-template>
1139 <xsl:variable name="partName">
1140 <xsl:call-template name="specialSubfieldSelect">
1141 <xsl:with-param name="axis">p</xsl:with-param>
1142 <xsl:with-param name="anyCodes">p</xsl:with-param>
1143 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1144 </xsl:call-template>
1146 <xsl:if test="string-length(normalize-space($partNumber))">
1147 <xsl:call-template name="chopPunctuation">
1148 <xsl:with-param name="chopString" select="$partNumber"/>
1149 </xsl:call-template>
1151 <xsl:if test="string-length(normalize-space($partName))">
1152 <xsl:call-template name="chopPunctuation">
1153 <xsl:with-param name="chopString" select="$partName"/>
1154 </xsl:call-template>
1158 <xsl:template name="specialSubfieldSelect">
1159 <xsl:param name="anyCodes"/>
1160 <xsl:param name="axis"/>
1161 <xsl:param name="beforeCodes"/>
1162 <xsl:param name="afterCodes"/>
1163 <xsl:variable name="str">
1164 <xsl:for-each select="marc:subfield">
1165 <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])">
1166 <xsl:value-of select="text()"/>
1167 <xsl:text> </xsl:text>
1171 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1174 <xsl:template name="showAuthor">
1175 <xsl:param name="authorfield"/>
1176 <xsl:param name="UseAuthoritiesForTracings"/>
1177 <xsl:if test="count($authorfield)>0">
1179 <xsl:for-each select="$authorfield">
1181 <xsl:when test="position()>1"/>
1183 <xsl:when test="@tag<700">By: </xsl:when>
1184 <!--#13382 Changed Additional author to contributor -->
1185 <xsl:otherwise>Contributor(s): </xsl:otherwise>
1189 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1190 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
1193 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
1197 <xsl:when test="@tag=100 or @tag=110 or @tag=111">
1199 <xsl:call-template name="chopPunctuation">
1200 <xsl:with-param name="chopString">
1201 <xsl:call-template name="subfieldSelect">
1202 <xsl:with-param name="codes">
1204 <!-- #13383 include subfield e for field 111, Display only name portion in 1XX -->
1205 <xsl:when test="@tag=111">aeq</xsl:when>
1206 <xsl:when test="@tag=110">ab</xsl:when>
1207 <xsl:otherwise>abcjq</xsl:otherwise>
1210 </xsl:call-template>
1212 <xsl:with-param name="punctuation">
1213 <xsl:text>:,;/ </xsl:text>
1215 </xsl:call-template>
1216 <!-- Display only name and title portion in 110 field -->
1217 <xsl:if test="@tag=110 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1218 <span class="titleportion">
1220 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1221 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1223 <xsl:call-template name="chopPunctuation">
1224 <xsl:with-param name="chopString">
1225 <xsl:call-template name="subfieldSelect">
1226 <xsl:with-param name="codes">cdnt</xsl:with-param>
1227 </xsl:call-template>
1229 </xsl:call-template>
1232 <!-- Display only name and title portion in 111 field -->
1233 <xsl:if test="@tag=111 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1234 <span class="titleportion">
1236 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1237 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1240 <xsl:call-template name="chopPunctuation">
1241 <xsl:with-param name="chopString">
1242 <xsl:call-template name="subfieldSelect">
1243 <xsl:with-param name="codes">cdgnt</xsl:with-param>
1244 </xsl:call-template>
1246 </xsl:call-template>
1249 <!-- Display only dates in 100 field -->
1250 <xsl:if test="@tag=100 and marc:subfield[@code='d']">
1251 <span class="authordates">
1252 <xsl:text>, </xsl:text>
1253 <xsl:call-template name="chopPunctuation">
1254 <xsl:with-param name="chopString">
1255 <xsl:call-template name="subfieldSelect">
1256 <xsl:with-param name="codes">d</xsl:with-param>
1257 </xsl:call-template>
1259 </xsl:call-template>
1264 <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
1265 <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
1266 <xsl:when test="@tag=700 or @tag=710 or @tag=711">
1267 <!-- Includes major changes for 7XX fields; display name portion in 710 and 711 fields -->
1268 <xsl:if test="@tag=710 or @tag=711">
1269 <xsl:call-template name="chopPunctuation">
1270 <xsl:with-param name="chopString">
1271 <xsl:call-template name="subfieldSelect">
1272 <xsl:with-param name="codes">
1274 <xsl:when test="@tag=711">aeq</xsl:when>
1275 <xsl:otherwise>ab</xsl:otherwise>
1278 </xsl:call-template>
1280 <xsl:with-param name="punctuation">
1281 <xsl:text>:,;/ </xsl:text>
1283 </xsl:call-template>
1284 <!-- Display only name and title portion in 711 field -->
1285 <xsl:if test="@tag=711 and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])">
1286 <span class="titleportion">
1288 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1289 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1292 <xsl:call-template name="chopPunctuation">
1293 <xsl:with-param name="chopString">
1294 <xsl:call-template name="subfieldSelect">
1295 <xsl:with-param name="codes">cdgnt</xsl:with-param>
1296 </xsl:call-template>
1298 </xsl:call-template>
1301 <!-- Display only name and title portion in 710 field -->
1302 <xsl:if test="@tag=710 and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])">
1303 <span class="titleportion">
1305 <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when>
1306 <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise>
1308 <xsl:call-template name="chopPunctuation">
1309 <xsl:with-param name="chopString">
1310 <xsl:call-template name="subfieldSelect">
1311 <xsl:with-param name="codes">cdnt</xsl:with-param>
1312 </xsl:call-template>
1314 </xsl:call-template>
1319 <!-- Display only name portion in 700 field -->
1320 <xsl:if test="@tag=700">
1321 <xsl:call-template name="chopPunctuation">
1322 <xsl:with-param name="chopString">
1323 <xsl:call-template name="subfieldSelect">
1324 <xsl:with-param name="codes">abcq</xsl:with-param>
1325 </xsl:call-template>
1327 </xsl:call-template>
1329 <!-- Display class "authordates" in 700 field -->
1330 <xsl:if test="@tag=700 and marc:subfield[@code='d']">
1331 <span class="authordates">
1332 <xsl:text>, </xsl:text>
1333 <xsl:call-template name="chopPunctuation">
1334 <xsl:with-param name="chopString">
1335 <xsl:call-template name="subfieldSelect">
1336 <xsl:with-param name="codes">d</xsl:with-param>
1337 </xsl:call-template>
1339 </xsl:call-template>
1342 <!-- Display class "titleportion" in 700 field -->
1343 <xsl:variable name="titleportionfields" select="boolean(marc:subfield[@code='t' or @code='j' or @code='k' or @code='u'])"/>
1344 <xsl:if test="@tag=700 and $titleportionfields">
1345 <span class="titleportion">
1346 <xsl:text>. </xsl:text>
1347 <xsl:call-template name="chopPunctuation">
1348 <xsl:with-param name="chopString">
1349 <xsl:call-template name="subfieldSelect">
1350 <xsl:with-param name="codes">fghjklmnoprstux</xsl:with-param>
1351 </xsl:call-template>
1353 </xsl:call-template>
1360 <!-- add relator code too between brackets-->
1361 <!-- #13383 include relator code j for field 111 -->
1362 <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
1363 <span class="relatorcode">
1364 <xsl:text> [</xsl:text>
1366 <xsl:when test="@tag=111 or @tag=711">
1368 <!-- Prefer j over 4 for fields 111 and 711-->
1369 <xsl:when test="marc:subfield[@code='j']">
1370 <xsl:for-each select="marc:subfield[@code='j']">
1371 <xsl:value-of select="."/>
1372 <xsl:if test="position() != last()">, </xsl:if>
1376 <xsl:for-each select="marc:subfield[@code=4]">
1377 <xsl:value-of select="."/>
1378 <xsl:if test="position() != last()">, </xsl:if>
1383 <!-- Prefer e over 4 for fields 111 and 711-->
1384 <xsl:when test="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
1385 <xsl:for-each select="marc:subfield[@code='e']">
1386 <xsl:value-of select="."/>
1387 <xsl:if test="position() != last()">, </xsl:if>
1391 <xsl:for-each select="marc:subfield[@code=4]">
1392 <xsl:value-of select="."/>
1393 <xsl:if test="position() != last()">, </xsl:if>
1397 <xsl:text>]</xsl:text>
1402 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
1410 <!-- #1807 Strip unwanted parenthesis from subjects for searching -->
1411 <xsl:template name="subfieldSelectSubject">
1412 <xsl:param name="codes"/>
1413 <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
1414 <xsl:param name="subdivCodes"/>
1415 <xsl:param name="subdivDelimiter"/>
1416 <xsl:param name="prefix"/>
1417 <xsl:param name="suffix"/>
1418 <xsl:variable name="str">
1419 <xsl:for-each select="marc:subfield">
1420 <xsl:if test="contains($codes, @code)">
1421 <xsl:if test="contains($subdivCodes, @code)">
1422 <xsl:value-of select="$subdivDelimiter"/>
1424 <xsl:value-of select="$prefix"/><xsl:value-of select="translate(text(),'()','')"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
1428 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>