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="alternateName">
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">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"/>
166 <xsl:with-param name="materialTypeLabel" select="$materialTypeLabel"/>
172 <xsl:if test="$DisplayOPACiconsXSLT!='0'">
173 <xsl:if test="$materialTypeCode!=''">
174 <span class="results_summary type"><span class="label">Type: </span>
175 <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>
176 <xsl:value-of select="$materialTypeLabel"/>
181 <!--Series: Alternate Graphic Representation (MARC 880) -->
182 <xsl:if test="$display880">
183 <xsl:call-template name="m880Select">
184 <xsl:with-param name="basetags">440,490</xsl:with-param>
185 <xsl:with-param name="codes">av</xsl:with-param>
186 <xsl:with-param name="class">results_summary series</xsl:with-param>
187 <xsl:with-param name="label">Series: </xsl:with-param>
188 <xsl:with-param name="index">se</xsl:with-param>
193 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
194 <span class="results_summary series"><span class="label">Series: </span>
196 <xsl:for-each select="marc:datafield[@tag=440]">
197 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
198 <xsl:call-template name="chopPunctuation">
199 <xsl:with-param name="chopString">
200 <xsl:call-template name="subfieldSelect">
201 <xsl:with-param name="codes">av</xsl:with-param>
206 <xsl:call-template name="part"/>
207 <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
210 <!-- 490 Series not traced, Ind1 = 0 -->
211 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
212 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
213 <xsl:call-template name="chopPunctuation">
214 <xsl:with-param name="chopString">
215 <xsl:call-template name="subfieldSelect">
216 <xsl:with-param name="codes">av</xsl:with-param>
221 <xsl:call-template name="part"/>
222 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
224 <!-- 490 Series traced, Ind1 = 1 -->
225 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
226 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
228 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
229 <a href="/cgi-bin/koha/opac-search.pl?q=rcn:{marc:subfield[@code='w']}">
230 <xsl:call-template name="chopPunctuation">
231 <xsl:with-param name="chopString">
232 <xsl:call-template name="subfieldSelect">
233 <xsl:with-param name="codes">a_t</xsl:with-param>
240 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=se,phr:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
241 <xsl:call-template name="chopPunctuation">
242 <xsl:with-param name="chopString">
243 <xsl:call-template name="subfieldSelect">
244 <xsl:with-param name="codes">a_t</xsl:with-param>
249 <xsl:call-template name="part"/>
252 <xsl:text>: </xsl:text>
253 <xsl:value-of select="marc:subfield[@code='v']" />
254 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
261 <xsl:if test="$leader7='s'">
262 <span class="results_summary analytics"><span class="label">Analytics: </span>
265 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
266 <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>
269 <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>
272 <xsl:text>Show analytics</xsl:text>
277 <!-- Volumes of sets and traced series -->
278 <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
279 <span class="results_summary volumes"><span class="label">Volumes: </span>
282 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
283 <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>
286 <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>
289 <xsl:text>Show volumes</xsl:text>
295 <xsl:if test="$leader19='c'">
296 <span class="results_summary set"><span class="label">Set: </span>
297 <xsl:for-each select="marc:datafield[@tag=773]">
300 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
301 <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>
304 <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>
307 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
310 <xsl:when test="position()=last()"></xsl:when>
311 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
317 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
318 <xsl:if test="$display880">
319 <xsl:call-template name="m880Select">
320 <xsl:with-param name="basetags">260</xsl:with-param>
321 <xsl:with-param name="codes">abcg</xsl:with-param>
322 <xsl:with-param name="class">results_summary publisher</xsl:with-param>
323 <xsl:with-param name="label">Publisher: </xsl:with-param>
327 <xsl:if test="marc:datafield[@tag=260]">
328 <span class="results_summary publisher"><span class="label">Publisher: </span>
329 <xsl:for-each select="marc:datafield[@tag=260]">
330 <span property="publisher" typeof="Organization">
331 <xsl:if test="marc:subfield[@code='a']">
332 <span property="location">
333 <xsl:call-template name="subfieldSelect">
334 <xsl:with-param name="codes">a</xsl:with-param>
338 <xsl:text> </xsl:text>
339 <xsl:if test="marc:subfield[@code='b']">
340 <span property="name"><a href="/cgi-bin/koha/opac-search.pl?q=pb:{marc:subfield[@code='b']}">
341 <xsl:call-template name="subfieldSelect">
342 <xsl:with-param name="codes">b</xsl:with-param>
347 <xsl:text> </xsl:text>
348 <xsl:if test="marc:subfield[@code='c' or @code='g']">
349 <span property="datePublished">
350 <xsl:call-template name="chopPunctuation">
351 <xsl:with-param name="chopString">
352 <xsl:call-template name="subfieldSelect">
353 <xsl:with-param name="codes">cg</xsl:with-param>
359 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
364 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
365 <xsl:if test="$display880">
366 <xsl:call-template name="m880Select">
367 <xsl:with-param name="basetags">250</xsl:with-param>
368 <xsl:with-param name="codes">ab</xsl:with-param>
369 <xsl:with-param name="class">results_summary edition</xsl:with-param>
370 <xsl:with-param name="label">Edition: </xsl:with-param>
374 <xsl:if test="marc:datafield[@tag=250]">
375 <span class="results_summary edition"><span class="label">Edition: </span>
376 <xsl:for-each select="marc:datafield[@tag=250]">
377 <span property="bookEdition">
378 <xsl:call-template name="chopPunctuation">
379 <xsl:with-param name="chopString">
380 <xsl:call-template name="subfieldSelect">
381 <xsl:with-param name="codes">ab</xsl:with-param>
386 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
391 <!-- Description: Alternate Graphic Representation (MARC 880) -->
392 <xsl:if test="$display880">
393 <xsl:call-template name="m880Select">
394 <xsl:with-param name="basetags">300</xsl:with-param>
395 <xsl:with-param name="codes">abceg</xsl:with-param>
396 <xsl:with-param name="class">results_summary description</xsl:with-param>
397 <xsl:with-param name="label">Description: </xsl:with-param>
401 <xsl:if test="marc:datafield[@tag=300]">
402 <span class="results_summary description"><span class="label">Description: </span>
403 <xsl:for-each select="marc:datafield[@tag=300]">
404 <span property="description">
405 <xsl:call-template name="chopPunctuation">
406 <xsl:with-param name="chopString">
407 <xsl:call-template name="subfieldSelect">
408 <xsl:with-param name="codes">abceg</xsl:with-param>
413 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
418 <xsl:if test="marc:datafield[@tag=020]">
419 <span class="results_summary isbn"><span class="label">ISBN: </span>
420 <xsl:for-each select="marc:datafield[@tag=020]">
421 <span property="isbn">
422 <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
423 <xsl:value-of select="marc:subfield[@code='a']"/>
424 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
430 <xsl:if test="marc:datafield[@tag=022]">
431 <span class="results_summary issn"><span class="label">ISSN: </span>
432 <xsl:for-each select="marc:datafield[@tag=022]">
433 <xsl:value-of select="marc:subfield[@code='a']"/>
434 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
439 <xsl:if test="marc:datafield[@tag=013]">
440 <span class="results_summary patent_info">
441 <span class="label">Patent information: </span>
442 <xsl:for-each select="marc:datafield[@tag=013]">
443 <xsl:call-template name="subfieldSelect">
444 <xsl:with-param name="codes">acdef</xsl:with-param>
445 <xsl:with-param name="delimeter">, </xsl:with-param>
447 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
452 <xsl:if test="marc:datafield[@tag=088]">
453 <span class="results_summary report_number">
454 <span class="label">Report number: </span>
455 <xsl:for-each select="marc:datafield[@tag=088]">
456 <xsl:call-template name="subfieldSelect">
457 <xsl:with-param name="codes">a</xsl:with-param>
459 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
464 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
465 <xsl:if test="$display880">
466 <xsl:call-template name="m880Select">
467 <xsl:with-param name="basetags">246</xsl:with-param>
468 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
469 <xsl:with-param name="class">results_summary other_title</xsl:with-param>
470 <xsl:with-param name="label">Other title: </xsl:with-param>
474 <xsl:if test="marc:datafield[@tag=246]">
475 <span class="results_summary other_title"><span class="label">Other title: </span>
476 <xsl:for-each select="marc:datafield[@tag=246]">
477 <span property="alternateName">
478 <xsl:call-template name="chopPunctuation">
479 <xsl:with-param name="chopString">
480 <xsl:call-template name="subfieldSelect">
481 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
486 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
492 <xsl:if test="marc:datafield[@tag=242]">
493 <span class="results_summary translated_title"><span class="label">Title translated: </span>
494 <xsl:for-each select="marc:datafield[@tag=242]">
495 <span property="alternateName">
496 <xsl:call-template name="chopPunctuation">
497 <xsl:with-param name="chopString">
498 <xsl:call-template name="subfieldSelect">
499 <xsl:with-param name="codes">abchnp</xsl:with-param>
504 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
509 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
510 <xsl:if test="$display880">
511 <span property="alternateName">
512 <xsl:call-template name="m880Select">
513 <xsl:with-param name="basetags">130,240</xsl:with-param>
514 <xsl:with-param name="codes">adfklmor</xsl:with-param>
515 <xsl:with-param name="class">results_summary uniform_title</xsl:with-param>
516 <xsl:with-param name="label">Uniform titles: </xsl:with-param>
521 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
522 <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span>
523 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
524 <span property="alternateName">
525 <xsl:variable name="str">
526 <xsl:for-each select="marc:subfield">
527 <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'])))">
528 <xsl:value-of select="text()"/>
529 <xsl:text> </xsl:text>
533 <xsl:call-template name="chopPunctuation">
534 <xsl:with-param name="chopString">
535 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
540 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
545 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
546 <span class="results_summary subjects"><span class="label">Subject(s): </span>
547 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
548 <span property="keywords">
551 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
552 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
554 <xsl:when test="$TraceSubjectSubdivisions='1'">
555 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect">
556 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
557 <xsl:with-param name="delimeter"> AND </xsl:with-param>
558 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param>
559 <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param>
564 <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>
567 <xsl:call-template name="chopPunctuation">
568 <xsl:with-param name="chopString">
569 <xsl:call-template name="subfieldSelect">
570 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
571 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
572 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
578 <xsl:if test="marc:subfield[@code=9]">
580 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
581 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
585 <xsl:when test="position()=last()"></xsl:when>
586 <xsl:otherwise> | </xsl:otherwise>
593 <!-- Image processing code added here, takes precedence over text links including y3z text -->
594 <xsl:if test="marc:datafield[@tag=856]">
595 <span class="results_summary online_resources"><span class="label">Online resources: </span>
596 <xsl:for-each select="marc:datafield[@tag=856]">
597 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
600 <xsl:when test="$OPACTrackClicks='track'">
601 <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>
603 <xsl:when test="$OPACTrackClicks='anonymous'">
604 <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>
607 <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
610 <xsl:if test="$OPACURLOpenInNewWindow='1'">
611 <xsl:attribute name="target">_blank</xsl:attribute>
614 <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')">
615 <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>
617 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
618 <xsl:call-template name="subfieldSelect">
619 <xsl:with-param name="codes">y3z</xsl:with-param>
622 <xsl:when test="$URLLinkText!=''">
623 <xsl:value-of select="$URLLinkText"/>
626 <xsl:text>Click here to access online</xsl:text>
631 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
632 <xsl:otherwise> | </xsl:otherwise>
639 <xsl:if test="marc:datafield[@tag=530]">
640 <xsl:for-each select="marc:datafield[@tag=530]">
641 <span class="results_summary additionalforms">
642 <xsl:call-template name="subfieldSelect">
643 <xsl:with-param name="codes">abcd</xsl:with-param>
645 <xsl:for-each select="marc:subfield[@code='u']">
646 <a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
647 <xsl:if test="$OPACURLOpenInNewWindow='1'">
648 <xsl:attribute name="target">_blank</xsl:attribute>
650 <xsl:value-of select="text()"/>
658 <xsl:if test="marc:datafield[@tag=505]">
659 <div class="results_summary contents">
660 <xsl:for-each select="marc:datafield[@tag=505]">
661 <xsl:if test="position()=1">
663 <xsl:when test="@ind1=1">
664 <span class="label">Incomplete contents:</span>
666 <xsl:when test="@ind1=2">
667 <span class="label">Partial contents:</span>
670 <span class="label">Contents:</span>
674 <div class='contentblock' property='description'>
676 <xsl:when test="@ind2=0">
677 <xsl:call-template name="subfieldSelectSpan">
678 <xsl:with-param name="codes">tru</xsl:with-param>
682 <xsl:call-template name="subfieldSelectSpan">
683 <xsl:with-param name="codes">atru</xsl:with-param>
693 <xsl:if test="marc:datafield[@tag=583]">
694 <xsl:for-each select="marc:datafield[@tag=583]">
695 <xsl:if test="@ind1=1 or @ind1=' '">
696 <span class="results_summary actionnote">
698 <xsl:when test="marc:subfield[@code='z']">
699 <xsl:value-of select="marc:subfield[@code='z']"/>
702 <xsl:call-template name="subfieldSelect">
703 <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
713 <xsl:if test="marc:datafield[@tag=586]">
714 <xsl:for-each select="marc:datafield[@tag=586]">
715 <span class="results_summary awardsnote">
716 <xsl:if test="@ind1=' '">
717 <span class="label">Awards: </span>
719 <xsl:value-of select="marc:subfield[@code='a']"/>
725 <xsl:if test="marc:datafield[@tag=773]">
726 <xsl:for-each select="marc:datafield[@tag=773]">
727 <xsl:if test="@ind1=0">
728 <span class="results_summary in"><span class="label">
730 <xsl:when test="@ind2=' '">
733 <xsl:when test="@ind2=8">
734 <xsl:if test="marc:subfield[@code='i']">
735 <xsl:value-of select="marc:subfield[@code='i']"/>
740 <xsl:variable name="f773">
741 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
742 <xsl:with-param name="codes">a_t</xsl:with-param>
743 </xsl:call-template></xsl:with-param></xsl:call-template>
746 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
747 <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>
748 <xsl:value-of select="translate($f773, '()', '')"/>
750 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
752 <xsl:when test="marc:subfield[@code='0']">
753 <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute>
754 <xsl:value-of select="$f773"/>
758 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
759 <xsl:value-of select="$f773"/>
761 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
766 <xsl:if test="marc:subfield[@code='n']">
767 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
774 <xsl:for-each select="marc:datafield[@tag=511]">
775 <span class="results_summary perf_note">
777 <xsl:if test="@ind1=1"><xsl:text>Cast: </xsl:text></xsl:if>
779 <xsl:call-template name="subfieldSelect">
780 <xsl:with-param name="codes">a</xsl:with-param>
785 <xsl:if test="marc:datafield[@tag=502]">
786 <span class="results_summary diss_note">
787 <span class="label">Dissertation note: </span>
788 <xsl:for-each select="marc:datafield[@tag=502]">
789 <xsl:call-template name="subfieldSelect">
790 <xsl:with-param name="codes">abcdgo</xsl:with-param>
793 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise></xsl:choose>
797 <xsl:for-each select="marc:datafield[@tag=520]">
798 <span class="results_summary summary"><span class="label">
800 <xsl:when test="@ind1=0"><xsl:text>Subject: </xsl:text></xsl:when>
801 <xsl:when test="@ind1=1"><xsl:text>Review: </xsl:text></xsl:when>
802 <xsl:when test="@ind1=2"><xsl:text>Scope and content: </xsl:text></xsl:when>
803 <xsl:when test="@ind1=3"><xsl:text>Abstract: </xsl:text></xsl:when>
804 <xsl:when test="@ind1=4"><xsl:text>Content advice: </xsl:text></xsl:when>
805 <xsl:otherwise><xsl:text>Summary: </xsl:text></xsl:otherwise>
808 <xsl:call-template name="subfieldSelect">
809 <xsl:with-param name="codes">abcu</xsl:with-param>
814 <!-- 866 textual holdings -->
815 <xsl:if test="marc:datafield[@tag=866]">
816 <span class="results_summary holdings_note"><span class="label">Holdings note: </span>
817 <xsl:for-each select="marc:datafield[@tag=866]">
818 <xsl:call-template name="subfieldSelect">
819 <xsl:with-param name="codes">az</xsl:with-param>
821 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
826 <!-- 775 Other Edition -->
827 <xsl:if test="marc:datafield[@tag=775]">
828 <span class="results_summary other_editions"><span class="label">Other editions: </span>
829 <xsl:for-each select="marc:datafield[@tag=775]">
830 <xsl:variable name="f775">
831 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
832 <xsl:with-param name="codes">a_t</xsl:with-param>
833 </xsl:call-template></xsl:with-param></xsl:call-template>
835 <xsl:if test="marc:subfield[@code='i']">
836 <xsl:call-template name="subfieldSelect">
837 <xsl:with-param name="codes">i</xsl:with-param>
839 <xsl:text>: </xsl:text>
843 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
844 <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>
847 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute>
850 <xsl:call-template name="subfieldSelect">
851 <xsl:with-param name="codes">a_t</xsl:with-param>
855 <xsl:when test="position()=last()"></xsl:when>
856 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
863 <xsl:if test="marc:datafield[@tag=780]">
864 <xsl:for-each select="marc:datafield[@tag=780]">
865 <xsl:if test="@ind1=0">
866 <span class="results_summary preceeding_entry">
868 <xsl:when test="@ind2=0">
869 <span class="label">Continues:</span>
871 <xsl:when test="@ind2=1">
872 <span class="label">Continues in part:</span>
874 <xsl:when test="@ind2=2">
875 <span class="label">Supersedes:</span>
877 <xsl:when test="@ind2=3">
878 <span class="label">Supersedes in part:</span>
880 <xsl:when test="@ind2=4">
881 <span class="label">Formed by the union: ... and: ...</span>
883 <xsl:when test="@ind2=5">
884 <span class="label">Absorbed:</span>
886 <xsl:when test="@ind2=6">
887 <span class="label">Absorbed in part:</span>
889 <xsl:when test="@ind2=7">
890 <span class="label">Separated from:</span>
893 <xsl:text> </xsl:text>
894 <xsl:variable name="f780">
895 <xsl:call-template name="subfieldSelect">
896 <xsl:with-param name="codes">a_t</xsl:with-param>
900 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
901 <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>
902 <xsl:value-of select="translate($f780, '()', '')"/>
906 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
907 <xsl:value-of select="translate($f780, '()', '')"/>
913 <xsl:if test="marc:subfield[@code='n']">
914 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
922 <xsl:if test="marc:datafield[@tag=785]">
923 <xsl:for-each select="marc:datafield[@tag=785]">
924 <xsl:if test="@ind1=0">
925 <span class="results_summary succeeding_entry">
927 <xsl:when test="@ind2=0">
928 <span class="label">Continued by:</span>
930 <xsl:when test="@ind2=1">
931 <span class="label">Continued in part by:</span>
933 <xsl:when test="@ind2=2">
934 <span class="label">Superseded by:</span>
936 <xsl:when test="@ind2=3">
937 <span class="label">Superseded in part by:</span>
939 <xsl:when test="@ind2=4">
940 <span class="label">Absorbed by:</span>
942 <xsl:when test="@ind2=5">
943 <span class="label">Absorbed in part by:</span>
945 <xsl:when test="@ind2=6">
946 <span class="label">Split into .. and ...:</span>
948 <xsl:when test="@ind2=7">
949 <span class="label">Merged with ... to form ...</span>
951 <xsl:when test="@ind2=8">
952 <span class="label">Changed back to:</span>
955 <xsl:text> </xsl:text>
956 <xsl:variable name="f785">
957 <xsl:call-template name="subfieldSelect">
958 <xsl:with-param name="codes">a_t</xsl:with-param>
963 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
964 <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>
965 <xsl:value-of select="translate($f785, '()', '')"/>
969 <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
970 <xsl:value-of select="translate($f785, '()', '')"/>
977 <xsl:if test="marc:subfield[@code='n']">
978 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
988 <xsl:template name="showAuthor">
989 <xsl:param name="authorfield" />
990 <xsl:param name="UseAuthoritiesForTracings" />
991 <xsl:param name="materialTypeLabel" />
992 <xsl:for-each select="$authorfield">
993 <xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose>
995 <xsl:when test="not(@tag=111 or @tag=711)" />
996 <xsl:when test="marc:subfield[@code='n']">
997 <xsl:text> </xsl:text>
998 <xsl:call-template name="subfieldSelect">
999 <xsl:with-param name="codes">n</xsl:with-param>
1000 </xsl:call-template>
1001 <xsl:text> </xsl:text>
1006 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
1007 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:"<xsl:value-of select="marc:subfield[@code=9]"/>"</xsl:attribute>
1010 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute>
1013 <span resource="#record"><span>
1015 <xsl:when test="substring(@tag, 1, 1)='1'">
1017 <xsl:when test="$materialTypeLabel='Music'"><xsl:attribute name="property">byArtist</xsl:attribute></xsl:when>
1018 <xsl:otherwise><xsl:attribute name="property">author</xsl:attribute></xsl:otherwise>
1021 <xsl:otherwise><xsl:attribute name="property">contributor</xsl:attribute></xsl:otherwise>
1024 <xsl:when test="substring(@tag, 2, 1)='0'">
1026 <xsl:when test="$materialTypeLabel='Music'"><xsl:attribute name="typeof">MusicGroup</xsl:attribute></xsl:when>
1027 <xsl:otherwise><xsl:attribute name="typeof">Person</xsl:attribute></xsl:otherwise>
1030 <xsl:otherwise><xsl:attribute name="typeof">Organization</xsl:attribute></xsl:otherwise>
1032 <span property="name">
1034 <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCQ"/></xsl:when>
1035 <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
1036 <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
1038 </span></span></span>
1039 <!-- add relator code too between brackets-->
1040 <xsl:if test="marc:subfield[@code='4' or @code='e']">
1041 <span class="relatorcode">
1042 <xsl:text> [</xsl:text>
1044 <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
1045 <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
1047 <xsl:text>]</xsl:text>
1051 <xsl:if test="marc:subfield[@code=9]">
1052 <a class='authlink'>
1053 <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
1054 <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
1058 <xsl:text>.</xsl:text>
1061 <xsl:template name="nameABCQ">
1062 <xsl:call-template name="chopPunctuation">
1063 <xsl:with-param name="chopString">
1064 <xsl:call-template name="subfieldSelect">
1065 <xsl:with-param name="codes">abcq</xsl:with-param>
1066 </xsl:call-template>
1068 <xsl:with-param name="punctuation">
1069 <xsl:text>:,;/ </xsl:text>
1071 </xsl:call-template>
1074 <xsl:template name="nameABCDN">
1075 <xsl:for-each select="marc:subfield[@code='a']">
1076 <xsl:call-template name="chopPunctuation">
1077 <xsl:with-param name="chopString" select="."/>
1078 </xsl:call-template>
1080 <xsl:for-each select="marc:subfield[@code='b']">
1081 <xsl:value-of select="."/>
1083 <xsl:when test="position() != last()">
1084 <xsl:text> -- </xsl:text>
1088 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
1089 <xsl:call-template name="subfieldSelect">
1090 <xsl:with-param name="codes">cdn</xsl:with-param>
1091 </xsl:call-template>
1095 <xsl:template name="nameACDEQ">
1096 <xsl:call-template name="subfieldSelect">
1097 <xsl:with-param name="codes">acdeq</xsl:with-param>
1098 </xsl:call-template>
1101 <xsl:template name="part">
1102 <xsl:variable name="partNumber">
1103 <xsl:call-template name="specialSubfieldSelect">
1104 <xsl:with-param name="axis">n</xsl:with-param>
1105 <xsl:with-param name="anyCodes">n</xsl:with-param>
1106 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1107 </xsl:call-template>
1109 <xsl:variable name="partName">
1110 <xsl:call-template name="specialSubfieldSelect">
1111 <xsl:with-param name="axis">p</xsl:with-param>
1112 <xsl:with-param name="anyCodes">p</xsl:with-param>
1113 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1114 </xsl:call-template>
1116 <xsl:if test="string-length(normalize-space($partNumber))">
1117 <xsl:call-template name="chopPunctuation">
1118 <xsl:with-param name="chopString" select="$partNumber"/>
1119 </xsl:call-template>
1121 <xsl:if test="string-length(normalize-space($partName))">
1122 <xsl:call-template name="chopPunctuation">
1123 <xsl:with-param name="chopString" select="$partName"/>
1124 </xsl:call-template>
1128 <xsl:template name="specialSubfieldSelect">
1129 <xsl:param name="anyCodes"/>
1130 <xsl:param name="axis"/>
1131 <xsl:param name="beforeCodes"/>
1132 <xsl:param name="afterCodes"/>
1133 <xsl:variable name="str">
1134 <xsl:for-each select="marc:subfield">
1135 <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])">
1136 <xsl:value-of select="text()"/>
1137 <xsl:text> </xsl:text>
1141 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>