1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
3 <xsl:stylesheet version="1.0"
4 xmlns:marc="http://www.loc.gov/MARC21/slim"
5 xmlns:items="http://www.koha-community.org/items"
6 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7 exclude-result-prefixes="marc items">
8 <xsl:import href="MARC21slimUtils.xsl"/>
9 <xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
10 <xsl:template match="/">
11 <xsl:apply-templates/>
14 <xsl:template match="marc:record">
16 <!-- Option: Display Alternate Graphic Representation (MARC 880) -->
17 <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
19 <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
20 <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
21 <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
22 <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
23 <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
24 <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/>
26 <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='Display856uAsImage']"/>
27 <xsl:variable name="leader" select="marc:leader"/>
28 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
29 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
30 <xsl:variable name="leader19" select="substring($leader,20,1)"/>
31 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
32 <xsl:variable name="materialTypeCode">
34 <xsl:when test="$leader19='a'">ST</xsl:when>
35 <xsl:when test="$leader6='a'">
37 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
38 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
39 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
42 <xsl:when test="$leader6='t'">BK</xsl:when>
43 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
44 <xsl:when test="$leader6='m'">CF</xsl:when>
45 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
46 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
47 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
48 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
51 <xsl:variable name="materialTypeLabel">
53 <xsl:when test="$leader19='a'">Set</xsl:when>
54 <xsl:when test="$leader6='a'">
56 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
57 <xsl:when test="$leader7='i' or $leader7='s'">
59 <xsl:when test="substring($controlField008,22,1)!='m'">Continuing Resource</xsl:when>
60 <xsl:otherwise>Series</xsl:otherwise>
63 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
66 <xsl:when test="$leader6='t'">Book</xsl:when>
67 <xsl:when test="$leader6='o'">Kit</xsl:when>
68 <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
69 <xsl:when test="$leader6='m'">Computer File</xsl:when>
70 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
71 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual Material</xsl:when>
72 <xsl:when test="$leader6='j'">Music</xsl:when>
73 <xsl:when test="$leader6='i'">Sound</xsl:when>
74 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
78 <!-- Title Statement -->
79 <!-- Alternate Graphic Representation (MARC 880) -->
80 <xsl:if test="$display880">
82 <xsl:call-template name="m880Select">
83 <xsl:with-param name="basetags">245</xsl:with-param>
84 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
89 <xsl:if test="marc:datafield[@tag=245]">
91 <xsl:for-each select="marc:datafield[@tag=245]">
92 <xsl:call-template name="subfieldSelect">
93 <xsl:with-param name="codes">a</xsl:with-param>
95 <xsl:if test="marc:subfield[@code='b']">
96 <xsl:text> </xsl:text>
97 <xsl:call-template name="subfieldSelect">
98 <xsl:with-param name="codes">b</xsl:with-param>
101 <xsl:if test="marc:subfield[@code='h']">
102 <xsl:text> </xsl:text>
103 <xsl:call-template name="subfieldSelect">
104 <xsl:with-param name="codes">h</xsl:with-param>
107 <xsl:text> </xsl:text>
108 <xsl:call-template name="subfieldSelect">
109 <xsl:with-param name="codes">fgknps</xsl:with-param>
115 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
116 <xsl:if test="$display880">
118 <xsl:call-template name="m880Select">
119 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
120 <xsl:with-param name="codes">abc</xsl:with-param>
121 <xsl:with-param name="index">au</xsl:with-param>
122 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
127 <!-- Author Statement -->
128 <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
129 <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
131 <xsl:if test="$materialTypeCode!=''">
132 <span class="results_summary"><span class="label">Type: </span>
133 <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
134 <xsl:text> </xsl:text>
135 <xsl:value-of select="$materialTypeLabel"/>
139 <!--Series: Alternate Graphic Representation (MARC 880) -->
140 <xsl:if test="$display880">
141 <xsl:call-template name="m880Select">
142 <xsl:with-param name="basetags">440,490</xsl:with-param>
143 <xsl:with-param name="codes">av</xsl:with-param>
144 <xsl:with-param name="class">results_summary</xsl:with-param>
145 <xsl:with-param name="label">Series: </xsl:with-param>
146 <xsl:with-param name="index">se</xsl:with-param>
151 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
152 <span class="results_summary"><span class="label">Series: </span>
154 <xsl:for-each select="marc:datafield[@tag=440]">
155 <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
156 <xsl:call-template name="chopPunctuation">
157 <xsl:with-param name="chopString">
158 <xsl:call-template name="subfieldSelect">
159 <xsl:with-param name="codes">av</xsl:with-param>
164 <xsl:text> </xsl:text><xsl:call-template name="part"/>
165 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
168 <!-- 490 Series not traced, Ind1 = 0 -->
169 <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
170 <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
171 <xsl:call-template name="chopPunctuation">
172 <xsl:with-param name="chopString">
173 <xsl:call-template name="subfieldSelect">
174 <xsl:with-param name="codes">av</xsl:with-param>
179 <xsl:call-template name="part"/>
180 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
182 <!-- 490 Series traced, Ind1 = 1 -->
183 <xsl:if test="marc:datafield[@tag=490][@ind1=1]">
184 <xsl:for-each select="marc:datafield[@tag=800 or @tag=810 or @tag=811 or @tag=830]">
186 <xsl:when test="marc:subfield[@code='w']">
187 <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}">
188 <xsl:call-template name="chopPunctuation">
189 <xsl:with-param name="chopString">
190 <xsl:call-template name="subfieldSelect">
191 <xsl:with-param name="codes">at</xsl:with-param>
198 <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
199 <xsl:call-template name="chopPunctuation">
200 <xsl:with-param name="chopString">
201 <xsl:call-template name="subfieldSelect">
202 <xsl:with-param name="codes">at</xsl:with-param>
207 <xsl:call-template name="part"/>
210 <xsl:text>: </xsl:text>
211 <xsl:value-of select="marc:subfield[@code='v']" />
212 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
220 <xsl:if test="$leader7='s'">
221 <span class="results_summary"><span class="label">Analytics: </span>
224 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
225 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/></xsl:attribute>
228 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
231 <xsl:text>Show analytics</xsl:text>
236 <!-- Volumes of sets and traced series -->
237 <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'">
238 <span class="results_summary"><span class="label">Volumes: </span>
241 <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]">
242 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/></xsl:attribute>
245 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', '')"/></xsl:attribute>
248 <xsl:text>Show volumes</xsl:text>
254 <xsl:if test="$leader19='c'">
255 <span class="results_summary"><span class="label">Set: </span>
256 <xsl:for-each select="marc:datafield[@tag=773]">
259 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
260 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:value-of select="marc:subfield[@code='w']"/></xsl:attribute>
263 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute>
266 <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" />
269 <xsl:when test="position()=last()"></xsl:when>
270 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
276 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
277 <xsl:if test="$display880">
278 <xsl:call-template name="m880Select">
279 <xsl:with-param name="basetags">260</xsl:with-param>
280 <xsl:with-param name="codes">abcg</xsl:with-param>
281 <xsl:with-param name="class">results_summary</xsl:with-param>
282 <xsl:with-param name="label">Publisher: </xsl:with-param>
286 <xsl:if test="marc:datafield[@tag=260]">
287 <span class="results_summary"><span class="label">Publisher: </span>
288 <xsl:for-each select="marc:datafield[@tag=260]">
289 <xsl:if test="marc:subfield[@code='b']">
290 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
291 <xsl:call-template name="subfieldSelect">
292 <xsl:with-param name="codes">b</xsl:with-param>
296 <xsl:text> </xsl:text>
297 <xsl:call-template name="chopPunctuation">
298 <xsl:with-param name="chopString">
299 <xsl:call-template name="subfieldSelect">
300 <xsl:with-param name="codes">acg</xsl:with-param>
304 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
309 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
310 <xsl:if test="$display880">
311 <xsl:call-template name="m880Select">
312 <xsl:with-param name="basetags">250</xsl:with-param>
313 <xsl:with-param name="codes">ab</xsl:with-param>
314 <xsl:with-param name="class">results_summary</xsl:with-param>
315 <xsl:with-param name="label">Edition: </xsl:with-param>
319 <xsl:if test="marc:datafield[@tag=250]">
320 <span class="results_summary"><span class="label">Edition: </span>
321 <xsl:for-each select="marc:datafield[@tag=250]">
322 <xsl:call-template name="chopPunctuation">
323 <xsl:with-param name="chopString">
324 <xsl:call-template name="subfieldSelect">
325 <xsl:with-param name="codes">ab</xsl:with-param>
329 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
334 <!-- Description: Alternate Graphic Representation (MARC 880) -->
335 <xsl:if test="$display880">
336 <xsl:call-template name="m880Select">
337 <xsl:with-param name="basetags">300</xsl:with-param>
338 <xsl:with-param name="codes">abceg</xsl:with-param>
339 <xsl:with-param name="class">results_summary</xsl:with-param>
340 <xsl:with-param name="label">Description: </xsl:with-param>
344 <xsl:if test="marc:datafield[@tag=300]">
345 <span class="results_summary"><span class="label">Description: </span>
346 <xsl:for-each select="marc:datafield[@tag=300]">
347 <xsl:call-template name="chopPunctuation">
348 <xsl:with-param name="chopString">
349 <xsl:call-template name="subfieldSelect">
350 <xsl:with-param name="codes">abceg</xsl:with-param>
354 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
359 <xsl:if test="marc:datafield[@tag=020]">
360 <span class="results_summary"><span class="label">ISBN: </span>
361 <xsl:for-each select="marc:datafield[@tag=020]">
362 <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
363 <xsl:value-of select="marc:subfield[@code='a']"/>
364 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
369 <xsl:if test="marc:datafield[@tag=022]">
370 <span class="results_summary"><span class="label">ISSN: </span>
371 <xsl:for-each select="marc:datafield[@tag=022]">
372 <xsl:value-of select="marc:subfield[@code='a']"/>
373 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
378 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
379 <xsl:if test="$display880">
380 <xsl:call-template name="m880Select">
381 <xsl:with-param name="basetags">246</xsl:with-param>
382 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
383 <xsl:with-param name="class">results_summary</xsl:with-param>
384 <xsl:with-param name="label">Other Title: </xsl:with-param>
388 <xsl:if test="marc:datafield[@tag=246]">
389 <span class="results_summary"><span class="label">Other Title: </span>
390 <xsl:for-each select="marc:datafield[@tag=246]">
391 <xsl:call-template name="chopPunctuation">
392 <xsl:with-param name="chopString">
393 <xsl:call-template name="subfieldSelect">
394 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
398 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
403 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
404 <xsl:if test="$display880">
405 <xsl:call-template name="m880Select">
406 <xsl:with-param name="basetags">130,240</xsl:with-param>
407 <xsl:with-param name="codes">adfklmor</xsl:with-param>
408 <xsl:with-param name="class">results_summary</xsl:with-param>
409 <xsl:with-param name="label">Uniform Title: </xsl:with-param>
413 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
414 <span class="results_summary"><span class="label">Uniform titles: </span>
415 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
416 <xsl:variable name="str">
417 <xsl:for-each select="marc:subfield">
418 <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'])))">
419 <xsl:value-of select="text()"/>
420 <xsl:text> </xsl:text>
424 <xsl:call-template name="chopPunctuation">
425 <xsl:with-param name="chopString">
426 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
430 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
435 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
436 <span class="results_summary"><span class="label">Subject(s): </span>
437 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
440 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
441 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
443 <xsl:when test="$TraceSubjectSubdivisions='1'">
444 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect">
445 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
446 <xsl:with-param name="delimeter"> and </xsl:with-param>
447 <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:{</xsl:with-param>
448 <xsl:with-param name="suffix">})</xsl:with-param>
453 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:{<xsl:value-of select="marc:subfield[@code='a']"/>}</xsl:attribute>
456 <xsl:call-template name="chopPunctuation">
457 <xsl:with-param name="chopString">
458 <xsl:call-template name="subfieldSelect">
459 <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param>
460 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
461 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
467 <xsl:when test="position()=last()"></xsl:when>
468 <xsl:otherwise> | </xsl:otherwise>
475 <xsl:if test="marc:datafield[@tag=856]">
476 <span class="results_summary"><span class="label">Online Resources: </span>
477 <xsl:for-each select="marc:datafield[@tag=856]">
478 <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>
479 <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
481 <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')">
482 <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>
484 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
485 <xsl:call-template name="subfieldSelect">
486 <xsl:with-param name="codes">y3z</xsl:with-param>
489 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
491 <xsl:when test="$URLLinkText!=''">
492 <xsl:value-of select="$URLLinkText"/>
495 <xsl:text>Click here to access online</xsl:text>
502 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
503 <xsl:otherwise> | </xsl:otherwise>
509 <xsl:if test="marc:datafield[@tag=505]">
510 <xsl:for-each select="marc:datafield[@tag=505]">
511 <span class="results_summary">
513 <xsl:when test="@ind1=0">
514 <span class="label">Contents:</span>
516 <xsl:when test="@ind1=1">
517 <span class="label">Incomplete contents:</span>
519 <xsl:when test="@ind1=1">
520 <span class="label">Partial contents:</span>
524 <xsl:when test="@ind2=0">
525 <xsl:call-template name="subfieldSelect">
526 <xsl:with-param name="codes">tru</xsl:with-param>
530 <xsl:call-template name="subfieldSelect">
531 <xsl:with-param name="codes">au</xsl:with-param>
540 <xsl:if test="marc:datafield[@tag=773]">
541 <xsl:for-each select="marc:datafield[@tag=773]">
542 <xsl:if test="@ind1=0">
543 <span class="results_summary"><span class="label">
545 <xsl:when test="@ind2=' '">
548 <xsl:when test="@ind2=8">
549 <xsl:if test="marc:subfield[@code='i']">
550 <xsl:value-of select="marc:subfield[@code='i']"/>
555 <xsl:variable name="f773">
556 <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
557 <xsl:with-param name="codes">at</xsl:with-param>
558 </xsl:call-template></xsl:with-param></xsl:call-template>
561 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
562 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
563 <xsl:value-of select="translate($f773, '()', '')"/>
565 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
568 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
569 <xsl:value-of select="$f773"/>
571 <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
576 <xsl:if test="marc:subfield[@code='n']">
577 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
584 <!-- 775 Other Edition -->
585 <xsl:if test="marc:datafield[@tag=775]">
586 <span class="results_summary"><span class="label">Other Editions: </span>
587 <xsl:for-each select="marc:datafield[@tag=775]">
588 <xsl:if test="marc:subfield[@code='i']">
589 <xsl:call-template name="subfieldSelect">
590 <xsl:with-param name="codes">i</xsl:with-param>
592 <xsl:text>: </xsl:text>
596 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
597 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:value-of select="marc:subfield[@code='w']"/></xsl:attribute>
600 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(marc:subfield[@code='t'], '.', '')"/></xsl:attribute>
603 <xsl:call-template name="subfieldSelect">
604 <xsl:with-param name="codes">t</xsl:with-param>
608 <xsl:when test="position()=last()"></xsl:when>
609 <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
616 <xsl:if test="marc:datafield[@tag=780]">
617 <xsl:for-each select="marc:datafield[@tag=780]">
618 <xsl:if test="@ind1=0">
619 <span class="results_summary">
621 <xsl:when test="@ind2=0">
622 <span class="label">Continues:</span>
624 <xsl:when test="@ind2=1">
625 <span class="label">Continues in part:</span>
627 <xsl:when test="@ind2=2">
628 <span class="label">Supersedes:</span>
630 <xsl:when test="@ind2=3">
631 <span class="label">Supersedes in part:</span>
633 <xsl:when test="@ind2=4">
634 <span class="label">Formed by the union: ... and: ...</span>
636 <xsl:when test="@ind2=5">
637 <span class="label">Absorbed:</span>
639 <xsl:when test="@ind2=6">
640 <span class="label">Absorbed in part:</span>
642 <xsl:when test="@ind2=7">
643 <span class="label">Separated from:</span>
646 <xsl:variable name="f780">
647 <xsl:call-template name="subfieldSelect">
648 <xsl:with-param name="codes">at</xsl:with-param>
652 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
653 <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
654 <xsl:value-of select="translate($f780, '()', '')"/>
658 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
659 <xsl:value-of select="translate($f780, '()', '')"/>
665 <xsl:if test="marc:subfield[@code='n']">
666 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
674 <xsl:if test="marc:datafield[@tag=785]">
675 <xsl:for-each select="marc:datafield[@tag=785]">
676 <span class="results_summary">
678 <xsl:when test="@ind2=0">
679 <span class="label">Continued by:</span>
681 <xsl:when test="@ind2=1">
682 <span class="label">Continued in part by:</span>
684 <xsl:when test="@ind2=2">
685 <span class="label">Superseded by:</span>
687 <xsl:when test="@ind2=3">
688 <span class="label">Superseded in part by:</span>
690 <xsl:when test="@ind2=4">
691 <span class="label">Absorbed by:</span>
693 <xsl:when test="@ind2=5">
694 <span class="label">Absorbed in part by:</span>
696 <xsl:when test="@ind2=6">
697 <span class="label">Split into .. and ...:</span>
699 <xsl:when test="@ind2=7">
700 <span class="label">Merged with ... to form ...</span>
702 <xsl:when test="@ind2=8">
703 <span class="label">Changed back to:</span>
707 <xsl:variable name="f785">
708 <xsl:call-template name="subfieldSelect">
709 <xsl:with-param name="codes">at</xsl:with-param>
714 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
715 <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
716 <xsl:value-of select="translate($f785, '()', '')"/>
720 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
721 <xsl:value-of select="translate($f785, '()', '')"/>
730 <xsl:if test="$OPACBaseURL!=''">
731 <span class="results_summary"><span class="label">OPAC view: </span>
732 <a><xsl:attribute name="href">http://<xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
738 <xsl:template name="nameABCDQ">
739 <xsl:call-template name="chopPunctuation">
740 <xsl:with-param name="chopString">
741 <xsl:call-template name="subfieldSelect">
742 <xsl:with-param name="codes">aq</xsl:with-param>
745 <xsl:with-param name="punctuation">
746 <xsl:text>:,;/ </xsl:text>
749 <xsl:call-template name="termsOfAddress"/>
752 <xsl:template name="nameABCDN">
753 <xsl:for-each select="marc:subfield[@code='a']">
754 <xsl:call-template name="chopPunctuation">
755 <xsl:with-param name="chopString" select="."/>
758 <xsl:for-each select="marc:subfield[@code='b']">
759 <xsl:value-of select="."/>
761 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
762 <xsl:call-template name="subfieldSelect">
763 <xsl:with-param name="codes">cdn</xsl:with-param>
768 <xsl:template name="nameACDEQ">
769 <xsl:call-template name="subfieldSelect">
770 <xsl:with-param name="codes">acdeq</xsl:with-param>
773 <xsl:template name="termsOfAddress">
774 <xsl:if test="marc:subfield[@code='b' or @code='c']">
775 <xsl:call-template name="chopPunctuation">
776 <xsl:with-param name="chopString">
777 <xsl:call-template name="subfieldSelect">
778 <xsl:with-param name="codes">bc</xsl:with-param>
785 <xsl:template name="part">
786 <xsl:variable name="partNumber">
787 <xsl:call-template name="specialSubfieldSelect">
788 <xsl:with-param name="axis">n</xsl:with-param>
789 <xsl:with-param name="anyCodes">n</xsl:with-param>
790 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
793 <xsl:variable name="partName">
794 <xsl:call-template name="specialSubfieldSelect">
795 <xsl:with-param name="axis">p</xsl:with-param>
796 <xsl:with-param name="anyCodes">p</xsl:with-param>
797 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
800 <xsl:if test="string-length(normalize-space($partNumber))">
801 <xsl:call-template name="chopPunctuation">
802 <xsl:with-param name="chopString" select="$partNumber"/>
805 <xsl:if test="string-length(normalize-space($partName))">
806 <xsl:call-template name="chopPunctuation">
807 <xsl:with-param name="chopString" select="$partName"/>
812 <xsl:template name="specialSubfieldSelect">
813 <xsl:param name="anyCodes"/>
814 <xsl:param name="axis"/>
815 <xsl:param name="beforeCodes"/>
816 <xsl:param name="afterCodes"/>
817 <xsl:variable name="str">
818 <xsl:for-each select="marc:subfield">
819 <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])">
820 <xsl:value-of select="text()"/>
821 <xsl:text> </xsl:text>
825 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
828 <xsl:template name="showAuthor">
829 <xsl:param name="authorfield"/>
830 <xsl:param name="UseAuthoritiesForTracings"/>
831 <xsl:if test="count($authorfield)>0">
833 <xsl:for-each select="$authorfield">
835 <xsl:when test="position()>1"/>
836 <xsl:when test="@tag<700">Author(s): </xsl:when>
837 <xsl:otherwise>Additional author(s): </xsl:otherwise>
841 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
842 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
845 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
849 <xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCDQ"/></xsl:when>
850 <xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
851 <xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
853 <!-- add relator code too between brackets-->
854 <xsl:if test="marc:subfield[@code='4' or @code='e']">
855 <xsl:text>[</xsl:text>
857 <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
858 <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
860 <xsl:text>]</xsl:text>
864 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>