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"/>
12 <xsl:template match="/">
13 <xsl:apply-templates/>
16 <xsl:template match="marc:record">
18 <!-- Option: Display Alternate Graphic Representation (MARC 880) -->
19 <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
21 <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
22 <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
23 <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
24 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
26 <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
27 <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
28 <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
29 <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/>
30 <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/>
31 <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
32 <xsl:variable name="TracingQuotesLeft">
34 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">{</xsl:when>
35 <xsl:otherwise>"</xsl:otherwise>
38 <xsl:variable name="TracingQuotesRight">
40 <xsl:when test="marc:sysprefs/marc:syspref[@name='UseICU']='1'">}</xsl:when>
41 <xsl:otherwise>"</xsl:otherwise>
44 <xsl:variable name="leader" select="marc:leader"/>
45 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
46 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
47 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
48 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
49 <xsl:variable name="materialTypeCode">
51 <xsl:when test="$leader19='a'">ST</xsl:when>
52 <xsl:when test="$leader6='a'">
54 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
55 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
56 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
59 <xsl:when test="$leader6='t'">BK</xsl:when>
60 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
61 <xsl:when test="$leader6='m'">CF</xsl:when>
62 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
63 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
64 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
65 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
68 <xsl:variable name="materialTypeLabel">
70 <xsl:when test="$leader19='a'">Set</xsl:when>
71 <xsl:when test="$leader6='a'">
73 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
74 <xsl:when test="$leader7='i' or $leader7='s'">
76 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
77 <xsl:otherwise>Series</xsl:otherwise>
80 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
83 <xsl:when test="$leader6='t'">Book</xsl:when>
84 <xsl:when test="$leader6='o'">Kit</xsl:when>
85 <xsl:when test="$leader6='p'">Mixed materials</xsl:when>
86 <xsl:when test="$leader6='m'">Computer file</xsl:when>
87 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
88 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual material</xsl:when>
89 <xsl:when test="$leader6='j'">Music</xsl:when>
90 <xsl:when test="$leader6='i'">Sound</xsl:when>
91 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
95 <!-- Schema.org type -->
96 <xsl:variable name="schemaOrgType">
98 <xsl:when test="$materialTypeLabel='Book'">Book</xsl:when>
99 <xsl:when test="$materialTypeLabel='Map'">Map</xsl:when>
100 <xsl:when test="$materialTypeLabel='Music'">MusicAlbum</xsl:when>
101 <xsl:otherwise>CreativeWork</xsl:otherwise>
105 <!-- Wrapper div for our schema.org object -->
106 <xsl:element name="div">
107 <xsl:attribute name="class">record</xsl:attribute>
108 <xsl:attribute name="vocab">http://schema.org/</xsl:attribute>
109 <xsl:attribute name="typeof"><xsl:value-of select='$schemaOrgType' /> Product</xsl:attribute>
110 <xsl:attribute name="resource">#record</xsl:attribute>
112 <!-- Title Statement -->
113 <!-- Alternate Graphic Representation (MARC 880) -->
114 <xsl:if test="$display880">
115 <h1 class="title" property="alternativeHeadline">
116 <xsl:call-template name="m880Select">
117 <xsl:with-param name="basetags">245</xsl:with-param>
118 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
123 <xsl:if test="marc:datafield[@tag=245]">
124 <h1 class="title" property="name">
125 <xsl:for-each select="marc:datafield[@tag=245]">
126 <xsl:call-template name="subfieldSelect">
127 <xsl:with-param name="codes">a</xsl:with-param>
129 <xsl:if test="marc:subfield[@code='h']">
130 <xsl:text> </xsl:text>
131 <xsl:call-template name="subfieldSelect">
132 <xsl:with-param name="codes">h</xsl:with-param>
135 <xsl:if test="marc:subfield[@code='b']">
136 <xsl:text> </xsl:text>
137 <xsl:call-template name="subfieldSelect">
138 <xsl:with-param name="codes">b</xsl:with-param>
141 <xsl:text> </xsl:text>
142 <xsl:call-template name="subfieldSelect">
143 <xsl:with-param name="codes">fgknps</xsl:with-param>
149 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
150 <xsl:if test="$display880">
152 <xsl:call-template name="m880Select">
153 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
154 <xsl:with-param name="codes">abc</xsl:with-param>
155 <xsl:with-param name="index">au</xsl:with-param>
156 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
161 <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]">
162 <h5 class="author" property="author">by
163 <xsl:call-template name="showAuthor">
164 <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]"/>
165 <xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
171 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
172 <xsl:if test="$materialTypeCode!=''">
173 <span class="results_summary type"><span class="label">Type: </span>
174 <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>
175 <xsl:value-of select="$materialTypeLabel"/>
180 <!--Series: Alternate Graphic Representation (MARC 880) -->
181 <xsl:if test="$display880">
182 <xsl:call-template name="m880Select">
183 <xsl:with-param name="basetags">440,490</xsl:with-param>
184 <xsl:with-param name="codes">av</xsl:with-param>
185 <xsl:with-param name="class">results_summary series</xsl:with-param>
186 <xsl:with-param name="label">Series: </xsl:with-param>
187 <xsl:with-param name="index">se</xsl:with-param>
192 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
193 <span class="results_summary series"><span class="label">Series: </span>
195 <xsl:for-each select="marc:datafield[@tag=440]">
196 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
197 <xsl:call-template name="chopPunctuation">
198 <xsl:with-param name="chopString">
199 <xsl:call-template name="subfieldSelect">
200 <xsl:with-param name="codes">av</xsl:with-param>
205 <xsl:call-template name="part"/>
206 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
209 <!-- 490 Series not traced, Ind1 = 0 -->
210 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
211 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
212 <xsl:call-template name="chopPunctuation">
213 <xsl:with-param name="chopString">
214 <xsl:call-template name="subfieldSelect">
215 <xsl:with-param name="codes">av</xsl:with-param>
220 <xsl:call-template name="part"/>
221 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
223 <!-- 490 Series traced, Ind1 = 1 -->
224 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
225 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
227 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
228 <a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
229 <xsl:call-template name="chopPunctuation">
230 <xsl:with-param name="chopString">
231 <xsl:call-template name="subfieldSelect">
232 <xsl:with-param name="codes">a_t</xsl:with-param>
239 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
240 <xsl:call-template name="chopPunctuation">
241 <xsl:with-param name="chopString">
242 <xsl:call-template name="subfieldSelect">
243 <xsl:with-param name="codes">a_t</xsl:with-param>
248 <xsl:call-template name="part"/>
251 <xsl:text>: </xsl:text>
252 <xsl:value-of select="marc:subfield[@code='v']" />
253 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
260 <xsl:if test="$leader7='s'">
261 <span class="results_summary analytics"><span class="label">Analytics: </span>
264 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
265 <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>
268 <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>
271 <xsl:text>Show analytics</xsl:text>
276 <!-- Volumes of sets and traced series -->
277 <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
278 <span class="results_summary volumes"><span class="label">Volumes: </span>
281 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
282 <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>
285 <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>
288 <xsl:text>Show volumes</xsl:text>
294 <xsl:if test="$leader19='c'">
295 <span class="results_summary set"><span class="label">Set: </span>
296 <xsl:for-each select="marc:datafield[@tag=773]">
299 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
300 <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>
303 <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>
306 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
309 <xsl:when test="position()=last()"></xsl:when>
310 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
316 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
317 <xsl:if test="$display880">
318 <xsl:call-template name="m880Select">
319 <xsl:with-param name="basetags">260</xsl:with-param>
320 <xsl:with-param name="codes">abcg</xsl:with-param>
321 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
322 <xsl:with-param name="label">Publisher: </xsl:with-param>
326 <xsl:if test="marc:datafield[@tag=260]">
327 <span class="results_summary publisher"><span class="label">Publisher: </span>
328 <xsl:for-each select="marc:datafield[@tag=260]">
329 <span property="publisher" typeof="Organization">
330 <xsl:if test="marc:subfield[@code='a']">
331 <span property="location">
332 <xsl:call-template name="subfieldSelect">
333 <xsl:with-param name="codes">a</xsl:with-param>
337 <xsl:text> </xsl:text>
338 <xsl:if test="marc:subfield[@code='b']">
339 <span property="name"><a href="/cgi-bin/koha/opac-search.pl?q=pb:{marc:subfield[@code='b']}">
340 <xsl:call-template name="subfieldSelect">
341 <xsl:with-param name="codes">b</xsl:with-param>
346 <xsl:text> </xsl:text>
347 <xsl:if test="marc:subfield[@code='c' or @code='g']">
348 <span property="datePublished">
349 <xsl:call-template name="chopPunctuation">
350 <xsl:with-param name="chopString">
351 <xsl:call-template name="subfieldSelect">
352 <xsl:with-param name="codes">cg</xsl:with-param>
358 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
363 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
364 <xsl:if test="$display880">
365 <xsl:call-template name="m880Select">
366 <xsl:with-param name="basetags">250</xsl:with-param>
367 <xsl:with-param name="codes">ab</xsl:with-param>
368 <xsl:with-param name="class">results_summary edition</xsl:with-param>
369 <xsl:with-param name="label">Edition: </xsl:with-param>
373 <xsl:if test="marc:datafield[@tag=250]">
374 <span class="results_summary edition"><span class="label">Edition: </span>
375 <xsl:for-each select="marc:datafield[@tag=250]">
376 <span property="bookEdition">
377 <xsl:call-template name="chopPunctuation">
378 <xsl:with-param name="chopString">
379 <xsl:call-template name="subfieldSelect">
380 <xsl:with-param name="codes">ab</xsl:with-param>
385 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
390 <!-- Description: Alternate Graphic Representation (MARC 880) -->
391 <xsl:if test="$display880">
392 <xsl:call-template name="m880Select">
393 <xsl:with-param name="basetags">300</xsl:with-param>
394 <xsl:with-param name="codes">abceg</xsl:with-param>
395 <xsl:with-param name="class">results_summary description</xsl:with-param>
396 <xsl:with-param name="label">Description: </xsl:with-param>
400 <xsl:if test="marc:datafield[@tag=300]">
401 <span class="results_summary description"><span class="label">Description: </span>
402 <xsl:for-each select="marc:datafield[@tag=300]">
403 <span property="description">
404 <xsl:call-template name="chopPunctuation">
405 <xsl:with-param name="chopString">
406 <xsl:call-template name="subfieldSelect">
407 <xsl:with-param name="codes">abceg</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=020]">
418 <span class="results_summary isbn"><span class="label">ISBN: </span>
419 <xsl:for-each select="marc:datafield[@tag=020]">
420 <span property="isbn">
421 <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
422 <xsl:value-of select="marc:subfield[@code='a']"/>
423 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
429 <xsl:if test="marc:datafield[@tag=022]">
430 <span class="results_summary issn"><span class="label">ISSN: </span>
431 <xsl:for-each select="marc:datafield[@tag=022]">
432 <xsl:value-of select="marc:subfield[@code='a']"/>
433 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
438 <xsl:if test="marc:datafield[@tag=013]">
439 <span class="results_summary patent_info">
440 <span class="label">Patent information: </span>
441 <xsl:for-each select="marc:datafield[@tag=013]">
442 <xsl:call-template name="subfieldSelect">
443 <xsl:with-param name="codes">acdef</xsl:with-param>
444 <xsl:with-param name="delimeter">, </xsl:with-param>
446 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
451 <xsl:if test="marc:datafield[@tag=088]">
452 <span class="results_summary report_number">
453 <span class="label">Report number: </span>
454 <xsl:for-each select="marc:datafield[@tag=088]">
455 <xsl:call-template name="subfieldSelect">
456 <xsl:with-param name="codes">a</xsl:with-param>
458 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
463 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
464 <xsl:if test="$display880">
465 <xsl:call-template name="m880Select">
466 <xsl:with-param name="basetags">246</xsl:with-param>
467 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
468 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
469 <xsl:with-param name="label">Other title: </xsl:with-param>
473 <xsl:if test="marc:datafield[@tag=246]">
474 <span class="results_summary other_title"><span class="label">Other title: </span>
475 <xsl:for-each select="marc:datafield[@tag=246]">
476 <span property="alternativeHeadline">
477 <xsl:call-template name="chopPunctuation">
478 <xsl:with-param name="chopString">
479 <xsl:call-template name="subfieldSelect">
480 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
485 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
491 <xsl:if test="marc:datafield[@tag=242]">
492 <span class="results_summary translated_title"><span class="label">Title translated: </span>
493 <xsl:for-each select="marc:datafield[@tag=242]">
494 <span property="alternativeHeadline">
495 <xsl:call-template name="chopPunctuation">
496 <xsl:with-param name="chopString">
497 <xsl:call-template name="subfieldSelect">
498 <xsl:with-param name="codes">abchnp</xsl:with-param>
503 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
508 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
509 <xsl:if test="$display880">
510 <span property="alternativeHeadline">
511 <xsl:call-template name="m880Select">
512 <xsl:with-param name="basetags">130,240</xsl:with-param>
513 <xsl:with-param name="codes">adfklmor</xsl:with-param>
514 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
515 <xsl:with-param name="label">Uniform titles: </xsl:with-param>
520 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
521 <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span>
522 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
523 <span property="alternativeHeadline">
524 <xsl:variable name="str">
525 <xsl:for-each select="marc:subfield">
526 <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'])))">
527 <xsl:value-of select="text()"/>
528 <xsl:text> </xsl:text>
532 <xsl:call-template name="chopPunctuation">
533 <xsl:with-param name="chopString">
534 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
539 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
544 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
545 <span class="results_summary subjects"><span class="label">Subject(s): </span>
546 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
547 <span property="keywords">
550 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
551 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
553 <xsl:when test="$TraceSubjectSubdivisions='1'">
554 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
555 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
556 <xsl:with-param name="delimeter"> AND </xsl:with-param>
557 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
558 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
563 <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>
566 <xsl:call-template name="chopPunctuation">
567 <xsl:with-param name="chopString">
568 <xsl:call-template name="subfieldSelect">
569 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
570 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
571 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
577 <xsl:if test="marc:subfield[@code=9]">
579 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
580 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
584 <xsl:when test="position()=last()"></xsl:when>
585 <xsl:otherwise> | </xsl:otherwise>
592 <!-- Image processing code added here, takes precedence over text links including y3z text -->
593 <xsl:if test="marc:datafield[@tag=856]">
594 <span class="results_summary online_resources"><span class="label">Online resources: </span>
595 <xsl:for-each select="marc:datafield[@tag=856]">
596 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
599 <xsl:when test="$OPACTrackClicks='track'">
600 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
602 <xsl:when test="$OPACTrackClicks='anonymous'">
603 <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
606 <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
609 <xsl:if test="$OPACURLOpenInNewWindow='1'">
610 <xsl:attribute name="target">_blank</xsl:attribute>
613 <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')">
614 <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>
616 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
617 <xsl:call-template name="subfieldSelect">
618 <xsl:with-param name="codes">y3z</xsl:with-param>
621 <xsl:when test="$URLLinkText!=''">
622 <xsl:value-of select="$URLLinkText"/>
625 <xsl:text>Click here to access online</xsl:text>
630 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
631 <xsl:otherwise> | </xsl:otherwise>
638 <xsl:if test="marc:datafield[@tag=530]">
639 <xsl:for-each select="marc:datafield[@tag=530]">
640 <span class="results_summary additionalforms">
641 <xsl:call-template name="subfieldSelect">
642 <xsl:with-param name="codes">abcd</xsl:with-param>
644 <xsl:for-each select="marc:subfield[@code='u']">
645 <a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
646 <xsl:if test="$OPACURLOpenInNewWindow='1'">
647 <xsl:attribute name="target">_blank</xsl:attribute>
649 <xsl:value-of select="text()"/>
657 <xsl:if test="marc:datafield[@tag=505]">
658 <div class="results_summary contents">
659 <xsl:for-each select="marc:datafield[@tag=505]">
660 <xsl:if test="position()=1">
662 <xsl:when test="@ind1=1">
663 <span class="label">Incomplete contents:</span>
665 <xsl:when test="@ind1=2">
666 <span class="label">Partial contents:</span>
669 <span class="label">Contents:</span>
673 <div class='contentblock' property='description'>
675 <xsl:when test="@ind2=0">
676 <xsl:call-template name="subfieldSelectSpan">
677 <xsl:with-param name="codes">tru</xsl:with-param>
681 <xsl:call-template name="subfieldSelectSpan">
682 <xsl:with-param name="codes">atru</xsl:with-param>
692 <xsl:if test="marc:datafield[@tag=583]">
693 <xsl:for-each select="marc:datafield[@tag=583]">
694 <xsl:if test="@ind1=1 or @ind1=' '">
695 <span class="results_summary actionnote">
697 <xsl:when test="marc:subfield[@code='z']">
698 <xsl:value-of select="marc:subfield[@code='z']"/>
701 <xsl:call-template name="subfieldSelect">
702 <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
712 <xsl:if test="marc:datafield[@tag=586]">
713 <xsl:for-each select="marc:datafield[@tag=586]">
714 <span class="results_summary awardsnote">
715 <xsl:if test="@ind1=' '">
716 <span class="label">Awards: </span>
718 <xsl:value-of select="marc:subfield[@code='a']"/>
724 <xsl:if test="marc:datafield[@tag=773]">
725 <xsl:for-each select="marc:datafield[@tag=773]">
726 <xsl:if test="@ind1=0">
727 <span class="results_summary in"><span class="label">
729 <xsl:when test="@ind2=' '">
732 <xsl:when test="@ind2=8">
733 <xsl:if test="marc:subfield[@code='i']">
734 <xsl:value-of select="marc:subfield[@code='i']"/>
739 <xsl:variable name="f773">
740 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
741 <xsl:with-param name="codes">a_t</xsl:with-param>
742 </xsl:call-template></xsl:with-param></xsl:call-template>
745 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
746 <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>
747 <xsl:value-of select="translate($f773, '()', '')"/>
749 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
751 <xsl:when test="marc:subfield[@code='0']">
752 <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
753 <xsl:value-of select="$f773"/>
757 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
758 <xsl:value-of select="$f773"/>
760 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
765 <xsl:if test="marc:subfield[@code='n']">
766 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
773 <xsl:for-each select="marc:datafield[@tag=511]">
774 <span class="results_summary perf_note">
776 <xsl:if test="@ind1=1"><xsl:text>Cast: </xsl:text></xsl:if>
778 <xsl:call-template name="subfieldSelect">
779 <xsl:with-param name="codes">a</xsl:with-param>
784 <xsl:if test="marc:datafield[@tag=502]">
785 <span class="results_summary diss_note">
786 <span class="label">Dissertation note: </span>
787 <xsl:for-each select="marc:datafield[@tag=502]">
788 <xsl:call-template name="subfieldSelect">
789 <xsl:with-param name="codes">abcdgo</xsl:with-param>
792 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
796 <xsl:for-each select="marc:datafield[@tag=520]">
797 <span class="results_summary summary"><span class="label">
799 <xsl:when test="@ind1=0"><xsl:text>Subject: </xsl:text></xsl:when>
800 <xsl:when test="@ind1=1"><xsl:text>Review: </xsl:text></xsl:when>
801 <xsl:when test="@ind1=2"><xsl:text>Scope and content: </xsl:text></xsl:when>
802 <xsl:when test="@ind1=3"><xsl:text>Abstract: </xsl:text></xsl:when>
803 <xsl:when test="@ind1=4"><xsl:text>Content advice: </xsl:text></xsl:when>
804 <xsl:otherwise><xsl:text>Summary: </xsl:text></xsl:otherwise>
807 <xsl:call-template name="subfieldSelect">
808 <xsl:with-param name="codes">abcu</xsl:with-param>
813 <!-- 866 textual holdings -->
814 <xsl:if test="marc:datafield[@tag=866]">
815 <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
816 <xsl:for-each select="marc:datafield[@tag=866]">
817 <xsl:call-template name="subfieldSelect">
818 <xsl:with-param name="codes">az</xsl:with-param>
820 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
825 <!-- 775 Other Edition -->
826 <xsl:if test="marc:datafield[@tag=775]">
827 <span class="results_summary other_editions"><span class="label">Other editions: </span>
828 <xsl:for-each select="marc:datafield[@tag=775]">
829 <xsl:variable name="f775">
830 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
831 <xsl:with-param name="codes">a_t</xsl:with-param>
832 </xsl:call-template></xsl:with-param></xsl:call-template>
834 <xsl:if test="marc:subfield[@code='i']">
835 <xsl:call-template name="subfieldSelect">
836 <xsl:with-param name="codes">i</xsl:with-param>
838 <xsl:text>: </xsl:text>
842 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
843 <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>
846 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
849 <xsl:call-template name="subfieldSelect">
850 <xsl:with-param name="codes">a_t</xsl:with-param>
854 <xsl:when test="position()=last()"></xsl:when>
855 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
862 <xsl:if test="marc:datafield[@tag=780]">
863 <xsl:for-each select="marc:datafield[@tag=780]">
864 <xsl:if test="@ind1=0">
865 <span class="results_summary preceeding_entry">
867 <xsl:when test="@ind2=0">
868 <span class="label">Continues:</span>
870 <xsl:when test="@ind2=1">
871 <span class="label">Continues in part:</span>
873 <xsl:when test="@ind2=2">
874 <span class="label">Supersedes:</span>
876 <xsl:when test="@ind2=3">
877 <span class="label">Supersedes in part:</span>
879 <xsl:when test="@ind2=4">
880 <span class="label">Formed by the union: ... and: ...</span>
882 <xsl:when test="@ind2=5">
883 <span class="label">Absorbed:</span>
885 <xsl:when test="@ind2=6">
886 <span class="label">Absorbed in part:</span>
888 <xsl:when test="@ind2=7">
889 <span class="label">Separated from:</span>
892 <xsl:text> </xsl:text>
893 <xsl:variable name="f780">
894 <xsl:call-template name="subfieldSelect">
895 <xsl:with-param name="codes">a_t</xsl:with-param>
899 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
900 <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>
901 <xsl:value-of select="translate($f780, '()', '')"/>
905 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
906 <xsl:value-of select="translate($f780, '()', '')"/>
912 <xsl:if test="marc:subfield[@code='n']">
913 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
921 <xsl:if test="marc:datafield[@tag=785]">
922 <xsl:for-each select="marc:datafield[@tag=785]">
923 <xsl:if test="@ind1=0">
924 <span class="results_summary succeeding_entry">
926 <xsl:when test="@ind2=0">
927 <span class="label">Continued by:</span>
929 <xsl:when test="@ind2=1">
930 <span class="label">Continued in part by:</span>
932 <xsl:when test="@ind2=2">
933 <span class="label">Superseded by:</span>
935 <xsl:when test="@ind2=3">
936 <span class="label">Superseded in part by:</span>
938 <xsl:when test="@ind2=4">
939 <span class="label">Absorbed by:</span>
941 <xsl:when test="@ind2=5">
942 <span class="label">Absorbed in part by:</span>
944 <xsl:when test="@ind2=6">
945 <span class="label">Split into .. and ...:</span>
947 <xsl:when test="@ind2=7">
948 <span class="label">Merged with ... to form ...</span>
950 <xsl:when test="@ind2=8">
951 <span class="label">Changed back to:</span>
954 <xsl:text> </xsl:text>
955 <xsl:variable name="f785">
956 <xsl:call-template name="subfieldSelect">
957 <xsl:with-param name="codes">a_t</xsl:with-param>
962 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
963 <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>
964 <xsl:value-of select="translate($f785, '()', '')"/>
968 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
969 <xsl:value-of select="translate($f785, '()', '')"/>
976 <xsl:if test="marc:subfield[@code='n']">
977 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
987 <xsl:template name="showAuthor">
988 <xsl:param name="authorfield" />
989 <xsl:param name="UseAuthoritiesForTracings" />
990 <xsl:for-each select="$authorfield">
991 <xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose>
993 <xsl:when test="not(@tag=111 or @tag=711)" />
994 <xsl:when test="marc:subfield[@code='n']">
995 <xsl:text> </xsl:text>
996 <xsl:call-template name="subfieldSelect">
997 <xsl:with-param name="codes">n</xsl:with-param>
999 <xsl:text> </xsl:text>
1004 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1005 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:"<xsl:value-of select="marc:subfield[@code=9]"/>"</xsl:attribute>
1008 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
1012 <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCQ"/></xsl:when>
1013 <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
1014 <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
1016 <!-- add relator code too between brackets-->
1017 <xsl:if test="marc:subfield[@code='4' or @code='e']">
1018 <span class="relatorcode">
1019 <xsl:text> [</xsl:text>
1021 <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
1022 <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
1024 <xsl:text>]</xsl:text>
1028 <xsl:if test="marc:subfield[@code=9]">
1029 <a class='authlink'>
1030 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
1031 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
1035 <xsl:text>.</xsl:text>
1038 <xsl:template name="nameABCQ">
1039 <xsl:call-template name="chopPunctuation">
1040 <xsl:with-param name="chopString">
1041 <xsl:call-template name="subfieldSelect">
1042 <xsl:with-param name="codes">abcq</xsl:with-param>
1043 </xsl:call-template>
1045 <xsl:with-param name="punctuation">
1046 <xsl:text>:,;/ </xsl:text>
1048 </xsl:call-template>
1051 <xsl:template name="nameABCDN">
1052 <xsl:for-each select="marc:subfield[@code='a']">
1053 <xsl:call-template name="chopPunctuation">
1054 <xsl:with-param name="chopString" select="."/>
1055 </xsl:call-template>
1057 <xsl:for-each select="marc:subfield[@code='b']">
1058 <xsl:value-of select="."/>
1060 <xsl:when test="position() != last()">
1061 <xsl:text> -- </xsl:text>
1065 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
1066 <xsl:call-template name="subfieldSelect">
1067 <xsl:with-param name="codes">cdn</xsl:with-param>
1068 </xsl:call-template>
1072 <xsl:template name="nameACDEQ">
1073 <xsl:call-template name="subfieldSelect">
1074 <xsl:with-param name="codes">acdeq</xsl:with-param>
1075 </xsl:call-template>
1078 <xsl:template name="part">
1079 <xsl:variable name="partNumber">
1080 <xsl:call-template name="specialSubfieldSelect">
1081 <xsl:with-param name="axis">n</xsl:with-param>
1082 <xsl:with-param name="anyCodes">n</xsl:with-param>
1083 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1084 </xsl:call-template>
1086 <xsl:variable name="partName">
1087 <xsl:call-template name="specialSubfieldSelect">
1088 <xsl:with-param name="axis">p</xsl:with-param>
1089 <xsl:with-param name="anyCodes">p</xsl:with-param>
1090 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1091 </xsl:call-template>
1093 <xsl:if test="string-length(normalize-space($partNumber))">
1094 <xsl:call-template name="chopPunctuation">
1095 <xsl:with-param name="chopString" select="$partNumber"/>
1096 </xsl:call-template>
1098 <xsl:if test="string-length(normalize-space($partName))">
1099 <xsl:call-template name="chopPunctuation">
1100 <xsl:with-param name="chopString" select="$partName"/>
1101 </xsl:call-template>
1105 <xsl:template name="specialSubfieldSelect">
1106 <xsl:param name="anyCodes"/>
1107 <xsl:param name="axis"/>
1108 <xsl:param name="beforeCodes"/>
1109 <xsl:param name="afterCodes"/>
1110 <xsl:variable name="str">
1111 <xsl:for-each select="marc:subfield">
1112 <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])">
1113 <xsl:value-of select="text()"/>
1114 <xsl:text> </xsl:text>
1118 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>