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="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
20 <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
22 <xsl:variable name="leader" select="marc:leader"/>
23 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
24 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
25 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
26 <xsl:variable name="materialTypeCode">
28 <xsl:when test="$leader6='a'">
30 <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
31 <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
34 <xsl:when test="$leader6='t'">BK</xsl:when>
35 <xsl:when test="$leader6='o' or $leader6='p'">MX</xsl:when>
36 <xsl:when test="$leader6='m'">CF</xsl:when>
37 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
38 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">VM</xsl:when>
39 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
40 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
43 <xsl:variable name="materialTypeLabel">
45 <xsl:when test="$leader6='a'">
47 <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
48 <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">Continuing Resource</xsl:when>
51 <xsl:when test="$leader6='t'">Book</xsl:when>
52 <xsl:when test="$leader6='o'">Kit</xsl:when>
53 <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
54 <xsl:when test="$leader6='m'">Computer File</xsl:when>
55 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
56 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'">Visual Material</xsl:when>
57 <xsl:when test="$leader6='j'">Music</xsl:when>
58 <xsl:when test="$leader6='i'">Sound</xsl:when>
59 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
63 <!-- Title Statement -->
64 <!-- Alternate Graphic Representation (MARC 880) -->
65 <xsl:if test="$display880">
67 <xsl:call-template name="m880Select">
68 <xsl:with-param name="basetags">245</xsl:with-param>
69 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
74 <xsl:if test="marc:datafield[@tag=245]">
76 <xsl:for-each select="marc:datafield[@tag=245]">
77 <xsl:call-template name="subfieldSelect">
78 <xsl:with-param name="codes">a</xsl:with-param>
80 <xsl:if test="marc:subfield[@code='b']">
81 <xsl:text> </xsl:text>
82 <xsl:call-template name="subfieldSelect">
83 <xsl:with-param name="codes">b</xsl:with-param>
86 <xsl:if test="marc:subfield[@code='h']">
87 <xsl:text> </xsl:text>
88 <xsl:call-template name="subfieldSelect">
89 <xsl:with-param name="codes">h</xsl:with-param>
92 <xsl:text> </xsl:text>
93 <xsl:call-template name="subfieldSelect">
94 <xsl:with-param name="codes">fgknps</xsl:with-param>
100 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
101 <xsl:if test="$display880">
103 <xsl:call-template name="m880Select">
104 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
105 <xsl:with-param name="codes">abc</xsl:with-param>
106 <xsl:with-param name="index">au</xsl:with-param>
107 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
113 <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]">
114 <h5 class="author">by
115 <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
118 <xsl:when test="marc:subfield[@code=9]">
119 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
122 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
125 <xsl:call-template name="nameABCDQ"/></a>
127 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
130 <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
133 <xsl:when test="marc:subfield[@code=9]">
134 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
137 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
140 <xsl:call-template name="nameABCDN"/></a>
141 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
144 <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
147 <xsl:when test="marc:subfield[@code=9]">
148 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
151 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
154 <xsl:call-template name="nameACDEQ"/></a>
155 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
162 <xsl:if test="$materialTypeCode!=''">
163 <span class="results_summary"><span class="label">Type: </span>
164 <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>
165 <xsl:text> </xsl:text>
166 <xsl:value-of select="$materialTypeLabel"/>
170 <!--Series: Alternate Graphic Representation (MARC 880) -->
171 <xsl:if test="$display880">
172 <xsl:call-template name="m880Select">
173 <xsl:with-param name="basetags">440,490</xsl:with-param>
174 <xsl:with-param name="codes">av</xsl:with-param>
175 <xsl:with-param name="class">results_summary</xsl:with-param>
176 <xsl:with-param name="label">Series: </xsl:with-param>
177 <xsl:with-param name="index">se</xsl:with-param>
181 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
182 <span class="results_summary"><span class="label">Series: </span>
183 <xsl:for-each select="marc:datafield[@tag=440]">
184 <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
185 <xsl:call-template name="chopPunctuation">
186 <xsl:with-param name="chopString">
187 <xsl:call-template name="subfieldSelect">
188 <xsl:with-param name="codes">av</xsl:with-param>
193 <xsl:text> </xsl:text><xsl:call-template name="part"/>
194 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
197 <xsl:for-each select="marc:datafield[@tag=490]">
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">av</xsl:with-param>
207 <xsl:call-template name="part"/>
208 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
213 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
214 <xsl:if test="$display880">
215 <xsl:call-template name="m880Select">
216 <xsl:with-param name="basetags">260</xsl:with-param>
217 <xsl:with-param name="codes">abcg</xsl:with-param>
218 <xsl:with-param name="class">results_summary</xsl:with-param>
219 <xsl:with-param name="label">Publisher: </xsl:with-param>
223 <xsl:if test="marc:datafield[@tag=260]">
224 <span class="results_summary"><span class="label">Publisher: </span>
225 <xsl:for-each select="marc:datafield[@tag=260]">
226 <xsl:if test="marc:subfield[@code='b']">
227 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
228 <xsl:call-template name="subfieldSelect">
229 <xsl:with-param name="codes">b</xsl:with-param>
233 <xsl:text> </xsl:text>
234 <xsl:call-template name="chopPunctuation">
235 <xsl:with-param name="chopString">
236 <xsl:call-template name="subfieldSelect">
237 <xsl:with-param name="codes">acg</xsl:with-param>
241 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
246 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
247 <xsl:if test="$display880">
248 <xsl:call-template name="m880Select">
249 <xsl:with-param name="basetags">250</xsl:with-param>
250 <xsl:with-param name="codes">ab</xsl:with-param>
251 <xsl:with-param name="class">results_summary</xsl:with-param>
252 <xsl:with-param name="label">Edition: </xsl:with-param>
256 <xsl:if test="marc:datafield[@tag=250]">
257 <span class="results_summary"><span class="label">Edition: </span>
258 <xsl:for-each select="marc:datafield[@tag=250]">
259 <xsl:call-template name="chopPunctuation">
260 <xsl:with-param name="chopString">
261 <xsl:call-template name="subfieldSelect">
262 <xsl:with-param name="codes">ab</xsl:with-param>
266 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
271 <!-- Description: Alternate Graphic Representation (MARC 880) -->
272 <xsl:if test="$display880">
273 <xsl:call-template name="m880Select">
274 <xsl:with-param name="basetags">300</xsl:with-param>
275 <xsl:with-param name="codes">abceg</xsl:with-param>
276 <xsl:with-param name="class">results_summary</xsl:with-param>
277 <xsl:with-param name="label">Description: </xsl:with-param>
281 <xsl:if test="marc:datafield[@tag=300]">
282 <span class="results_summary"><span class="label">Description: </span>
283 <xsl:for-each select="marc:datafield[@tag=300]">
284 <xsl:call-template name="chopPunctuation">
285 <xsl:with-param name="chopString">
286 <xsl:call-template name="subfieldSelect">
287 <xsl:with-param name="codes">abceg</xsl:with-param>
291 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
296 <xsl:if test="marc:datafield[@tag=020]">
297 <span class="results_summary"><span class="label">ISBN: </span>
298 <xsl:for-each select="marc:datafield[@tag=020]">
299 <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
300 <xsl:value-of select="marc:subfield[@code='a']"/>
301 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
306 <xsl:if test="marc:datafield[@tag=022]">
307 <span class="results_summary"><span class="label">ISSN: </span>
308 <xsl:for-each select="marc:datafield[@tag=022]">
309 <xsl:value-of select="marc:subfield[@code='a']"/>
310 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
315 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
316 <xsl:if test="$display880">
317 <xsl:call-template name="m880Select">
318 <xsl:with-param name="basetags">246</xsl:with-param>
319 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
320 <xsl:with-param name="class">results_summary</xsl:with-param>
321 <xsl:with-param name="label">Other Title: </xsl:with-param>
325 <xsl:if test="marc:datafield[@tag=246]">
326 <span class="results_summary"><span class="label">Other Title: </span>
327 <xsl:for-each select="marc:datafield[@tag=246]">
328 <xsl:call-template name="chopPunctuation">
329 <xsl:with-param name="chopString">
330 <xsl:call-template name="subfieldSelect">
331 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
335 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
340 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
341 <xsl:if test="$display880">
342 <xsl:call-template name="m880Select">
343 <xsl:with-param name="basetags">130,240</xsl:with-param>
344 <xsl:with-param name="codes">adfklmor</xsl:with-param>
345 <xsl:with-param name="class">results_summary</xsl:with-param>
346 <xsl:with-param name="label">Uniform Title: </xsl:with-param>
350 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
351 <span class="results_summary"><span class="label">Uniform titles: </span>
352 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
353 <xsl:variable name="str">
354 <xsl:for-each select="marc:subfield">
355 <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'])))">
356 <xsl:value-of select="text()"/>
357 <xsl:text> </xsl:text>
361 <xsl:call-template name="chopPunctuation">
362 <xsl:with-param name="chopString">
363 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
367 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
372 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
373 <span class="results_summary"><span class="label">Subject(s): </span>
374 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
377 <xsl:when test="marc:subfield[@code=9]">
378 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
381 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
384 <xsl:call-template name="chopPunctuation">
385 <xsl:with-param name="chopString">
386 <xsl:call-template name="subfieldSelect">
387 <xsl:with-param name="codes">abcdtvxyz</xsl:with-param>
388 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
389 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
395 <xsl:when test="position()=last()"></xsl:when>
396 <xsl:otherwise> | </xsl:otherwise>
403 <xsl:if test="marc:datafield[@tag=856]">
404 <span class="results_summary"><span class="label">Online Resources: </span>
405 <xsl:for-each select="marc:datafield[@tag=856]">
406 <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
408 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
409 <xsl:call-template name="subfieldSelect">
410 <xsl:with-param name="codes">y3z</xsl:with-param>
413 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
415 <xsl:when test="$URLLinkText!=''">
416 <xsl:value-of select="$URLLinkText"/>
419 <xsl:text>Click here to access online</xsl:text>
426 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
427 <xsl:otherwise> | </xsl:otherwise>
433 <xsl:if test="marc:datafield[@tag=505]">
434 <xsl:for-each select="marc:datafield[@tag=505]">
435 <span class="results_summary">
437 <xsl:when test="@ind1=0">
438 <span class="label">Contents:</span>
440 <xsl:when test="@ind1=1">
441 <span class="label">Incomplete contents:</span>
443 <xsl:when test="@ind1=1">
444 <span class="label">Partial contents:</span>
448 <xsl:when test="@ind2=0">
449 <xsl:for-each select="marc:subfield[@code='t']">
450 <xsl:value-of select="marc:subfield[@code=t]"/> <xsl:value-of select="marc:subfield[@code=r]"/>
454 <xsl:call-template name="subfieldSelect">
455 <xsl:with-param name="codes">au</xsl:with-param>
464 <xsl:if test="marc:datafield[@tag=780]">
465 <xsl:for-each select="marc:datafield[@tag=780]">
466 <span class="results_summary">
468 <xsl:when test="@ind2=0">
469 <span class="label">Continues:</span>
471 <xsl:when test="@ind2=1">
472 <span class="label">Continues in part:</span>
474 <xsl:when test="@ind2=2">
475 <span class="label">Supersedes:</span>
477 <xsl:when test="@ind2=3">
478 <span class="label">Supersedes in part:</span>
480 <xsl:when test="@ind2=4">
481 <span class="label">Formed by the union: ... and: ...</span>
483 <xsl:when test="@ind2=5">
484 <span class="label">Absorbed:</span>
486 <xsl:when test="@ind2=6">
487 <span class="label">Absorbed in part:</span>
489 <xsl:when test="@ind2=7">
490 <span class="label">Separated from:</span>
493 <xsl:variable name="f780">
494 <xsl:call-template name="subfieldSelect">
495 <xsl:with-param name="codes">at</xsl:with-param>
498 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
499 <xsl:value-of select="translate($f780, '()', '')"/>
504 <xsl:when test="@ind1=0">
505 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
513 <xsl:if test="marc:datafield[@tag=785]">
514 <xsl:for-each select="marc:datafield[@tag=785]">
515 <span class="results_summary">
517 <xsl:when test="@ind2=0">
518 <span class="label">Continued by:</span>
520 <xsl:when test="@ind2=1">
521 <span class="label">Continued in part by:</span>
523 <xsl:when test="@ind2=2">
524 <span class="label">Superseded by:</span>
526 <xsl:when test="@ind2=3">
527 <span class="label">Superseded in part by:</span>
529 <xsl:when test="@ind2=4">
530 <span class="label">Absorbed by:</span>
532 <xsl:when test="@ind2=5">
533 <span class="label">Absorbed in part by:</span>
535 <xsl:when test="@ind2=6">
536 <span class="label">Split into .. and ...:</span>
538 <xsl:when test="@ind2=7">
539 <span class="label">Merged with ... to form ...</span>
541 <xsl:when test="@ind2=8">
542 <span class="label">Changed back to:</span>
546 <xsl:variable name="f785">
547 <xsl:call-template name="subfieldSelect">
548 <xsl:with-param name="codes">at</xsl:with-param>
552 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
553 <xsl:value-of select="translate($f785, '()', '')"/>
560 <xsl:if test="$OPACBaseURL!=''">
561 <span class="results_summary"><span class="label">OPAC view: </span>
562 <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>.
568 <xsl:template name="nameABCDQ">
569 <xsl:call-template name="chopPunctuation">
570 <xsl:with-param name="chopString">
571 <xsl:call-template name="subfieldSelect">
572 <xsl:with-param name="codes">aq</xsl:with-param>
575 <xsl:with-param name="punctuation">
576 <xsl:text>:,;/ </xsl:text>
579 <xsl:call-template name="termsOfAddress"/>
582 <xsl:template name="nameABCDN">
583 <xsl:for-each select="marc:subfield[@code='a']">
584 <xsl:call-template name="chopPunctuation">
585 <xsl:with-param name="chopString" select="."/>
588 <xsl:for-each select="marc:subfield[@code='b']">
589 <xsl:value-of select="."/>
591 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
592 <xsl:call-template name="subfieldSelect">
593 <xsl:with-param name="codes">cdn</xsl:with-param>
598 <xsl:template name="nameACDEQ">
599 <xsl:call-template name="subfieldSelect">
600 <xsl:with-param name="codes">acdeq</xsl:with-param>
603 <xsl:template name="termsOfAddress">
604 <xsl:if test="marc:subfield[@code='b' or @code='c']">
605 <xsl:call-template name="chopPunctuation">
606 <xsl:with-param name="chopString">
607 <xsl:call-template name="subfieldSelect">
608 <xsl:with-param name="codes">bc</xsl:with-param>
615 <xsl:template name="part">
616 <xsl:variable name="partNumber">
617 <xsl:call-template name="specialSubfieldSelect">
618 <xsl:with-param name="axis">n</xsl:with-param>
619 <xsl:with-param name="anyCodes">n</xsl:with-param>
620 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
623 <xsl:variable name="partName">
624 <xsl:call-template name="specialSubfieldSelect">
625 <xsl:with-param name="axis">p</xsl:with-param>
626 <xsl:with-param name="anyCodes">p</xsl:with-param>
627 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
630 <xsl:if test="string-length(normalize-space($partNumber))">
631 <xsl:call-template name="chopPunctuation">
632 <xsl:with-param name="chopString" select="$partNumber"/>
635 <xsl:if test="string-length(normalize-space($partName))">
636 <xsl:call-template name="chopPunctuation">
637 <xsl:with-param name="chopString" select="$partName"/>
642 <xsl:template name="specialSubfieldSelect">
643 <xsl:param name="anyCodes"/>
644 <xsl:param name="axis"/>
645 <xsl:param name="beforeCodes"/>
646 <xsl:param name="afterCodes"/>
647 <xsl:variable name="str">
648 <xsl:for-each select="marc:subfield">
649 <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])">
650 <xsl:value-of select="text()"/>
651 <xsl:text> </xsl:text>
655 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>