3 <xsl:stylesheet version="1.0"
4 xmlns:marc="http://www.loc.gov/MARC21/slim"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 xmlns:str="http://exslt.org/strings"
7 exclude-result-prefixes="marc str">
8 <xsl:include href="MARC21Languages.xsl"/>
9 <xsl:template name="datafield">
10 <xsl:param name="tag"/>
11 <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param>
12 <xsl:param name="ind2"><xsl:text> </xsl:text></xsl:param>
13 <xsl:param name="subfields"/>
14 <xsl:element name="datafield">
15 <xsl:attribute name="tag">
16 <xsl:value-of select="$tag"/>
18 <xsl:attribute name="ind1">
19 <xsl:value-of select="$ind1"/>
21 <xsl:attribute name="ind2">
22 <xsl:value-of select="$ind2"/>
24 <xsl:copy-of select="$subfields"/>
28 <xsl:template name="subfieldSelect">
29 <xsl:param name="codes"/>
30 <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
31 <xsl:param name="subdivCodes"/>
32 <xsl:param name="subdivDelimiter"/>
33 <xsl:param name="prefix"/>
34 <xsl:param name="suffix"/>
35 <xsl:param name="urlencode"/>
36 <xsl:variable name="str">
37 <xsl:for-each select="marc:subfield">
38 <xsl:if test="contains($codes, @code)">
39 <xsl:if test="contains($subdivCodes, @code)">
40 <xsl:value-of select="$subdivDelimiter"/>
42 <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/>
47 <xsl:when test="$urlencode=1">
48 <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/>
51 <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
56 <xsl:template name="subfieldSelectSpan">
57 <xsl:param name="codes"/>
58 <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
59 <xsl:param name="subdivCodes"/>
60 <xsl:param name="subdivDelimiter"/>
61 <xsl:param name="prefix"/>
62 <xsl:param name="suffix"/>
63 <xsl:param name="newline"/>
64 <xsl:for-each select="marc:subfield">
65 <xsl:if test="contains($codes, @code)">
67 <xsl:attribute name="class">
68 <xsl:value-of select="@code"/>
69 <xsl:if test="$newline = 1 and contains(text(), '--')">
70 <xsl:text> newline</xsl:text>
73 <xsl:if test="contains($subdivCodes, @code)">
74 <xsl:value-of select="$subdivDelimiter"/>
76 <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:if test="position()!=last()"><xsl:value-of select="$delimeter"/></xsl:if>
82 <xsl:template name="buildSpaces">
83 <xsl:param name="spaces"/>
84 <xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
85 <xsl:if test="$spaces>0">
86 <xsl:value-of select="$char"/>
87 <xsl:call-template name="buildSpaces">
88 <xsl:with-param name="spaces" select="$spaces - 1"/>
89 <xsl:with-param name="char" select="$char"/>
94 <xsl:template name="buildBiblioDefaultViewURL">
95 <xsl:param name="BiblioDefaultView"/>
97 <xsl:when test="$BiblioDefaultView='normal'">
98 <xsl:text>/cgi-bin/koha/opac-detail.pl?biblionumber=</xsl:text>
100 <xsl:when test="$BiblioDefaultView='isbd'">
101 <xsl:text>/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=</xsl:text>
103 <xsl:when test="$BiblioDefaultView='marc'">
104 <xsl:text>/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=</xsl:text>
107 <xsl:text>/cgi-bin/koha/opac-detail.pl?biblionumber=</xsl:text>
112 <xsl:template name="chopPunctuation">
113 <xsl:param name="chopString"/>
114 <xsl:variable name="length" select="string-length($chopString)"/>
116 <xsl:when test="$length=0"/>
117 <xsl:when test="contains('.:,;/ ', substring($chopString,$length,1))">
118 <xsl:call-template name="chopPunctuation">
119 <xsl:with-param name="chopString" select="substring($chopString,1,$length - 1)"/>
122 <xsl:when test="not($chopString)"/>
123 <xsl:otherwise><xsl:value-of select="$chopString"/></xsl:otherwise>
127 <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w.
128 Parameter: control number string.
129 Assumes LOC convention: (OrgCode)recordNumber.
130 If OrgCode is not present, return full string.
131 Additionally, handle various brackets/parentheses. Chop leading and trailing spaces.
132 Returns the value URI-encoded.
134 <xsl:template name="extractControlNumber">
135 <xsl:param name="subfieldW"/>
136 <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/>
138 <xsl:when test="contains($tranW,')')">
139 <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/>
142 <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/>
147 <!-- Function m880Select: Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
148 - should be called immediately before the corresonding latin tags are processed
149 - tags in right-to-left languages are displayed floating right
151 + basetags: display these tags if found in linkage section ( subfield 6) of tag 880
152 + codes: display these subfields codes
154 - class: wrap output in <span class="$class">...</span>
155 - label: prefix each(!) tag with label $label
156 - bibno: link to biblionumber $bibno
157 - index: build a search link using index $index with subfield $a as key; if subfield $9 is present use index 'an' with key $9 instead.
159 - displays every field on a separate line (to switch between rtl and ltr)
161 (!) output might be empty
163 <xsl:template name="m880Select">
164 <xsl:param name="basetags"/> <!-- e.g. 100,700,110,710 -->
165 <xsl:param name="codes"/> <!-- e.g. abc -->
166 <xsl:param name="class"/> <!-- e.g. results_summary -->
167 <xsl:param name="label"/> <!-- e.g. Edition -->
168 <xsl:param name="bibno"/>
169 <xsl:param name="index"/> <!-- e.g. au -->
171 <xsl:for-each select="marc:datafield[@tag=880]">
172 <xsl:variable name="code6" select="marc:subfield[@code=6]"/>
173 <xsl:if test="contains(string($basetags), substring($code6,1,3))">
176 <xsl:when test="boolean($class) and substring($code6,string-length($code6)-1,2) ='/r'">
177 <xsl:attribute name="class"><xsl:value-of select="$class"/> m880</xsl:attribute>
178 <xsl:attribute name="dir">rtl</xsl:attribute>
180 <xsl:when test="boolean($class)">
181 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
182 <xsl:attribute name="style">display:block; </xsl:attribute>
184 <xsl:when test="substring($code6,string-length($code6)-1,2) ='/r'">
185 <xsl:attribute name="class"><xsl:value-of select="$class"/> m880</xsl:attribute>
188 <xsl:if test="boolean($label)">
190 <xsl:value-of select="$label"/>
193 <xsl:variable name="str">
194 <xsl:for-each select="marc:subfield">
195 <xsl:if test="contains($codes, @code)">
196 <xsl:value-of select="text()"/>
197 <xsl:text> </xsl:text>
201 <xsl:if test="string-length($str) > 0">
203 <xsl:when test="boolean($bibno)">
205 <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri($bibno, true())"/></xsl:attribute>
206 <xsl:value-of select="$str"/>
209 <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
211 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
212 <xsl:value-of select="$str"/>
215 <xsl:when test="boolean($index)">
217 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="str:encode-uri($index, true())"/>:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute>
218 <xsl:value-of select="$str"/>
222 <xsl:value-of select="$str"/>
231 <xsl:template name="showRDAtag264">
232 <!-- Function showRDAtag264 shows selected information from tag 264
233 on the Publisher line (used by OPAC Detail and Results)
234 Depending on how many tags you have, we will pick by preference
235 Publisher-latest or Publisher or 'Other'-latest or 'Other'
236 The preferred tag is saved in the fav variable and passed to a
237 helper named-template -->
238 <!-- Amended to show all 264 fields (filtered by ind1=3 if ind1=3 is present in the record) -->
239 <xsl:param name="show_url"/>
241 <xsl:when test="marc:datafield[@tag=264 and @ind1=3]">
242 <xsl:for-each select="marc:datafield[@tag=264 and @ind1=3]">
243 <xsl:call-template name="showRDAtag264helper">
244 <xsl:with-param name="field" select="."/>
245 <xsl:with-param name="url" select="$show_url"/>
250 <xsl:for-each select="marc:datafield[@tag=264]">
251 <xsl:call-template name="showRDAtag264helper">
252 <xsl:with-param name="field" select="."/>
253 <xsl:with-param name="url" select="$show_url"/>
259 <xsl:template name="showRDAtag264helper">
260 <xsl:param name="field"/>
261 <xsl:param name="url"/>
262 <xsl:variable name="ind2" select="$field/@ind2"/>
263 <span class="results_summary rda264">
265 <xsl:when test="$ind2='0'">
266 <span class="label">Producer: </span>
268 <xsl:when test="$ind2='1'">
269 <span class="label">Publisher: </span>
271 <xsl:when test="$ind2='2'">
272 <span class="label">Distributor: </span>
274 <xsl:when test="$ind2='3'">
275 <span class="label">Manufacturer: </span>
277 <xsl:when test="$ind2='4'">
278 <span class="label">Copyright date: </span>
282 <xsl:if test="$field/marc:subfield[@code='a']">
283 <xsl:call-template name="subfieldSelect">
284 <xsl:with-param name="codes">a</xsl:with-param>
287 <xsl:text> </xsl:text>
290 <xsl:when test="$url='1'">
291 <xsl:if test="$field/marc:subfield[@code='b']">
293 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri($field/marc:subfield[@code='b'], true())"/></xsl:attribute>
294 <xsl:call-template name="subfieldSelect">
295 <xsl:with-param name="codes">b</xsl:with-param>
301 <xsl:if test="$field/marc:subfield[@code='b']">
302 <xsl:call-template name="subfieldSelect">
303 <xsl:with-param name="codes">b</xsl:with-param>
308 <xsl:text> </xsl:text>
309 <xsl:call-template name="chopPunctuation">
310 <xsl:with-param name="chopString">
311 <xsl:call-template name="subfieldSelect">
312 <xsl:with-param name="codes">c</xsl:with-param>
319 <xsl:template name="show-lang-041">
320 <xsl:if test="marc:datafield[@tag=041]">
321 <xsl:for-each select="marc:datafield[@tag=041]">
322 <span class="results_summary languages">
323 <xsl:call-template name="show-lang-node">
324 <xsl:with-param name="langNode" select="marc:subfield[@code='a']"/>
325 <xsl:with-param name="langLabel">Language: </xsl:with-param>
327 <xsl:call-template name="show-lang-node">
328 <xsl:with-param name="langNode" select="marc:subfield[@code='b']"/>
329 <xsl:with-param name="langLabel">Summary language: </xsl:with-param>
331 <xsl:call-template name="show-lang-node">
332 <xsl:with-param name="langNode" select="marc:subfield[@code='d']"/>
333 <xsl:with-param name="langLabel">Spoken language: </xsl:with-param>
335 <xsl:call-template name="show-lang-node">
336 <xsl:with-param name="langNode" select="marc:subfield[@code='h']"/>
337 <xsl:with-param name="langLabel">Original language: </xsl:with-param>
339 <xsl:call-template name="show-lang-node">
340 <xsl:with-param name="langNode" select="marc:subfield[@code='j']"/>
341 <xsl:with-param name="langLabel">Subtitle language: </xsl:with-param>
348 <xsl:template name="show-lang-node">
349 <xsl:param name="langNode"/>
350 <xsl:param name="langLabel"/>
351 <xsl:if test="$langNode">
352 <span class="language">
353 <span class="label"><xsl:value-of select="$langLabel"/></span>
354 <xsl:for-each select="$langNode">
356 <xsl:attribute name="class">lang_code-<xsl:value-of select="translate(., ' .-;|#', '_')"/></xsl:attribute>
357 <xsl:call-template name="languageCodeText">
358 <xsl:with-param name="code" select="."/>
360 <xsl:if test="position() != last()">
361 <span class="separator"><xsl:text>, </xsl:text></span>
365 <span class="separator"><xsl:text> </xsl:text></span>
370 <xsl:template name="show-series">
371 <xsl:param name="searchurl"/>
372 <xsl:param name="UseControlNumber"/>
373 <xsl:param name="UseAuthoritiesForTracings"/>
375 <xsl:if test="marc:datafield[@tag=440 or @tag=490 or @tag=800 or @tag=810 or @tag=811 or @tag=830]">
376 <span class="results_summary series"><span class="label">Series: </span>
378 <xsl:for-each select="marc:datafield[@tag=440 and @ind1!='z']">
379 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
380 <xsl:call-template name="chopPunctuation">
381 <xsl:with-param name="chopString">
382 <xsl:call-template name="subfieldSelect">
383 <xsl:with-param name="codes">a</xsl:with-param>
388 <xsl:call-template name="part"/>
389 <xsl:if test="marc:subfield[@code='v']">
390 <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" />
393 <xsl:when test="position()=last()">
394 <xsl:if test="../marc:datafield[@tag=490][@ind1!=1] or ../marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z'] or ../marc:datafield[@tag=830 and @ind1!='z']">
395 <span class="separator"> | </span>
398 <xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
402 <!-- 490 Series not traced, Ind1 = 0 -->
403 <xsl:for-each select="marc:datafield[@tag=490][@ind1!=1]">
404 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
405 <xsl:call-template name="chopPunctuation">
406 <xsl:with-param name="chopString">
407 <xsl:call-template name="subfieldSelect">
408 <xsl:with-param name="codes">a</xsl:with-param>
413 <xsl:call-template name="part"/>
414 <xsl:if test="marc:subfield[@code='v']">
415 <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" />
418 <xsl:when test="position()=last()">
419 <xsl:if test="../marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z'] or ../marc:datafield[@tag=830 and @ind1!='z']">
420 <span class="separator"> | </span>
423 <xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
426 <!-- 800,810,811,830 always display. -->
427 <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']">
429 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
430 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute>
431 <xsl:call-template name="chopPunctuation">
432 <xsl:with-param name="chopString">
433 <xsl:call-template name="subfieldSelect">
434 <xsl:with-param name="codes">a_t</xsl:with-param>
440 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
441 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
442 <xsl:call-template name="chopPunctuation">
443 <xsl:with-param name="chopString">
444 <xsl:call-template name="subfieldSelect">
445 <xsl:with-param name="codes">a_t</xsl:with-param>
452 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
453 <xsl:call-template name="chopPunctuation">
454 <xsl:with-param name="chopString">
455 <xsl:call-template name="subfieldSelect">
456 <xsl:with-param name="codes">a_t</xsl:with-param>
463 <xsl:call-template name="part"/>
464 <xsl:text> ; </xsl:text>
465 <xsl:value-of select="marc:subfield[@code='v']" />
467 <xsl:when test="position()=last()">
468 <xsl:if test="../marc:datafield[@tag=830 and @ind1!='z']">
469 <span class="separator"> | </span>
473 <span class="separator"> | </span>
478 <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']">
480 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
481 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="marc:subfield[@code='w']"/></xsl:attribute>
482 <xsl:call-template name="chopPunctuation">
483 <xsl:with-param name="chopString">
484 <xsl:call-template name="subfieldSelect">
485 <xsl:with-param name="codes">a_t</xsl:with-param>
491 <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
492 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute>
493 <xsl:call-template name="chopPunctuation">
494 <xsl:with-param name="chopString">
495 <xsl:call-template name="subfieldSelect">
496 <xsl:with-param name="codes">a_t</xsl:with-param>
503 <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute>
504 <xsl:call-template name="chopPunctuation">
505 <xsl:with-param name="chopString">
506 <xsl:call-template name="subfieldSelect">
507 <xsl:with-param name="codes">a_t</xsl:with-param>
514 <xsl:call-template name="part"/>
515 <xsl:if test="marc:subfield[@code='v']">
516 <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" />
518 <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose>
525 <xsl:template name="part">
526 <xsl:variable name="partNumber">
527 <xsl:call-template name="specialSubfieldSelect">
528 <xsl:with-param name="axis">n</xsl:with-param>
529 <xsl:with-param name="anyCodes">n</xsl:with-param>
530 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
533 <xsl:variable name="partName">
534 <xsl:call-template name="specialSubfieldSelect">
535 <xsl:with-param name="axis">p</xsl:with-param>
536 <xsl:with-param name="anyCodes">p</xsl:with-param>
537 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
540 <xsl:if test="string-length(normalize-space($partNumber)) or string-length(normalize-space($partName))" >
541 <xsl:text>. </xsl:text>
543 <xsl:if test="string-length(normalize-space($partNumber))">
544 <xsl:value-of select="$partNumber" />
546 <xsl:if test="string-length(normalize-space($partNumber))"><xsl:text> </xsl:text></xsl:if>
547 <xsl:if test="string-length(normalize-space($partName))">
548 <xsl:value-of select="$partName" />
552 <xsl:template name="quote_search_term">
553 <xsl:param name="term" />
554 <xsl:text>"</xsl:text>
555 <xsl:call-template name="escape_quotes">
556 <xsl:with-param name="text">
557 <xsl:value-of select="$term"/>
560 <xsl:text>"</xsl:text>
563 <xsl:template name="escape_quotes">
564 <xsl:param name="text"/>
566 <xsl:when test="contains($text, '"')">
567 <xsl:variable name="before" select="substring-before($text,'"')"/>
568 <xsl:variable name="next" select="substring-after($text,'"')"/>
569 <xsl:value-of select="$before"/>
570 <xsl:text>\"</xsl:text>
571 <xsl:call-template name="escape_quotes">
572 <xsl:with-param name="text" select="$next"/>
576 <xsl:value-of select="$text"/>
581 <xsl:template name="host-item-entries">
582 <xsl:param name="UseControlNumber"/>
584 <xsl:if test="marc:datafield[@tag=773]">
585 <xsl:for-each select="marc:datafield[@tag=773]">
586 <xsl:if test="@ind1 !=1">
587 <span class="results_summary in"><span class="label">
589 <xsl:when test="@ind2=' '">
592 <xsl:when test="@ind2=8 and marc:subfield[@code='i']">
593 <xsl:call-template name="subfieldSelect">
594 <xsl:with-param name="codes">i</xsl:with-param>
596 <xsl:text> </xsl:text>
600 <xsl:variable name="f773">
601 <xsl:call-template name="chopPunctuation">
602 <xsl:with-param name="chopString">
603 <xsl:call-template name="subfieldSelect">
604 <xsl:with-param name="codes">a_t</xsl:with-param>
610 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
611 <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>
612 <xsl:value-of select="translate($f773, '()', '')"/>
615 <xsl:when test="marc:subfield[@code='0']">
616 <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute>
617 <xsl:value-of select="$f773"/>
621 <xsl:variable name="host_query">
622 <xsl:text>ti,phr:(</xsl:text>
623 <xsl:call-template name="quote_search_term">
624 <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='t']"/></xsl:with-param>
626 <xsl:text>)</xsl:text>
627 <xsl:if test="marc:subfield[@code='a']">
628 <xsl:text> AND au:(</xsl:text>
629 <xsl:call-template name="quote_search_term">
630 <xsl:with-param name="term">
631 <xsl:value-of select="marc:subfield[@code='a']"/>
634 <xsl:text>)</xsl:text>
638 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of select="str:encode-uri($host_query, true())" />
640 <xsl:value-of select="$f773"/>
644 <xsl:if test="marc:subfield[@code='g']">
645 <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/>
648 <xsl:if test="marc:subfield[@code='n']">
649 <span class="results_summary in_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
656 <xsl:template name="AddMissingProtocol">
657 <xsl:param name="resourceLocation"/>
658 <xsl:param name="indicator1"/>
659 <xsl:param name="accessMethod"/>
660 <xsl:param name="delimiter" select="':'"/>
661 <xsl:if test="not(contains($resourceLocation, $delimiter))">
663 <xsl:when test="$indicator1=7 and ( $accessMethod='mailto' or $accessMethod='tel' )">
664 <xsl:value-of select="$accessMethod"/><xsl:text>:</xsl:text>
666 <xsl:when test="$indicator1=7">
667 <xsl:value-of select="$accessMethod"/><xsl:text>://</xsl:text>
669 <xsl:when test="$indicator1=0">
670 <xsl:text>mailto:</xsl:text>
672 <xsl:when test="$indicator1=1">
673 <xsl:text>ftp://</xsl:text>
675 <xsl:when test="$indicator1=2">
676 <xsl:text>telnet://</xsl:text>
678 <xsl:when test="$indicator1=3">
679 <xsl:text>tel:</xsl:text>
682 <xsl:text>http://</xsl:text>
688 <xsl:template name="GetCnumSearchURL">
689 <xsl:param name="title_subfield" select="'t'"/>
690 <xsl:param name="cnum_subfield" select="'w'"/>
691 <xsl:param name="opac_url" select="1"/>
692 <xsl:param name="UseControlNumber"/>
694 <xsl:variable name="orgcode">
696 <xsl:when test="$UseControlNumber!='1'"/>
697 <xsl:when test="substring-before(marc:subfield[@code=$cnum_subfield],')')">
698 <!-- substring before closing parenthesis, remove parentheses and spaces -->
699 <xsl:value-of select="normalize-space(translate(substring-before(marc:subfield[@code=$cnum_subfield],')'),'()',''))"/>
703 <xsl:variable name="controlnumber">
705 <xsl:when test="$UseControlNumber!='1'"/>
706 <xsl:when test="substring-after(marc:subfield[@code=$cnum_subfield],')')">
707 <!-- substring after closing parenthesis, remove spaces -->
708 <xsl:value-of select="normalize-space(substring-after(marc:subfield[@code=$cnum_subfield],')'))"/>
711 <!-- consider whole subfield now as controlnumber -->
712 <xsl:value-of select="normalize-space(marc:subfield[@code=$cnum_subfield])"/>
716 <xsl:variable name="scriptname">
718 <xsl:when test="$opac_url=1"><xsl:text>/cgi-bin/koha/opac-search.pl</xsl:text></xsl:when>
719 <xsl:otherwise><xsl:text>/cgi-bin/koha/catalogue/search.pl</xsl:text></xsl:otherwise>
723 <!-- search for (1) controlnumber AND orgcode, or (2) only controlnumber, or (3) title -->
724 <xsl:when test="$controlnumber!='' and $orgcode!=''">
725 <xsl:value-of select="str:encode-uri(concat($scriptname,'?q=Control-number:',$controlnumber,' AND Control-number-identifier:',$orgcode),false())"/>
727 <xsl:when test="$controlnumber!=''">
728 <xsl:value-of select="str:encode-uri(concat($scriptname,'?q=Control-number:',$controlnumber),false())"/>
731 <xsl:variable name="quoted_title">
732 <xsl:call-template name="quote_search_term">
733 <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code=$title_subfield]"/></xsl:with-param>
736 <xsl:value-of select="str:encode-uri(concat($scriptname,'?q=ti,phr:',translate($quoted_title, '()', '')),false())"/>
743 <!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
745 <scenarios/><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>