1 <?xml version="1.0" encoding="UTF-8"?>
3 <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]>
5 <xsl:stylesheet version="1.0"
6 xmlns:marc="http://www.loc.gov/MARC21/slim"
7 xmlns:items="http://www.koha-community.org/items"
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:str="http://exslt.org/strings"
10 exclude-result-prefixes="marc items str">
12 <xsl:import href="UNIMARCslimUtils.xsl"/>
13 <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
14 <xsl:template match="/">
15 <xsl:apply-templates/>
18 <xsl:template match="marc:record">
19 <xsl:variable name="leader" select="marc:leader"/>
20 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
21 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
22 <xsl:variable name="biblionumber" select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
23 <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
24 <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
25 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
27 <xsl:if test="marc:datafield[@tag=200]">
28 <xsl:for-each select="marc:datafield[@tag=200]">
30 <xsl:call-template name="addClassRtl" />
31 <xsl:for-each select="marc:subfield">
33 <xsl:when test="@code='a'">
34 <xsl:variable name="title" select="."/>
35 <xsl:variable name="ntitle"
36 select="translate($title, 'ˆ‰˜œ','')"/>
37 <xsl:value-of select="$ntitle" />
39 <xsl:when test="@code='b'">
40 <xsl:text> [</xsl:text>
41 <xsl:value-of select="."/>
42 <xsl:text>]</xsl:text>
44 <xsl:when test="@code='d'">
45 <xsl:text> = </xsl:text>
46 <xsl:value-of select="."/>
48 <xsl:when test="@code='e'">
49 <xsl:text> : </xsl:text>
50 <xsl:value-of select="."/>
52 <xsl:when test="@code='f'">
53 <xsl:text> / </xsl:text>
54 <xsl:value-of select="."/>
56 <xsl:when test="@code='g'">
57 <xsl:text> ; </xsl:text>
58 <xsl:value-of select="."/>
61 <xsl:text>, </xsl:text>
62 <xsl:value-of select="."/>
70 <xsl:call-template name="tag_title">
71 <xsl:with-param name="tag">454</xsl:with-param>
72 <xsl:with-param name="label">Translation of</xsl:with-param>
73 <xsl:with-param name="spanclass">original_title</xsl:with-param>
76 <xsl:call-template name="tag_title">
77 <xsl:with-param name="tag">461</xsl:with-param>
78 <xsl:with-param name="label">Set Level</xsl:with-param>
79 <xsl:with-param name="spanclass">set_level</xsl:with-param>
82 <xsl:call-template name="tag_title">
83 <xsl:with-param name="tag">464</xsl:with-param>
84 <xsl:with-param name="label">Piece-Analytic Level</xsl:with-param>
85 <xsl:with-param name="spanclass">piece_analytic_level</xsl:with-param>
88 <xsl:call-template name="tag_7xx">
89 <xsl:with-param name="tag">700</xsl:with-param>
90 <xsl:with-param name="label">Main Author</xsl:with-param>
91 <xsl:with-param name="spanclass">main_author</xsl:with-param>
94 <xsl:call-template name="tag_7xx">
95 <xsl:with-param name="tag">710</xsl:with-param>
96 <xsl:with-param name="label">Corporate Author (Main)</xsl:with-param>
97 <xsl:with-param name="spanclass">corporate_main_author</xsl:with-param>
100 <xsl:call-template name="tag_7xx">
101 <xsl:with-param name="tag">701</xsl:with-param>
102 <xsl:with-param name="label">Coauthor</xsl:with-param>
103 <xsl:with-param name="spanclass">coauthor</xsl:with-param>
106 <xsl:call-template name="tag_7xx">
107 <xsl:with-param name="tag">702</xsl:with-param>
108 <xsl:with-param name="label">Secondary Author</xsl:with-param>
109 <xsl:with-param name="spanclass">secondary_author</xsl:with-param>
112 <xsl:call-template name="tag_7xx">
113 <xsl:with-param name="tag">711</xsl:with-param>
114 <xsl:with-param name="label">Corporate Author (Coauthor)</xsl:with-param>
115 <xsl:with-param name="spanclass">corporate_coauthor</xsl:with-param>
118 <xsl:call-template name="tag_7xx">
119 <xsl:with-param name="tag">712</xsl:with-param>
120 <xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
121 <xsl:with-param name="spanclass">corporate_secondary_author</xsl:with-param>
124 <xsl:call-template name="tag_title">
125 <xsl:with-param name="tag">500</xsl:with-param>
126 <xsl:with-param name="label">Uniform Title</xsl:with-param>
127 <xsl:with-param name="spanclass">uniform_title</xsl:with-param>
130 <xsl:call-template name="tag_title">
131 <xsl:with-param name="tag">503</xsl:with-param>
132 <xsl:with-param name="label">Uniform Conventional Heading</xsl:with-param>
133 <xsl:with-param name="spanclass">uniform_conventional_heading</xsl:with-param>
136 <xsl:if test="marc:datafield[@tag=101]">
137 <span class="results_summary language">
138 <span class="label">Language: </span>
139 <xsl:for-each select="marc:datafield[@tag=101]">
140 <xsl:for-each select="marc:subfield">
142 <xsl:when test="@code='b'">of intermediate text, </xsl:when>
143 <xsl:when test="@code='c'">of original work, </xsl:when>
144 <xsl:when test="@code='d'">of summary, </xsl:when>
145 <xsl:when test="@code='e'">of contents page, </xsl:when>
146 <xsl:when test="@code='f'">of title page, </xsl:when>
147 <xsl:when test="@code='g'">of title proper, </xsl:when>
148 <xsl:when test="@code='h'">of libretto, </xsl:when>
149 <xsl:when test="@code='i'">of accompanying material, </xsl:when>
150 <xsl:when test="@code='j'">of subtitles, </xsl:when>
152 <xsl:value-of select="text()"/>
154 <xsl:when test="position()=last()">
155 <xsl:text>.</xsl:text>
158 <xsl:text> ; </xsl:text>
166 <xsl:if test="marc:datafield[@tag=102]">
167 <span class="results_summary country">
168 <span class="label">Country: </span>
169 <xsl:for-each select="marc:datafield[@tag=102]">
170 <xsl:for-each select="marc:subfield">
171 <xsl:value-of select="text()"/>
173 <xsl:when test="position()=last()">
174 <xsl:text>.</xsl:text>
176 <xsl:otherwise><xsl:text>, </xsl:text>
184 <xsl:call-template name="tag_comma">
185 <xsl:with-param name="tag">205</xsl:with-param>
186 <xsl:with-param name="label">Edition Statement</xsl:with-param>
187 <xsl:with-param name="spanclass">edition</xsl:with-param>
190 <xsl:call-template name="tag_210" />
192 <xsl:call-template name="tag_215" />
195 <xsl:if test="marc:datafield[@tag=010]/marc:subfield[@code='a']">
196 <span class="results_summary isbn"><span class="label">ISBN: </span>
197 <xsl:for-each select="marc:datafield[@tag=010]/marc:subfield[@code='a']">
198 <span property="isbn">
199 <xsl:value-of select="."/>
201 <xsl:when test="position()=last()">
202 <xsl:text>.</xsl:text>
205 <xsl:text>; </xsl:text>
214 <xsl:if test="marc:datafield[@tag=011]/marc:subfield[@code='a']">
215 <span class="results_summary issn"><span class="label">ISSN: </span>
216 <xsl:for-each select="marc:datafield[@tag=011]/marc:subfield[@code='a']">
217 <span property="issn">
218 <xsl:value-of select="."/>
220 <xsl:when test="position()=last()">
221 <xsl:text>.</xsl:text>
224 <xsl:text>; </xsl:text>
232 <xsl:call-template name="tag_title">
233 <xsl:with-param name="tag">225</xsl:with-param>
234 <xsl:with-param name="label">Series</xsl:with-param>
235 <xsl:with-param name="spanclass">series</xsl:with-param>
238 <xsl:if test="marc:datafield[@tag=676]">
239 <span class="results_summary dewey">
240 <span class="label">Dewey: </span>
241 <xsl:for-each select="marc:datafield[@tag=676]">
242 <xsl:value-of select="marc:subfield[@code='a']"/>
243 <xsl:if test="marc:subfield[@code='v']">
244 <xsl:text>, </xsl:text>
245 <xsl:value-of select="marc:subfield[@code='v']"/>
247 <xsl:if test="marc:subfield[@code='z']">
248 <xsl:text>, </xsl:text>
249 <xsl:value-of select="marc:subfield[@code='z']"/>
251 <xsl:if test="not (position()=last())">
252 <xsl:text> ; </xsl:text>
258 <xsl:if test="marc:datafield[@tag=686]">
259 <span class="results_summary classification">
260 <span class="label">Classification: </span>
261 <xsl:for-each select="marc:datafield[@tag=686]">
262 <xsl:value-of select="marc:subfield[@code='a']"/>
263 <xsl:if test="marc:subfield[@code='b']">
264 <xsl:text>, </xsl:text>
265 <xsl:value-of select="marc:subfield[@code='b']"/>
267 <xsl:if test="marc:subfield[@code='c']">
268 <xsl:text>, </xsl:text>
269 <xsl:value-of select="marc:subfield[@code='c']"/>
271 <xsl:if test="not (position()=last())"><xsl:text> ; </xsl:text></xsl:if>
276 <xsl:if test="marc:datafield[@tag=327]">
277 <span class="results_summary contents">
278 <span class="label">Contents note: </span>
279 <xsl:for-each select="marc:datafield[@tag=327]">
280 <xsl:call-template name="chopPunctuation">
281 <xsl:with-param name="chopString">
282 <xsl:call-template name="subfieldSelect">
283 <xsl:with-param name="codes">abcdjpvxyz</xsl:with-param>
284 <xsl:with-param name="subdivCodes">jpxyz</xsl:with-param>
285 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
293 <xsl:if test="marc:datafield[@tag=330]">
294 <span class="results_summary abstract">
295 <span class="label">Abstract: </span>
296 <xsl:for-each select="marc:datafield[@tag=330]">
297 <xsl:value-of select="marc:subfield[@code='a']"/>
299 <xsl:when test="position()=last()">
300 <xsl:text>.</xsl:text>
303 <xsl:text>; </xsl:text>
310 <xsl:if test="marc:datafield[@tag=317]">
311 <span class="results_summary provenance">
312 <span class="label">Provenance note: </span>
313 <xsl:for-each select="marc:datafield[@tag=317]">
314 <xsl:value-of select="marc:subfield[@code='a']"/>
319 <xsl:if test="marc:datafield[@tag=320]">
320 <span class="results_summary bibliography">
321 <span class="label">Bibliography: </span>
322 <xsl:for-each select="marc:datafield[@tag=320]">
323 <xsl:value-of select="marc:subfield[@code='a']"/>
324 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
329 <xsl:if test="marc:datafield[@tag=328]">
330 <span class="results_summary thesis">
331 <span class="label">Thesis: </span>
332 <xsl:for-each select="marc:datafield[@tag=328]">
333 <xsl:value-of select="marc:subfield[@code='a']"/>
334 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
339 <xsl:if test="marc:datafield[@tag=333]">
340 <span class="results_summary audience">
341 <span class="label">Audience: </span>
342 <xsl:for-each select="marc:datafield[@tag=333]">
343 <xsl:value-of select="marc:subfield[@code='a']"/>
344 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
349 <xsl:if test="marc:datafield[@tag=955]">
350 <span class="results_summary sudoc_serial_history">
351 <span class="label">SUDOC serial history: </span>
352 <xsl:for-each select="marc:datafield[@tag=955]">
353 <xsl:value-of select="marc:subfield[@code='9']"/>:
354 <xsl:value-of select="marc:subfield[@code='r']"/>
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 <xsl:call-template name="tag_subject">
361 <xsl:with-param name="tag">600</xsl:with-param>
362 <xsl:with-param name="label">Subject - Personal Name</xsl:with-param>
365 <xsl:call-template name="tag_subject">
366 <xsl:with-param name="tag">601</xsl:with-param>
367 <xsl:with-param name="label">Subject - Corporate Author</xsl:with-param>
370 <xsl:call-template name="tag_subject">
371 <xsl:with-param name="tag">602</xsl:with-param>
372 <xsl:with-param name="label">Subject - Family</xsl:with-param>
375 <xsl:call-template name="tag_subject">
376 <xsl:with-param name="tag">604</xsl:with-param>
377 <xsl:with-param name="label">Subject - Author/Title</xsl:with-param>
380 <xsl:call-template name="tag_subject">
381 <xsl:with-param name="tag">606</xsl:with-param>
382 <xsl:with-param name="label">Subject - Topical Name</xsl:with-param>
385 <xsl:call-template name="tag_subject">
386 <xsl:with-param name="tag">607</xsl:with-param>
387 <xsl:with-param name="label">Subject - Geographical Name</xsl:with-param>
390 <xsl:call-template name="tag_subject">
391 <xsl:with-param name="tag">608</xsl:with-param>
392 <xsl:with-param name="label">Subject - Form</xsl:with-param>
395 <xsl:call-template name="tag_subject">
396 <xsl:with-param name="tag">610</xsl:with-param>
397 <xsl:with-param name="label">Subject</xsl:with-param>
400 <xsl:call-template name="tag_subject">
401 <xsl:with-param name="tag">615</xsl:with-param>
402 <xsl:with-param name="label">Subject Category</xsl:with-param>
405 <xsl:call-template name="tag_subject">
406 <xsl:with-param name="tag">616</xsl:with-param>
407 <xsl:with-param name="label">Trademark</xsl:with-param>
410 <xsl:if test="marc:datafield[@tag=856]">
411 <span class="results_summary online_resources">
412 <span class="label">Online Resources:</span>
413 <xsl:for-each select="marc:datafield[@tag=856]">
415 <xsl:attribute name="href">
416 <xsl:value-of select="marc:subfield[@code='u']"/>
418 <xsl:if test="$OPACURLOpenInNewWindow='1'">
419 <xsl:attribute name="target">_blank</xsl:attribute>
422 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
423 <xsl:call-template name="subfieldSelect">
424 <xsl:with-param name="codes">y3z</xsl:with-param>
427 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
429 <xsl:when test="$URLLinkText!=''">
430 <xsl:value-of select="$URLLinkText"/>
433 <xsl:text>Click here to access online</xsl:text>
440 <xsl:when test="position()=last()"></xsl:when>
441 <xsl:otherwise> | </xsl:otherwise>
448 <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" />
449 <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" />
450 <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" />
451 <xsl:variable name="OpenURLResolverURL" select="marc:variables/marc:variable[@name='OpenURLResolverURL']" />
453 <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != ''">
454 <xsl:variable name="openurltext">
456 <xsl:when test="$OpenURLText != ''">
457 <xsl:value-of select="$OpenURLText" />
460 <xsl:text>OpenURL</xsl:text>
465 <span class="results_summary"><a>
466 <xsl:attribute name="href">
467 <xsl:value-of select="$OpenURLResolverURL" />
469 <xsl:attribute name="title">
470 <xsl:value-of select="$openurltext" />
472 <xsl:attribute name="class">
473 <xsl:text>OpenURL</xsl:text>
475 <xsl:if test="$OPACURLOpenInNewWindow='1'">
476 <xsl:attribute name="target">
477 <xsl:text>_blank</xsl:text>
481 <xsl:when test="$OpenURLImageLocation != ''">
483 <xsl:attribute name="src">
484 <xsl:value-of select="$OpenURLImageLocation" />
489 <xsl:value-of select="$openurltext" />
494 <!-- End of OpenURL -->
496 <xsl:variable name="OPACShowMusicalInscripts" select="marc:sysprefs/marc:syspref[@name='OPACShowMusicalInscripts']" />
497 <xsl:variable name="OPACPlayMusicalInscripts" select="marc:sysprefs/marc:syspref[@name='OPACPlayMusicalInscripts']" />
499 <xsl:if test="$OPACShowMusicalInscripts and marc:datafield[@tag=036]">
500 <xsl:for-each select="marc:datafield[@tag=031]">
502 <span class="results_summary musical_inscripts">
503 <xsl:if test="marc:subfield[@code='u']">
506 <xsl:attribute name="href">
507 <xsl:value-of select="marc:subfield[@code='u']"/>
509 <xsl:text>Audio file</xsl:text>
513 <xsl:if test="marc:subfield[@code='2'] and marc:subfield[@code='2']/text() = 'pe' and marc:subfield[@code='g'] and marc:subfield[@code='n'] and marc:subfield[@code='o'] and marc:subfield[@code='p']">
514 <div class="inscript" data-system="pae">
515 <xsl:attribute name="data-clef">
516 <xsl:value-of select="marc:subfield[@code='g']"/>
518 <xsl:attribute name="data-keysig">
519 <xsl:value-of select="marc:subfield[@code='n']"/>
521 <xsl:attribute name="data-timesig">
522 <xsl:value-of select="marc:subfield[@code='o']"/>
524 <xsl:attribute name="data-notation">
525 <xsl:value-of select="marc:subfield[@code='p']"/>
528 <xsl:if test="$OPACPlayMusicalInscripts = 1">
529 <div class="audio_controls">
530 <button class="btn play_btn">
531 <i id="carticon" class="fa fa-play"></i>
532 <xsl:text> Play this sample</xsl:text>
539 <xsl:if test="$OPACPlayMusicalInscripts = 1">
540 <div class="results_summary">
541 <span class="inscript_audio hide"></span>
548 <xsl:template name="nameABCDQ">
549 <xsl:call-template name="chopPunctuation">
550 <xsl:with-param name="chopString">
551 <xsl:call-template name="subfieldSelect">
552 <xsl:with-param name="codes">aq</xsl:with-param>
555 <xsl:with-param name="punctuation">
556 <xsl:text>:,;/ </xsl:text>
559 <xsl:call-template name="termsOfAddress"/>
562 <xsl:template name="nameABCDN">
563 <xsl:for-each select="marc:subfield[@code='a']">
564 <xsl:call-template name="chopPunctuation">
565 <xsl:with-param name="chopString" select="."/>
568 <xsl:for-each select="marc:subfield[@code='b']">
569 <xsl:value-of select="."/>
571 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
572 <xsl:call-template name="subfieldSelect">
573 <xsl:with-param name="codes">cdn</xsl:with-param>
578 <xsl:template name="nameACDEQ">
579 <xsl:call-template name="subfieldSelect">
580 <xsl:with-param name="codes">acdeq</xsl:with-param>
583 <xsl:template name="termsOfAddress">
584 <xsl:if test="marc:subfield[@code='b' or @code='c']">
585 <xsl:call-template name="chopPunctuation">
586 <xsl:with-param name="chopString">
587 <xsl:call-template name="subfieldSelect">
588 <xsl:with-param name="codes">bc</xsl:with-param>
595 <xsl:template name="part">
596 <xsl:variable name="partNumber">
597 <xsl:call-template name="specialSubfieldSelect">
598 <xsl:with-param name="axis">n</xsl:with-param>
599 <xsl:with-param name="anyCodes">n</xsl:with-param>
600 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
603 <xsl:variable name="partName">
604 <xsl:call-template name="specialSubfieldSelect">
605 <xsl:with-param name="axis">p</xsl:with-param>
606 <xsl:with-param name="anyCodes">p</xsl:with-param>
607 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
610 <xsl:if test="string-length(normalize-space($partNumber))">
611 <xsl:call-template name="chopPunctuation">
612 <xsl:with-param name="chopString" select="$partNumber"/>
615 <xsl:if test="string-length(normalize-space($partName))">
616 <xsl:call-template name="chopPunctuation">
617 <xsl:with-param name="chopString" select="$partName"/>
622 <xsl:template name="specialSubfieldSelect">
623 <xsl:param name="anyCodes"/>
624 <xsl:param name="axis"/>
625 <xsl:param name="beforeCodes"/>
626 <xsl:param name="afterCodes"/>
627 <xsl:variable name="str">
628 <xsl:for-each select="marc:subfield">
629 <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])">
630 <xsl:value-of select="text()"/>
631 <xsl:text> </xsl:text>
635 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>