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="leader19" select="substring($leader,20,1)"/>
26 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
27 <xsl:variable name="materialTypeCode">
29 <xsl:when test="$leader19='a'">ST</xsl:when>
30 <xsl:when test="$leader6='a'">
32 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
33 <xsl:when test="$leader7='i' or $leader7='s'">SE</xsl:when>
34 <xsl:when test="$leader7='a' or $leader7='b'">AR</xsl:when>
37 <xsl:when test="$leader6='t'">BK</xsl:when>
38 <xsl:when test="$leader6='p'">MX</xsl:when>
39 <xsl:when test="$leader6='m'">CF</xsl:when>
40 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
41 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">VM</xsl:when>
42 <xsl:when test="$leader6='i' or $leader6='j'">MU</xsl:when>
43 <xsl:when test="$leader6='c' or $leader6='d'">PR</xsl:when>
46 <xsl:variable name="materialTypeLabel">
48 <xsl:when test="$leader19='a'">Set</xsl:when>
49 <xsl:when test="$leader6='a'">
51 <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'">Book</xsl:when>
52 <xsl:when test="$leader7='i' or $leader7='s'">Continuing Resource</xsl:when>
53 <xsl:when test="$leader7='a' or $leader7='b'">Article</xsl:when>
56 <xsl:when test="$leader6='t'">Book</xsl:when>
57 <xsl:when test="$leader6='p'">Mixed Materials</xsl:when>
58 <xsl:when test="$leader6='m'">Computer File</xsl:when>
59 <xsl:when test="$leader6='e' or $leader6='f'">Map</xsl:when>
60 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">Visual Material</xsl:when>
61 <xsl:when test="$leader6='j'">Music</xsl:when>
62 <xsl:when test="$leader6='i'">Sound</xsl:when>
63 <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when>
67 <!-- Title Statement -->
68 <!-- Alternate Graphic Representation (MARC 880) -->
69 <xsl:if test="$display880">
71 <xsl:call-template name="m880Select">
72 <xsl:with-param name="basetags">245</xsl:with-param>
73 <xsl:with-param name="codes">abhfgknps</xsl:with-param>
78 <xsl:if test="marc:datafield[@tag=245]">
80 <xsl:for-each select="marc:datafield[@tag=245]">
81 <xsl:call-template name="subfieldSelect">
82 <xsl:with-param name="codes">a</xsl:with-param>
84 <xsl:if test="marc:subfield[@code='b']">
85 <xsl:text> </xsl:text>
86 <xsl:call-template name="subfieldSelect">
87 <xsl:with-param name="codes">b</xsl:with-param>
90 <xsl:if test="marc:subfield[@code='h']">
91 <xsl:text> </xsl:text>
92 <xsl:call-template name="subfieldSelect">
93 <xsl:with-param name="codes">h</xsl:with-param>
96 <xsl:text> </xsl:text>
97 <xsl:call-template name="subfieldSelect">
98 <xsl:with-param name="codes">fgknps</xsl:with-param>
104 <!-- Author Statement: Alternate Graphic Representation (MARC 880) -->
105 <xsl:if test="$display880">
107 <xsl:call-template name="m880Select">
108 <xsl:with-param name="basetags">100,110,111,700,710,711</xsl:with-param>
109 <xsl:with-param name="codes">abc</xsl:with-param>
110 <xsl:with-param name="index">au</xsl:with-param>
111 <!-- do not use label 'by ' here, it would be repeated for every occurence of 100,110,111,700,710,711 -->
117 <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]">
118 <h5 class="author">by
119 <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
122 <xsl:when test="marc:subfield[@code=9]">
123 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
126 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
129 <xsl:call-template name="nameABCDQ"/></a>
131 <xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
134 <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
137 <xsl:when test="marc:subfield[@code=9]">
138 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
141 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
144 <xsl:call-template name="nameABCDN"/></a>
145 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
148 <xsl:for-each select="marc:datafield[@tag=111 or @tag=711]">
151 <xsl:when test="marc:subfield[@code=9]">
152 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
155 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
158 <xsl:call-template name="nameACDEQ"/></a>
159 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
166 <xsl:if test="$materialTypeCode!=''">
167 <span class="results_summary"><span class="label">Type: </span>
168 <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>
169 <xsl:text> </xsl:text>
170 <xsl:value-of select="$materialTypeLabel"/>
174 <!--Series: Alternate Graphic Representation (MARC 880) -->
175 <xsl:if test="$display880">
176 <xsl:call-template name="m880Select">
177 <xsl:with-param name="basetags">440,490</xsl:with-param>
178 <xsl:with-param name="codes">av</xsl:with-param>
179 <xsl:with-param name="class">results_summary</xsl:with-param>
180 <xsl:with-param name="label">Series: </xsl:with-param>
181 <xsl:with-param name="index">se</xsl:with-param>
185 <xsl:if test="marc:datafield[@tag=440 or @tag=490]">
186 <span class="results_summary"><span class="label">Series: </span>
187 <xsl:for-each select="marc:datafield[@tag=440]">
188 <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
189 <xsl:call-template name="chopPunctuation">
190 <xsl:with-param name="chopString">
191 <xsl:call-template name="subfieldSelect">
192 <xsl:with-param name="codes">av</xsl:with-param>
197 <xsl:text> </xsl:text><xsl:call-template name="part"/>
198 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
201 <xsl:for-each select="marc:datafield[@tag=490]">
202 <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
203 <xsl:call-template name="chopPunctuation">
204 <xsl:with-param name="chopString">
205 <xsl:call-template name="subfieldSelect">
206 <xsl:with-param name="codes">av</xsl:with-param>
211 <xsl:call-template name="part"/>
212 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
217 <!-- Publisher Statement: Alternate Graphic Representation (MARC 880) -->
218 <xsl:if test="$display880">
219 <xsl:call-template name="m880Select">
220 <xsl:with-param name="basetags">260</xsl:with-param>
221 <xsl:with-param name="codes">abcg</xsl:with-param>
222 <xsl:with-param name="class">results_summary</xsl:with-param>
223 <xsl:with-param name="label">Publisher: </xsl:with-param>
227 <xsl:if test="marc:datafield[@tag=260]">
228 <span class="results_summary"><span class="label">Publisher: </span>
229 <xsl:for-each select="marc:datafield[@tag=260]">
230 <xsl:if test="marc:subfield[@code='b']">
231 <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:{marc:subfield[@code='b']}">
232 <xsl:call-template name="subfieldSelect">
233 <xsl:with-param name="codes">b</xsl:with-param>
237 <xsl:text> </xsl:text>
238 <xsl:call-template name="chopPunctuation">
239 <xsl:with-param name="chopString">
240 <xsl:call-template name="subfieldSelect">
241 <xsl:with-param name="codes">acg</xsl:with-param>
245 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
250 <!-- Edition Statement: Alternate Graphic Representation (MARC 880) -->
251 <xsl:if test="$display880">
252 <xsl:call-template name="m880Select">
253 <xsl:with-param name="basetags">250</xsl:with-param>
254 <xsl:with-param name="codes">ab</xsl:with-param>
255 <xsl:with-param name="class">results_summary</xsl:with-param>
256 <xsl:with-param name="label">Edition: </xsl:with-param>
260 <xsl:if test="marc:datafield[@tag=250]">
261 <span class="results_summary"><span class="label">Edition: </span>
262 <xsl:for-each select="marc:datafield[@tag=250]">
263 <xsl:call-template name="chopPunctuation">
264 <xsl:with-param name="chopString">
265 <xsl:call-template name="subfieldSelect">
266 <xsl:with-param name="codes">ab</xsl:with-param>
270 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
275 <!-- Description: Alternate Graphic Representation (MARC 880) -->
276 <xsl:if test="$display880">
277 <xsl:call-template name="m880Select">
278 <xsl:with-param name="basetags">300</xsl:with-param>
279 <xsl:with-param name="codes">abceg</xsl:with-param>
280 <xsl:with-param name="class">results_summary</xsl:with-param>
281 <xsl:with-param name="label">Description: </xsl:with-param>
285 <xsl:if test="marc:datafield[@tag=300]">
286 <span class="results_summary"><span class="label">Description: </span>
287 <xsl:for-each select="marc:datafield[@tag=300]">
288 <xsl:call-template name="chopPunctuation">
289 <xsl:with-param name="chopString">
290 <xsl:call-template name="subfieldSelect">
291 <xsl:with-param name="codes">abceg</xsl:with-param>
295 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
300 <xsl:if test="marc:datafield[@tag=020]">
301 <span class="results_summary"><span class="label">ISBN: </span>
302 <xsl:for-each select="marc:datafield[@tag=020]">
303 <xsl:variable name="isbn" select="marc:subfield[@code='a']"/>
304 <xsl:value-of select="marc:subfield[@code='a']"/>
305 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
310 <xsl:if test="marc:datafield[@tag=022]">
311 <span class="results_summary"><span class="label">ISSN: </span>
312 <xsl:for-each select="marc:datafield[@tag=022]">
313 <xsl:value-of select="marc:subfield[@code='a']"/>
314 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
319 <!-- Other Title Statement: Alternate Graphic Representation (MARC 880) -->
320 <xsl:if test="$display880">
321 <xsl:call-template name="m880Select">
322 <xsl:with-param name="basetags">246</xsl:with-param>
323 <xsl:with-param name="codes">abhfgnp</xsl:with-param>
324 <xsl:with-param name="class">results_summary</xsl:with-param>
325 <xsl:with-param name="label">Other Title: </xsl:with-param>
329 <xsl:if test="marc:datafield[@tag=246]">
330 <span class="results_summary"><span class="label">Other Title: </span>
331 <xsl:for-each select="marc:datafield[@tag=246]">
332 <xsl:call-template name="chopPunctuation">
333 <xsl:with-param name="chopString">
334 <xsl:call-template name="subfieldSelect">
335 <xsl:with-param name="codes">iabhfgnp</xsl:with-param>
339 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
344 <!-- Uniform Title Statement: Alternate Graphic Representation (MARC 880) -->
345 <xsl:if test="$display880">
346 <xsl:call-template name="m880Select">
347 <xsl:with-param name="basetags">130,240</xsl:with-param>
348 <xsl:with-param name="codes">adfklmor</xsl:with-param>
349 <xsl:with-param name="class">results_summary</xsl:with-param>
350 <xsl:with-param name="label">Uniform Title: </xsl:with-param>
354 <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
355 <span class="results_summary"><span class="label">Uniform titles: </span>
356 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
357 <xsl:variable name="str">
358 <xsl:for-each select="marc:subfield">
359 <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'])))">
360 <xsl:value-of select="text()"/>
361 <xsl:text> </xsl:text>
365 <xsl:call-template name="chopPunctuation">
366 <xsl:with-param name="chopString">
367 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
371 <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
376 <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']">
377 <span class="results_summary"><span class="label">Subject(s): </span>
378 <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
381 <xsl:when test="marc:subfield[@code=9]">
382 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
385 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
388 <xsl:call-template name="chopPunctuation">
389 <xsl:with-param name="chopString">
390 <xsl:call-template name="subfieldSelect">
391 <xsl:with-param name="codes">abcdtvxyz</xsl:with-param>
392 <xsl:with-param name="subdivCodes">vxyz</xsl:with-param>
393 <xsl:with-param name="subdivDelimiter">-- </xsl:with-param>
399 <xsl:when test="position()=last()"></xsl:when>
400 <xsl:otherwise> | </xsl:otherwise>
407 <xsl:if test="marc:datafield[@tag=856]">
408 <span class="results_summary"><span class="label">Online Resources: </span>
409 <xsl:for-each select="marc:datafield[@tag=856]">
410 <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
412 <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
413 <xsl:call-template name="subfieldSelect">
414 <xsl:with-param name="codes">y3z</xsl:with-param>
417 <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
419 <xsl:when test="$URLLinkText!=''">
420 <xsl:value-of select="$URLLinkText"/>
423 <xsl:text>Click here to access online</xsl:text>
430 <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when>
431 <xsl:otherwise> | </xsl:otherwise>
437 <xsl:if test="marc:datafield[@tag=505]">
438 <xsl:for-each select="marc:datafield[@tag=505]">
439 <span class="results_summary">
441 <xsl:when test="@ind1=0">
442 <span class="label">Contents:</span>
444 <xsl:when test="@ind1=1">
445 <span class="label">Incomplete contents:</span>
447 <xsl:when test="@ind1=1">
448 <span class="label">Partial contents:</span>
452 <xsl:when test="@ind2=0">
453 <xsl:for-each select="marc:subfield[@code='t']">
454 <xsl:value-of select="marc:subfield[@code=t]"/> <xsl:value-of select="marc:subfield[@code=r]"/>
458 <xsl:call-template name="subfieldSelect">
459 <xsl:with-param name="codes">au</xsl:with-param>
468 <xsl:if test="marc:datafield[@tag=773]">
469 <xsl:for-each select="marc:datafield[@tag=773]">
470 <xsl:if test="@ind1=0">
471 <span class="results_summary"><span class="label">
473 <xsl:when test="@ind2=' '">
476 <xsl:when test="@ind2=8">
477 <xsl:if test="marc:subfield[@code='i']">
478 <xsl:value-of select="marc:subfield[@code='i']"/>
483 <xsl:variable name="f773">
484 <xsl:call-template name="subfieldSelect">
485 <xsl:with-param name="codes">at</xsl:with-param>
488 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
489 <xsl:value-of select="$f773"/>
493 <xsl:if test="marc:subfield[@code='n']">
494 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
502 <xsl:if test="marc:datafield[@tag=780]">
503 <xsl:for-each select="marc:datafield[@tag=780]">
504 <span class="results_summary">
506 <xsl:when test="@ind2=0">
507 <span class="label">Continues:</span>
509 <xsl:when test="@ind2=1">
510 <span class="label">Continues in part:</span>
512 <xsl:when test="@ind2=2">
513 <span class="label">Supersedes:</span>
515 <xsl:when test="@ind2=3">
516 <span class="label">Supersedes in part:</span>
518 <xsl:when test="@ind2=4">
519 <span class="label">Formed by the union: ... and: ...</span>
521 <xsl:when test="@ind2=5">
522 <span class="label">Absorbed:</span>
524 <xsl:when test="@ind2=6">
525 <span class="label">Absorbed in part:</span>
527 <xsl:when test="@ind2=7">
528 <span class="label">Separated from:</span>
531 <xsl:variable name="f780">
532 <xsl:call-template name="subfieldSelect">
533 <xsl:with-param name="codes">at</xsl:with-param>
536 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute>
537 <xsl:value-of select="translate($f780, '()', '')"/>
542 <xsl:when test="@ind1=0">
543 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
551 <xsl:if test="marc:datafield[@tag=785]">
552 <xsl:for-each select="marc:datafield[@tag=785]">
553 <span class="results_summary">
555 <xsl:when test="@ind2=0">
556 <span class="label">Continued by:</span>
558 <xsl:when test="@ind2=1">
559 <span class="label">Continued in part by:</span>
561 <xsl:when test="@ind2=2">
562 <span class="label">Superseded by:</span>
564 <xsl:when test="@ind2=3">
565 <span class="label">Superseded in part by:</span>
567 <xsl:when test="@ind2=4">
568 <span class="label">Absorbed by:</span>
570 <xsl:when test="@ind2=5">
571 <span class="label">Absorbed in part by:</span>
573 <xsl:when test="@ind2=6">
574 <span class="label">Split into .. and ...:</span>
576 <xsl:when test="@ind2=7">
577 <span class="label">Merged with ... to form ...</span>
579 <xsl:when test="@ind2=8">
580 <span class="label">Changed back to:</span>
584 <xsl:variable name="f785">
585 <xsl:call-template name="subfieldSelect">
586 <xsl:with-param name="codes">at</xsl:with-param>
590 <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute>
591 <xsl:value-of select="translate($f785, '()', '')"/>
598 <xsl:if test="$OPACBaseURL!=''">
599 <span class="results_summary"><span class="label">OPAC view: </span>
600 <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>.
606 <xsl:template name="nameABCDQ">
607 <xsl:call-template name="chopPunctuation">
608 <xsl:with-param name="chopString">
609 <xsl:call-template name="subfieldSelect">
610 <xsl:with-param name="codes">aq</xsl:with-param>
613 <xsl:with-param name="punctuation">
614 <xsl:text>:,;/ </xsl:text>
617 <xsl:call-template name="termsOfAddress"/>
620 <xsl:template name="nameABCDN">
621 <xsl:for-each select="marc:subfield[@code='a']">
622 <xsl:call-template name="chopPunctuation">
623 <xsl:with-param name="chopString" select="."/>
626 <xsl:for-each select="marc:subfield[@code='b']">
627 <xsl:value-of select="."/>
629 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
630 <xsl:call-template name="subfieldSelect">
631 <xsl:with-param name="codes">cdn</xsl:with-param>
636 <xsl:template name="nameACDEQ">
637 <xsl:call-template name="subfieldSelect">
638 <xsl:with-param name="codes">acdeq</xsl:with-param>
641 <xsl:template name="termsOfAddress">
642 <xsl:if test="marc:subfield[@code='b' or @code='c']">
643 <xsl:call-template name="chopPunctuation">
644 <xsl:with-param name="chopString">
645 <xsl:call-template name="subfieldSelect">
646 <xsl:with-param name="codes">bc</xsl:with-param>
653 <xsl:template name="part">
654 <xsl:variable name="partNumber">
655 <xsl:call-template name="specialSubfieldSelect">
656 <xsl:with-param name="axis">n</xsl:with-param>
657 <xsl:with-param name="anyCodes">n</xsl:with-param>
658 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
661 <xsl:variable name="partName">
662 <xsl:call-template name="specialSubfieldSelect">
663 <xsl:with-param name="axis">p</xsl:with-param>
664 <xsl:with-param name="anyCodes">p</xsl:with-param>
665 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
668 <xsl:if test="string-length(normalize-space($partNumber))">
669 <xsl:call-template name="chopPunctuation">
670 <xsl:with-param name="chopString" select="$partNumber"/>
673 <xsl:if test="string-length(normalize-space($partName))">
674 <xsl:call-template name="chopPunctuation">
675 <xsl:with-param name="chopString" select="$partName"/>
680 <xsl:template name="specialSubfieldSelect">
681 <xsl:param name="anyCodes"/>
682 <xsl:param name="axis"/>
683 <xsl:param name="beforeCodes"/>
684 <xsl:param name="afterCodes"/>
685 <xsl:variable name="str">
686 <xsl:for-each select="marc:subfield">
687 <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])">
688 <xsl:value-of select="text()"/>
689 <xsl:text> </xsl:text>
693 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>