1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3 <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
4 <xsl:stylesheet version="1.0"
5 xmlns:marc="http://www.loc.gov/MARC21/slim"
6 xmlns:items="http://www.koha-community.org/items"
7 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8 exclude-result-prefixes="marc items">
9 <xsl:import href="MARC21slimUtils.xsl"/>
10 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11 <xsl:template match="/">
12 <xsl:apply-templates/>
15 <xsl:template match="marc:record">
17 <!-- Option: Display Alternate Graphic Representation (MARC 880) -->
18 <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
20 <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
21 <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
22 <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
23 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
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='OPACDisplay856uAsImage']"/>
29 <xsl:variable name="TracingQuotesLeft">
31 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
32 <xsl:otherwise>"</xsl:otherwise>
35 <xsl:variable name="TracingQuotesRight">
37 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
38 <xsl:otherwise>"</xsl:otherwise>
41 <xsl:variable name="leader" select="marc:leader"/>
42 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
43 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
44 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
45 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
46 <xsl:variable name="materialTypeCode">
48 <xsl:when test="$leader19='a'">ST</xsl:when>
49 <xsl:when test="$leader6='a'">
51 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
52 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
53 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
56 <xsl:when test="$leader6='t'">BK</xsl:when>
57 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
58 <xsl:when test="$leader6='m'">CF</xsl:when>
59 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
60 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
61 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
62 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
65 <xsl:variable name="materialTypeLabel">
67 <xsl:when test="$leader19='a'">Set</xsl:when>
68 <xsl:when test="$leader6='a'">
70 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
71 <xsl:when test="$leader7='i' or $leader7='s'">
73 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
74 <xsl:otherwise>Series</xsl:otherwise>
77 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
80 <xsl:when test="$leader6='t'">Book</xsl:when>
81 <xsl:when test="$leader6='o'">Kit</xsl:when>
82 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
83 <xsl:when test="$leader6='m'">Computer file</xsl:when>
84 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
85 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual material</xsl:when>
86 <xsl:when test="$leader6='j'">Music</xsl:when>
87 <xsl:when test="$leader6='i'">Sound</xsl:when>
88 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
92 <!-- Title Statement -->
93 <!-- Alternate Graphic Representation (MARC 880) -->
94 <xsl:if test="$display880">
96 <xsl:call-template name="m880Select">
97 <xsl:with-param name="basetags">245</xsl:with-param>
98 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
103 <xsl:if test="marc:datafield[@tag=245]">
105 <xsl:for-each select="marc:datafield[@tag=245]">
106 <xsl:call-template name="subfieldSelect">
107 <xsl:with-param name="codes">a</xsl:with-param>
109 <xsl:if test="marc:subfield[@code='h']">
110 <xsl:text> </xsl:text>
111 <xsl:call-template name="subfieldSelect">
112 <xsl:with-param name="codes">h</xsl:with-param>
115 <xsl:if test="marc:subfield[@code='b']">
116 <xsl:text> </xsl:text>
117 <xsl:call-template name="subfieldSelect">
118 <xsl:with-param name="codes">b</xsl:with-param>
121 <xsl:text> </xsl:text>
122 <xsl:call-template name="subfieldSelect">
123 <xsl:with-param name="codes">fgknps</xsl:with-param>
129 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
130 <xsl:if test="$display880">
132 <xsl:call-template name="m880Select">
133 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
134 <xsl:with-param name="codes">abc</xsl:with-param>
135 <xsl:with-param name="index">au</xsl:with-param>
136 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
141 <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
142 <h5 class="author">by
143 <xsl:call-template name="showAuthor">
144 <xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111 or @tag=700 or @tag=710 or @tag=711]"/>
145 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
151 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
152 <xsl:if test="$materialTypeCode!=''">
153 <span class="results_summary type"><span class="label">Type: </span>
154 <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element>
155 <xsl:value-of select="$materialTypeLabel"/>
160 <!--Series: Alternate Graphic Representation (MARC 880) -->
161 <xsl:if test="$display880">
162 <xsl:call-template name="m880Select">
163 <xsl:with-param name="basetags">440,490</xsl:with-param>
164 <xsl:with-param name="codes">av</xsl:with-param>
165 <xsl:with-param name="class">results_summary series</xsl:with-param>
166 <xsl:with-param name="label">Series: </xsl:with-param>
167 <xsl:with-param name="index">se</xsl:with-param>
172 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
173 <span class="results_summary series"><span class="label">Series: </span>
175 <xsl:for-each select="marc:datafield[@tag=440]">
176 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
177 <xsl:call-template name="chopPunctuation">
178 <xsl:with-param name="chopString">
179 <xsl:call-template name="subfieldSelect">
180 <xsl:with-param name="codes">av</xsl:with-param>
185 <xsl:call-template name="part"/>
186 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
189 <!-- 490 Series not traced, Ind1 = 0 -->
190 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
191 <a><xsl:attribute name="href">/cgi-bin/koha/opac-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>
203 <!-- 490 Series traced, Ind1 = 1 -->
204 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
205 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
207 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
208 <a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
209 <xsl:call-template name="chopPunctuation">
210 <xsl:with-param name="chopString">
211 <xsl:call-template name="subfieldSelect">
212 <xsl:with-param name="codes">a_t</xsl:with-param>
219 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
220 <xsl:call-template name="chopPunctuation">
221 <xsl:with-param name="chopString">
222 <xsl:call-template name="subfieldSelect">
223 <xsl:with-param name="codes">a_t</xsl:with-param>
228 <xsl:call-template name="part"/>
231 <xsl:text>: </xsl:text>
232 <xsl:value-of select="marc:subfield[@code='v']" />
233 <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/opac-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/opac-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/opac-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/opac-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/opac-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/opac-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 <xsl:if test="marc:datafield[@tag=260]">
307 <span class="results_summary publisher"><span class="label">Publisher: </span>
308 <xsl:for-each select="marc:datafield[@tag=260]">
309 <xsl:if test="marc:subfield[@code='a']">
310 <xsl:call-template name="subfieldSelect">
311 <xsl:with-param name="codes">a</xsl:with-param>
314 <xsl:text> </xsl:text>
315 <xsl:if test="marc:subfield[@code='b']">
316 <a href="/cgi-bin/koha/opac-search.pl?q=pb:{marc:subfield[@code='b']}">
317 <xsl:call-template name="subfieldSelect">
318 <xsl:with-param name="codes">b</xsl:with-param>
322 <xsl:text> </xsl:text>
323 <xsl:call-template name="chopPunctuation">
324 <xsl:with-param name="chopString">
325 <xsl:call-template name="subfieldSelect">
326 <xsl:with-param name="codes">cg</xsl:with-param>
330 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
335 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
336 <xsl:if test="$display880">
337 <xsl:call-template name="m880Select">
338 <xsl:with-param name="basetags">250</xsl:with-param>
339 <xsl:with-param name="codes">ab</xsl:with-param>
340 <xsl:with-param name="class">results_summary edition</xsl:with-param>
341 <xsl:with-param name="label">Edition: </xsl:with-param>
345 <xsl:if test="marc:datafield[@tag=250]">
346 <span class="results_summary edition"><span class="label">Edition: </span>
347 <xsl:for-each select="marc:datafield[@tag=250]">
348 <xsl:call-template name="chopPunctuation">
349 <xsl:with-param name="chopString">
350 <xsl:call-template name="subfieldSelect">
351 <xsl:with-param name="codes">ab</xsl:with-param>
355 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
360 <!-- Description: Alternate Graphic Representation (MARC 880) -->
361 <xsl:if test="$display880">
362 <xsl:call-template name="m880Select">
363 <xsl:with-param name="basetags">300</xsl:with-param>
364 <xsl:with-param name="codes">abceg</xsl:with-param>
365 <xsl:with-param name="class">results_summary description</xsl:with-param>
366 <xsl:with-param name="label">Description: </xsl:with-param>
370 <xsl:if test="marc:datafield[@tag=300]">
371 <span class="results_summary description"><span class="label">Description: </span>
372 <xsl:for-each select="marc:datafield[@tag=300]">
373 <xsl:call-template name="chopPunctuation">
374 <xsl:with-param name="chopString">
375 <xsl:call-template name="subfieldSelect">
376 <xsl:with-param name="codes">abceg</xsl:with-param>
380 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
385 <xsl:if test="marc:datafield[@tag=020]">
386 <span class="results_summary isbn"><span class="label">ISBN: </span>
387 <xsl:for-each select="marc:datafield[@tag=020]">
388 <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
389 <xsl:value-of select="marc:subfield[@code='a']"/>
390 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
395 <xsl:if test="marc:datafield[@tag=022]">
396 <span class="results_summary issn"><span class="label">ISSN: </span>
397 <xsl:for-each select="marc:datafield[@tag=022]">
398 <xsl:value-of select="marc:subfield[@code='a']"/>
399 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
404 <xsl:if test="marc:datafield[@tag=013]">
405 <span class="results_summary patent_info">
406 <span class="label">Patent information: </span>
407 <xsl:for-each select="marc:datafield[@tag=013]">
408 <xsl:call-template name="subfieldSelect">
409 <xsl:with-param name="codes">acdef</xsl:with-param>
410 <xsl:with-param name="delimeter">, </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=088]">
418 <span class="results_summary report_number">
419 <span class="label">Report number: </span>
420 <xsl:for-each select="marc:datafield[@tag=088]">
421 <xsl:call-template name="subfieldSelect">
422 <xsl:with-param name="codes">a</xsl:with-param>
424 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
429 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
430 <xsl:if test="$display880">
431 <xsl:call-template name="m880Select">
432 <xsl:with-param name="basetags">246</xsl:with-param>
433 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
434 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
435 <xsl:with-param name="label">Other title: </xsl:with-param>
439 <xsl:if test="marc:datafield[@tag=246]">
440 <span class="results_summary other_title"><span class="label">Other title: </span>
441 <xsl:for-each select="marc:datafield[@tag=246]">
442 <xsl:call-template name="chopPunctuation">
443 <xsl:with-param name="chopString">
444 <xsl:call-template name="subfieldSelect">
445 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
449 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
455 <xsl:if test="marc:datafield[@tag=242]">
456 <span class="results_summary translated_title"><span class="label">Title translated: </span>
457 <xsl:for-each select="marc:datafield[@tag=242]">
458 <xsl:call-template name="chopPunctuation">
459 <xsl:with-param name="chopString">
460 <xsl:call-template name="subfieldSelect">
461 <xsl:with-param name="codes">abchnp</xsl:with-param>
465 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
470 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
471 <xsl:if test="$display880">
472 <xsl:call-template name="m880Select">
473 <xsl:with-param name="basetags">130,240</xsl:with-param>
474 <xsl:with-param name="codes">adfklmor</xsl:with-param>
475 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
476 <xsl:with-param name="label">Uniform titles: </xsl:with-param>
480 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
481 <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span>
482 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
483 <xsl:variable name="str">
484 <xsl:for-each select="marc:subfield">
485 <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'])))">
486 <xsl:value-of select="text()"/>
487 <xsl:text> </xsl:text>
491 <xsl:call-template name="chopPunctuation">
492 <xsl:with-param name="chopString">
493 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
497 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
502 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
503 <span class="results_summary subjects"><span class="label">Subject(s): </span>
504 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
507 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
508 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
510 <xsl:when test="$TraceSubjectSubdivisions='1'">
511 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
512 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
513 <xsl:with-param name="delimeter"> AND </xsl:with-param>
514 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
515 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
520 <xsl:attribute name="href">/cgi-bin/koha/opac-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>
523 <xsl:call-template name="chopPunctuation">
524 <xsl:with-param name="chopString">
525 <xsl:call-template name="subfieldSelect">
526 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
527 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
528 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
533 <xsl:if test="marc:subfield[@code=9]">
535 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
536 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
540 <xsl:when test="position()=last()"></xsl:when>
541 <xsl:otherwise> | </xsl:otherwise>
548 <!-- Image processing code added here, takes precedence over text links including y3z text -->
549 <xsl:if test="marc:datafield[@tag=856]">
550 <span class="results_summary online_resources"><span class="label">Online resources: </span>
551 <xsl:for-each select="marc:datafield[@tag=856]">
552 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
553 <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
554 <xsl:if test="$OPACURLOpenInNewWindow='1'">
555 <xsl:attribute name="target">_blank</xsl:attribute>
558 <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')">
559 <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>
561 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
562 <xsl:call-template name="subfieldSelect">
563 <xsl:with-param name="codes">y3z</xsl:with-param>
566 <xsl:when test="$URLLinkText!=''">
567 <xsl:value-of select="$URLLinkText"/>
570 <xsl:text>Click here to access online</xsl:text>
575 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
576 <xsl:otherwise> | </xsl:otherwise>
583 <xsl:if test="marc:datafield[@tag=530]">
584 <xsl:for-each select="marc:datafield[@tag=530]">
585 <span class="results_summary additionalforms">
586 <xsl:call-template name="subfieldSelect">
587 <xsl:with-param name="codes">abcd</xsl:with-param>
589 <xsl:for-each select="marc:subfield[@code='u']">
590 <a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
591 <xsl:if test="$OPACURLOpenInNewWindow='1'">
592 <xsl:attribute name="target">_blank</xsl:attribute>
594 <xsl:value-of select="text()"/>
602 <xsl:if test="marc:datafield[@tag=505]">
603 <div class="results_summary contents">
604 <xsl:for-each select="marc:datafield[@tag=505]">
605 <xsl:if test="position()=1">
607 <xsl:when test="@ind1=1">
608 <span class="label">Incomplete contents:</span>
610 <xsl:when test="@ind1=2">
611 <span class="label">Partial contents:</span>
614 <span class="label">Contents:</span>
618 <div class='contentblock'>
620 <xsl:when test="@ind2=0">
621 <xsl:call-template name="subfieldSelectSpan">
622 <xsl:with-param name="codes">tru</xsl:with-param>
626 <xsl:call-template name="subfieldSelectSpan">
627 <xsl:with-param name="codes">atru</xsl:with-param>
637 <xsl:if test="marc:datafield[@tag=583]">
638 <xsl:for-each select="marc:datafield[@tag=583]">
639 <xsl:if test="@ind1=1 or @ind1=' '">
640 <span class="results_summary actionnote">
642 <xsl:when test="marc:subfield[@code='z']">
643 <xsl:value-of select="marc:subfield[@code='z']"/>
646 <xsl:call-template name="subfieldSelect">
647 <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
657 <xsl:if test="marc:datafield[@tag=586]">
658 <xsl:for-each select="marc:datafield[@tag=586]">
659 <span class="results_summary awardsnote">
660 <xsl:if test="@ind1=' '">
661 <span class="label">Awards: </span>
663 <xsl:value-of select="marc:subfield[@code='a']"/>
669 <xsl:if test="marc:datafield[@tag=773]">
670 <xsl:for-each select="marc:datafield[@tag=773]">
671 <xsl:if test="@ind1=0">
672 <span class="results_summary in"><span class="label">
674 <xsl:when test="@ind2=' '">
677 <xsl:when test="@ind2=8">
678 <xsl:if test="marc:subfield[@code='i']">
679 <xsl:value-of select="marc:subfield[@code='i']"/>
684 <xsl:variable name="f773">
685 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
686 <xsl:with-param name="codes">a_t</xsl:with-param>
687 </xsl:call-template></xsl:with-param></xsl:call-template>
690 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
691 <a><xsl:attribute name="href">/cgi-bin/koha/opac-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>
692 <xsl:value-of select="translate($f773, '()', '')"/>
694 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
696 <xsl:when test="marc:subfield[@code='0']">
697 <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
698 <xsl:value-of select="$f773"/>
702 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
703 <xsl:value-of select="$f773"/>
705 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
710 <xsl:if test="marc:subfield[@code='n']">
711 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
718 <xsl:for-each select="marc:datafield[@tag=511]">
719 <span class="results_summary summary">
721 <xsl:if test="@ind1=1"><xsl:text>Cast: </xsl:text></xsl:if>
723 <xsl:call-template name="subfieldSelect">
724 <xsl:with-param name="codes">a</xsl:with-param>
729 <xsl:for-each select="marc:datafield[@tag=520]">
730 <span class="results_summary summary"><span class="label">
732 <xsl:when test="@ind1=0"><xsl:text>Subject: </xsl:text></xsl:when>
733 <xsl:when test="@ind1=1"><xsl:text>Review: </xsl:text></xsl:when>
734 <xsl:when test="@ind1=2"><xsl:text>Scope and content: </xsl:text></xsl:when>
735 <xsl:when test="@ind1=3"><xsl:text>Abstract: </xsl:text></xsl:when>
736 <xsl:when test="@ind1=4"><xsl:text>Content advice: </xsl:text></xsl:when>
737 <xsl:otherwise><xsl:text>Summary: </xsl:text></xsl:otherwise>
740 <xsl:call-template name="subfieldSelect">
741 <xsl:with-param name="codes">abcu</xsl:with-param>
746 <!-- 866 textual holdings -->
747 <xsl:if test="marc:datafield[@tag=866]">
748 <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
749 <xsl:for-each select="marc:datafield[@tag=866]">
750 <xsl:call-template name="subfieldSelect">
751 <xsl:with-param name="codes">az</xsl:with-param>
753 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
758 <!-- 775 Other Edition -->
759 <xsl:if test="marc:datafield[@tag=775]">
760 <span class="results_summary other_editions"><span class="label">Other editions: </span>
761 <xsl:for-each select="marc:datafield[@tag=775]">
762 <xsl:variable name="f775">
763 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
764 <xsl:with-param name="codes">a_t</xsl:with-param>
765 </xsl:call-template></xsl:with-param></xsl:call-template>
767 <xsl:if test="marc:subfield[@code='i']">
768 <xsl:call-template name="subfieldSelect">
769 <xsl:with-param name="codes">i</xsl:with-param>
771 <xsl:text>: </xsl:text>
775 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
776 <xsl:attribute name="href">/cgi-bin/koha/opac-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>
779 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
782 <xsl:call-template name="subfieldSelect">
783 <xsl:with-param name="codes">a_t</xsl:with-param>
787 <xsl:when test="position()=last()"></xsl:when>
788 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
795 <xsl:if test="marc:datafield[@tag=780]">
796 <xsl:for-each select="marc:datafield[@tag=780]">
797 <xsl:if test="@ind1=0">
798 <span class="results_summary preceeding_entry">
800 <xsl:when test="@ind2=0">
801 <span class="label">Continues:</span>
803 <xsl:when test="@ind2=1">
804 <span class="label">Continues in part:</span>
806 <xsl:when test="@ind2=2">
807 <span class="label">Supersedes:</span>
809 <xsl:when test="@ind2=3">
810 <span class="label">Supersedes in part:</span>
812 <xsl:when test="@ind2=4">
813 <span class="label">Formed by the union: ... and: ...</span>
815 <xsl:when test="@ind2=5">
816 <span class="label">Absorbed:</span>
818 <xsl:when test="@ind2=6">
819 <span class="label">Absorbed in part:</span>
821 <xsl:when test="@ind2=7">
822 <span class="label">Separated from:</span>
825 <xsl:variable name="f780">
826 <xsl:call-template name="subfieldSelect">
827 <xsl:with-param name="codes">a_t</xsl:with-param>
831 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
832 <a><xsl:attribute name="href">/cgi-bin/koha/opac-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>
833 <xsl:value-of select="translate($f780, '()', '')"/>
837 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
838 <xsl:value-of select="translate($f780, '()', '')"/>
844 <xsl:if test="marc:subfield[@code='n']">
845 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
853 <xsl:if test="marc:datafield[@tag=785]">
854 <xsl:for-each select="marc:datafield[@tag=785]">
855 <xsl:if test="@ind1=0">
856 <span class="results_summary succeeding_entry">
858 <xsl:when test="@ind2=0">
859 <span class="label">Continued by:</span>
861 <xsl:when test="@ind2=1">
862 <span class="label">Continued in part by:</span>
864 <xsl:when test="@ind2=2">
865 <span class="label">Superseded by:</span>
867 <xsl:when test="@ind2=3">
868 <span class="label">Superseded in part by:</span>
870 <xsl:when test="@ind2=4">
871 <span class="label">Absorbed by:</span>
873 <xsl:when test="@ind2=5">
874 <span class="label">Absorbed in part by:</span>
876 <xsl:when test="@ind2=6">
877 <span class="label">Split into .. and ...:</span>
879 <xsl:when test="@ind2=7">
880 <span class="label">Merged with ... to form ...</span>
882 <xsl:when test="@ind2=8">
883 <span class="label">Changed back to:</span>
887 <xsl:variable name="f785">
888 <xsl:call-template name="subfieldSelect">
889 <xsl:with-param name="codes">a_t</xsl:with-param>
894 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
895 <a><xsl:attribute name="href">/cgi-bin/koha/opac-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>
896 <xsl:value-of select="translate($f785, '()', '')"/>
900 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
901 <xsl:value-of select="translate($f785, '()', '')"/>
908 <xsl:if test="marc:subfield[@code='n']">
909 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
918 <xsl:template name="showAuthor">
919 <xsl:param name="authorfield" />
920 <xsl:param name="UseAuthoritiesForTracings" />
921 <xsl:for-each select="$authorfield">
922 <xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose>
924 <xsl:when test="not(@tag=111 or @tag=711)" />
925 <xsl:when test="marc:subfield[@code='n']">
926 <xsl:text> </xsl:text>
927 <xsl:call-template name="subfieldSelect">
928 <xsl:with-param name="codes">n</xsl:with-param>
930 <xsl:text> </xsl:text>
935 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
936 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
939 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
943 <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when>
944 <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
945 <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
947 <!-- add relator code too between brackets-->
948 <xsl:if test="marc:subfield[@code='4' or @code='e']">
949 <span class="relatorcode">
950 <xsl:text> [</xsl:text>
952 <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
953 <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
955 <xsl:text>]</xsl:text>
959 <xsl:if test="marc:subfield[@code=9]">
961 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
962 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
966 <xsl:text>.</xsl:text>
969 <xsl:template name="nameABCDQ">
970 <xsl:call-template name="chopPunctuation">
971 <xsl:with-param name="chopString">
972 <xsl:call-template name="subfieldSelect">
973 <xsl:with-param name="codes">aq</xsl:with-param>
976 <xsl:with-param name="punctuation">
977 <xsl:text>:,;/ </xsl:text>
980 <xsl:call-template name="termsOfAddress"/>
983 <xsl:template name="nameABCDN">
984 <xsl:for-each select="marc:subfield[@code='a']">
985 <xsl:call-template name="chopPunctuation">
986 <xsl:with-param name="chopString" select="."/>
989 <xsl:for-each select="marc:subfield[@code='b']">
990 <xsl:value-of select="."/>
992 <xsl:when test="position() != last()">
993 <xsl:text> -- </xsl:text>
997 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
998 <xsl:call-template name="subfieldSelect">
999 <xsl:with-param name="codes">cdn</xsl:with-param>
1000 </xsl:call-template>
1004 <xsl:template name="nameACDEQ">
1005 <xsl:call-template name="subfieldSelect">
1006 <xsl:with-param name="codes">acdeq</xsl:with-param>
1007 </xsl:call-template>
1009 <xsl:template name="termsOfAddress">
1010 <xsl:if test="marc:subfield[@code='b' or @code='c']">
1011 <xsl:call-template name="chopPunctuation">
1012 <xsl:with-param name="chopString">
1013 <xsl:call-template name="subfieldSelect">
1014 <xsl:with-param name="codes">bc</xsl:with-param>
1015 </xsl:call-template>
1017 </xsl:call-template>
1021 <xsl:template name="part">
1022 <xsl:variable name="partNumber">
1023 <xsl:call-template name="specialSubfieldSelect">
1024 <xsl:with-param name="axis">n</xsl:with-param>
1025 <xsl:with-param name="anyCodes">n</xsl:with-param>
1026 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1027 </xsl:call-template>
1029 <xsl:variable name="partName">
1030 <xsl:call-template name="specialSubfieldSelect">
1031 <xsl:with-param name="axis">p</xsl:with-param>
1032 <xsl:with-param name="anyCodes">p</xsl:with-param>
1033 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1034 </xsl:call-template>
1036 <xsl:if test="string-length(normalize-space($partNumber))">
1037 <xsl:call-template name="chopPunctuation">
1038 <xsl:with-param name="chopString" select="$partNumber"/>
1039 </xsl:call-template>
1041 <xsl:if test="string-length(normalize-space($partName))">
1042 <xsl:call-template name="chopPunctuation">
1043 <xsl:with-param name="chopString" select="$partName"/>
1044 </xsl:call-template>
1048 <xsl:template name="specialSubfieldSelect">
1049 <xsl:param name="anyCodes"/>
1050 <xsl:param name="axis"/>
1051 <xsl:param name="beforeCodes"/>
1052 <xsl:param name="afterCodes"/>
1053 <xsl:variable name="str">
1054 <xsl:for-each select="marc:subfield">
1055 <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])">
1056 <xsl:value-of select="text()"/>
1057 <xsl:text> </xsl:text>
1061 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>