1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xlink marc">
3 <xsl:include href="http://www.loc.gov/marcxml/xslt/MARC21slimUtils.xsl"/>
4 <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
7 Revision 1.10 subfield $h in 245 suppressed from mods:title 2006/03/23 ntra
9 Revision 1.9 subfield $y was added to field 242 2004/09/02 10:57 jrad
11 Revision 1.8 Subject chopPunctuation expanded and attribute fixes 2004/08/12 jrad
13 Revision 1.7 2004/03/25 08:29 jrad
15 Revision 1.6 various validation fixes 2004/02/20 ntra
17 Revision 1.5 2003/10/02 16:18:58 ntra
18 MODS2 to MODS3 updates, language unstacking and
19 de-duping, chopPunctuation expanded
21 Revision 1.3 2003/04/03 00:07:19 ntra
22 Revision 1.3 Additional Changes not related to MODS Version 2.0 by ntra
24 Revision 1.2 2003/03/24 19:37:42 ckeith
28 <xsl:template match="/">
30 <xsl:when test="marc:collection">
31 <modsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd">
32 <xsl:for-each select="marc:collection/marc:record">
34 <xsl:call-template name="marcRecord"/>
40 <mods version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-0.xsd">
41 <xsl:for-each select="marc:record">
42 <xsl:call-template name="marcRecord"/>
49 <xsl:template name="marcRecord">
50 <xsl:variable name="leader" select="marc:leader"/>
51 <xsl:variable name="leader6" select="substring($leader,7,1)"/>
52 <xsl:variable name="leader7" select="substring($leader,8,1)"/>
53 <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
54 <xsl:variable name="typeOf008">
56 <xsl:when test="$leader6='a'">
58 <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">BK</xsl:when>
59 <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">SE</xsl:when>
62 <xsl:when test="$leader6='t'">BK</xsl:when>
63 <xsl:when test="$leader6='p'">MM</xsl:when>
64 <xsl:when test="$leader6='m'">CF</xsl:when>
65 <xsl:when test="$leader6='e' or $leader6='f'">MP</xsl:when>
66 <xsl:when test="$leader6='g' or $leader6='k' or $leader6='o' or $leader6='r'">VM</xsl:when>
67 <xsl:when test="$leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">MU</xsl:when>
71 <xsl:for-each select="marc:datafield[@tag=245]">
73 <xsl:variable name="title">
75 <xsl:when test="marc:subfield[@code='b']">
76 <xsl:call-template name="specialSubfieldSelect">
77 <xsl:with-param name="axis">b</xsl:with-param>
78 <xsl:with-param name="beforeCodes">afgk</xsl:with-param>
82 <xsl:call-template name="subfieldSelect">
83 <xsl:with-param name="codes">abfgk</xsl:with-param>
89 <xsl:variable name="titleChop">
90 <xsl:call-template name="chopPunctuation">
91 <xsl:with-param name="chopString">
92 <xsl:value-of select="$title"/>
97 <xsl:when test="@ind2>0">
99 <xsl:value-of select="substring($titleChop,1,@ind2)"/>
102 <xsl:value-of select="substring($titleChop,@ind2+1)"/>
107 <xsl:value-of select="$titleChop"/>
111 <xsl:if test="marc:subfield[@code='b']">
113 <xsl:call-template name="chopPunctuation">
114 <xsl:with-param name="chopString">
115 <xsl:call-template name="specialSubfieldSelect">
116 <xsl:with-param name="axis">b</xsl:with-param>
117 <xsl:with-param name="anyCodes">b</xsl:with-param>
118 <xsl:with-param name="afterCodes">afgk</xsl:with-param>
124 <xsl:call-template name="part"/>
128 <xsl:for-each select="marc:datafield[@tag=210]">
129 <titleInfo type="abbreviated">
131 <xsl:call-template name="chopPunctuation">
132 <xsl:with-param name="chopString">
133 <xsl:call-template name="subfieldSelect">
134 <xsl:with-param name="codes">a</xsl:with-param>
139 <xsl:call-template name="subtitle"/>
143 <xsl:for-each select="marc:datafield[@tag=242]">
144 <titleInfo type="translated">
145 <!--09/01/04 Added subfield $y-->
146 <xsl:for-each select="marc:subfield[@code='y']">
147 <xsl:attribute name="lang">
148 <xsl:value-of select="text()"/>
153 <xsl:call-template name="chopPunctuation">
154 <xsl:with-param name="chopString">
155 <xsl:call-template name="subfieldSelect">
156 <!-- 1/04 removed $h, b -->
157 <xsl:with-param name="codes">a</xsl:with-param>
165 <xsl:call-template name="subtitle"/>
166 <xsl:call-template name="part"/>
170 <xsl:for-each select="marc:datafield[@tag=246]">
171 <titleInfo type="alternative">
172 <xsl:for-each select="marc:subfield[@code='i']">
173 <xsl:attribute name="displayLabel">
174 <xsl:value-of select="text()"/>
178 <xsl:call-template name="chopPunctuation">
179 <xsl:with-param name="chopString">
180 <xsl:call-template name="subfieldSelect">
181 <!-- 1/04 removed $h, $b -->
182 <xsl:with-param name="codes">af</xsl:with-param>
187 <xsl:call-template name="subtitle"/>
188 <xsl:call-template name="part"/>
192 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
193 <titleInfo type="uniform">
195 <xsl:variable name="str">
196 <xsl:for-each select="marc:subfield">
197 <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'])))">
198 <xsl:value-of select="text()"/>
199 <xsl:text> </xsl:text>
204 <xsl:call-template name="chopPunctuation">
205 <xsl:with-param name="chopString">
206 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
210 <xsl:call-template name="part"/>
214 <xsl:for-each select="marc:datafield[@tag=740][@ind2!=2]">
215 <titleInfo type="alternative">
217 <xsl:call-template name="chopPunctuation">
218 <xsl:with-param name="chopString">
219 <xsl:call-template name="subfieldSelect">
220 <xsl:with-param name="codes">ah</xsl:with-param>
225 <xsl:call-template name="part"/>
229 <xsl:for-each select="marc:datafield[@tag=100]">
230 <name type="personal">
231 <xsl:call-template name="nameABCDQ"/>
232 <xsl:call-template name="affiliation"/>
234 <roleTerm authority="marcrelator" type="text">creator</roleTerm>
236 <xsl:call-template name="role"/>
240 <xsl:for-each select="marc:datafield[@tag=110]">
241 <name type="corporate">
242 <xsl:call-template name="nameABCDN"/>
244 <roleTerm authority="marcrelator" type="text">creator</roleTerm>
246 <xsl:call-template name="role"/>
250 <xsl:for-each select="marc:datafield[@tag=111]">
251 <name type="conference">
252 <xsl:call-template name="nameACDEQ"/>
254 <roleTerm authority="marcrelator" type="text">creator</roleTerm>
256 <xsl:call-template name="role"/>
260 <xsl:for-each select="marc:datafield[@tag=700][not(marc:subfield[@code='t'])]">
261 <name type="personal">
262 <xsl:call-template name="nameABCDQ"/>
263 <xsl:call-template name="affiliation"/>
264 <xsl:call-template name="role"/>
268 <xsl:for-each select="marc:datafield[@tag=710][not(marc:subfield[@code='t'])]">
269 <name type="corporate">
270 <xsl:call-template name="nameABCDN"/>
271 <xsl:call-template name="role"/>
275 <xsl:for-each select="marc:datafield[@tag=711][not(marc:subfield[@code='t'])]">
276 <name type="conference">
277 <xsl:call-template name="nameACDEQ"/>
278 <xsl:call-template name="role"/>
282 <xsl:for-each select="marc:datafield[@tag=720][not(marc:subfield[@code='t'])]">
284 <xsl:if test="@ind1=1">
285 <xsl:attribute name="type">
286 <xsl:text>personal</xsl:text>
290 <xsl:value-of select="marc:subfield[@code='a']"/>
292 <xsl:call-template name="role"/>
297 <xsl:if test="$leader7='c'">
298 <xsl:attribute name="collection">yes</xsl:attribute>
300 <xsl:if test="$leader6='d' or $leader6='f' or $leader6='p' or $leader6='t'">
301 <xsl:attribute name="manuscript">yes</xsl:attribute>
304 <xsl:when test="$leader6='a' or $leader6='t'">text</xsl:when>
305 <xsl:when test="$leader6='e' or $leader6='f'">cartographic</xsl:when>
306 <xsl:when test="$leader6='c' or $leader6='d'">notated music</xsl:when>
307 <xsl:when test="$leader6='i'">sound recording-nonmusical</xsl:when>
308 <xsl:when test="$leader6='j'">sound recording-musical</xsl:when>
309 <xsl:when test="$leader6='k'">still image</xsl:when>
310 <xsl:when test="$leader6='g'">moving image</xsl:when>
311 <xsl:when test="$leader6='r'">three dimensional object</xsl:when>
312 <xsl:when test="$leader6='m'">software, multimedia</xsl:when>
313 <xsl:when test="$leader6='p'">mixed material</xsl:when>
317 <xsl:if test="substring($controlField008,26,1)='d'">
318 <genre authority="marc">globe</genre>
321 <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='r']">
322 <genre authority="marc">remote sensing image</genre>
325 <xsl:if test="$typeOf008='MP'">
326 <xsl:variable name="controlField008-25" select="substring($controlField008,26,1)"/>
328 <xsl:when test="$controlField008-25='a' or $controlField008-25='b' or $controlField008-25='c' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='j']">
329 <genre authority="marc">map</genre>
331 <xsl:when test="$controlField008-25='e' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='d']">
332 <genre authority="marc">atlas</genre>
337 <xsl:if test="$typeOf008='SE'">
338 <xsl:variable name="controlField008-21" select="substring($controlField008,22,1)"/>
340 <xsl:when test="$controlField008-21='d'">
341 <genre authority="marc">database</genre>
343 <xsl:when test="$controlField008-21='l'">
344 <genre authority="marc">loose-leaf</genre>
346 <xsl:when test="$controlField008-21='m'">
347 <genre authority="marc">series</genre>
349 <xsl:when test="$controlField008-21='n'">
350 <genre authority="marc">newspaper</genre>
352 <xsl:when test="$controlField008-21='p'">
353 <genre authority="marc">periodical</genre>
355 <xsl:when test="$controlField008-21='w'">
356 <genre authority="marc">web site</genre>
361 <xsl:if test="$typeOf008='BK' or $typeOf008='SE'">
362 <xsl:variable name="controlField008-24" select="substring($controlField008,25,4)"/>
364 <xsl:when test="contains($controlField008-24,'a')">
365 <genre authority="marc">abstract or summary</genre>
367 <xsl:when test="contains($controlField008-24,'b')">
368 <genre authority="marc">bibliography</genre>
370 <xsl:when test="contains($controlField008-24,'c')">
371 <genre authority="marc">catalog</genre>
373 <xsl:when test="contains($controlField008-24,'d')">
374 <genre authority="marc">dictionary</genre>
376 <xsl:when test="contains($controlField008-24,'e')">
377 <genre authority="marc">encyclopedia</genre>
379 <xsl:when test="contains($controlField008-24,'f')">
380 <genre authority="marc">handbook</genre>
382 <xsl:when test="contains($controlField008-24,'g')">
383 <genre authority="marc">legal article</genre>
385 <xsl:when test="contains($controlField008-24,'i')">
386 <genre authority="marc">index</genre>
388 <xsl:when test="contains($controlField008-24,'k')">
389 <genre authority="marc">discography</genre>
391 <xsl:when test="contains($controlField008-24,'l')">
392 <genre authority="marc">legislation</genre>
394 <xsl:when test="contains($controlField008-24,'m')">
395 <genre authority="marc">theses</genre>
397 <xsl:when test="contains($controlField008-24,'n')">
398 <genre authority="marc">survey of literature</genre>
400 <xsl:when test="contains($controlField008-24,'o')">
401 <genre authority="marc">review</genre>
403 <xsl:when test="contains($controlField008-24,'p')">
404 <genre authority="marc">programmed text</genre>
406 <xsl:when test="contains($controlField008-24,'q')">
407 <genre authority="marc">filmography</genre>
409 <xsl:when test="contains($controlField008-24,'r')">
410 <genre authority="marc">directory</genre>
412 <xsl:when test="contains($controlField008-24,'s')">
413 <genre authority="marc">statistics</genre>
415 <xsl:when test="contains($controlField008-24,'t')">
416 <genre authority="marc">technical report</genre>
418 <xsl:when test="contains($controlField008-24,'v')">
419 <genre authority="marc">legal case and case notes</genre>
421 <xsl:when test="contains($controlField008-24,'w')">
422 <genre authority="marc">law report or digest</genre>
424 <xsl:when test="contains($controlField008-24,'z')">
425 <genre authority="marc">treaty</genre>
428 <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
430 <xsl:when test="$controlField008-29='1'">
431 <genre authority="marc">conference publication</genre>
436 <xsl:if test="$typeOf008='CF'">
437 <xsl:variable name="controlField008-26" select="substring($controlField008,27,1)"/>
439 <xsl:when test="$controlField008-26='a'">
440 <genre authority="marc">numeric data</genre>
442 <xsl:when test="$controlField008-26='e'">
443 <genre authority="marc">database</genre>
445 <xsl:when test="$controlField008-26='f'">
446 <genre authority="marc">font</genre>
448 <xsl:when test="$controlField008-26='g'">
449 <genre authority="marc">game</genre>
454 <xsl:if test="$typeOf008='BK'">
455 <xsl:if test="substring($controlField008,25,1)='j'">
456 <genre authority="marc">patent</genre>
458 <xsl:if test="substring($controlField008,31,1)='1'">
459 <genre authority="marc">festschrift</genre>
462 <xsl:variable name="controlField008-34" select="substring($controlField008,35,1)"/>
463 <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
464 <genre authority="marc">biography</genre>
467 <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
469 <xsl:when test="$controlField008-33='e'">
470 <genre authority="marc">essay</genre>
472 <xsl:when test="$controlField008-33='d'">
473 <genre authority="marc">drama</genre>
475 <xsl:when test="$controlField008-33='c'">
476 <genre authority="marc">comic strip</genre>
478 <xsl:when test="$controlField008-33='l'">
479 <genre authority="marc">fiction</genre>
481 <xsl:when test="$controlField008-33='h'">
482 <genre authority="marc">humor, satire</genre>
484 <xsl:when test="$controlField008-33='i'">
485 <genre authority="marc">letter</genre>
487 <xsl:when test="$controlField008-33='f'">
488 <genre authority="marc">novel</genre>
490 <xsl:when test="$controlField008-33='j'">
491 <genre authority="marc">short story</genre>
493 <xsl:when test="$controlField008-33='s'">
494 <genre authority="marc">speech</genre>
499 <xsl:if test="$typeOf008='MU'">
500 <xsl:variable name="controlField008-30-31" select="substring($controlField008,31,2)"/>
501 <xsl:if test="contains($controlField008-30-31,'b')">
502 <genre authority="marc">biography</genre>
504 <xsl:if test="contains($controlField008-30-31,'c')">
505 <genre authority="marc">conference publication</genre>
507 <xsl:if test="contains($controlField008-30-31,'d')">
508 <genre authority="marc">drama</genre>
510 <xsl:if test="contains($controlField008-30-31,'e')">
511 <genre authority="marc">essay</genre>
513 <xsl:if test="contains($controlField008-30-31,'f')">
514 <genre authority="marc">fiction</genre>
516 <xsl:if test="contains($controlField008-30-31,'o')">
517 <genre authority="marc">folktale</genre>
519 <xsl:if test="contains($controlField008-30-31,'h')">
520 <genre authority="marc">history</genre>
522 <xsl:if test="contains($controlField008-30-31,'k')">
523 <genre authority="marc">humor, satire</genre>
525 <xsl:if test="contains($controlField008-30-31,'m')">
526 <genre authority="marc">memoir</genre>
528 <xsl:if test="contains($controlField008-30-31,'p')">
529 <genre authority="marc">poetry</genre>
531 <xsl:if test="contains($controlField008-30-31,'r')">
532 <genre authority="marc">rehearsal</genre>
534 <xsl:if test="contains($controlField008-30-31,'g')">
535 <genre authority="marc">reporting</genre>
537 <xsl:if test="contains($controlField008-30-31,'s')">
538 <genre authority="marc">sound</genre>
540 <xsl:if test="contains($controlField008-30-31,'l')">
541 <genre authority="marc">speech</genre>
545 <xsl:if test="$typeOf008='VM'">
546 <xsl:variable name="controlField008-33" select="substring($controlField008,34,1)"/>
548 <xsl:when test="$controlField008-33='a'">
549 <genre authority="marc">art original</genre>
551 <xsl:when test="$controlField008-33='b'">
552 <genre authority="marc">kit</genre>
554 <xsl:when test="$controlField008-33='c'">
555 <genre authority="marc">art reproduction</genre>
557 <xsl:when test="$controlField008-33='d'">
558 <genre authority="marc">diorama</genre>
560 <xsl:when test="$controlField008-33='f'">
561 <genre authority="marc">filmstrip</genre>
563 <xsl:when test="$controlField008-33='g'">
564 <genre authority="marc">legal article</genre>
566 <xsl:when test="$controlField008-33='i'">
567 <genre authority="marc">picture</genre>
569 <xsl:when test="$controlField008-33='k'">
570 <genre authority="marc">graphic</genre>
572 <xsl:when test="$controlField008-33='l'">
573 <genre authority="marc">technical drawing</genre>
575 <xsl:when test="$controlField008-33='m'">
576 <genre authority="marc">motion picture</genre>
578 <xsl:when test="$controlField008-33='n'">
579 <genre authority="marc">chart</genre>
581 <xsl:when test="$controlField008-33='o'">
582 <genre authority="marc">flash card</genre>
584 <xsl:when test="$controlField008-33='p'">
585 <genre authority="marc">microscope slide</genre>
587 <xsl:when test="$controlField008-33='q' or marc:controlfield[@tag=007][substring(text(),1,1)='a'][substring(text(),2,1)='q']">
588 <genre authority="marc">model</genre>
590 <xsl:when test="$controlField008-33='r'">
591 <genre authority="marc">realia</genre>
593 <xsl:when test="$controlField008-33='s'">
594 <genre authority="marc">slide</genre>
596 <xsl:when test="$controlField008-33='t'">
597 <genre authority="marc">transparency</genre>
599 <xsl:when test="$controlField008-33='v'">
600 <genre authority="marc">videorecording</genre>
602 <xsl:when test="$controlField008-33='w'">
603 <genre authority="marc">toy</genre>
608 <xsl:for-each select="marc:datafield[@tag=655]">
609 <genre authority="marc">
610 <xsl:attribute name="authority">
611 <xsl:value-of select="marc:subfield[@code='2']"/>
613 <xsl:call-template name="subfieldSelect">
614 <xsl:with-param name="codes">abvxyz</xsl:with-param>
615 <xsl:with-param name="delimeter">-</xsl:with-param>
621 <xsl:variable name="MARCpublicationCode" select="normalize-space(substring($controlField008,16,3))"/>
623 <xsl:if test="translate($MARCpublicationCode,'|','')">
626 <xsl:attribute name="type">code</xsl:attribute>
627 <xsl:attribute name="authority">marccountry</xsl:attribute>
628 <xsl:value-of select="$MARCpublicationCode"/>
633 <xsl:for-each select="marc:datafield[@tag=044]/marc:subfield[@code='c']">
636 <xsl:attribute name="type">code</xsl:attribute>
637 <xsl:attribute name="authority">iso3166</xsl:attribute>
638 <xsl:value-of select="."/>
643 <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='a']">
646 <xsl:attribute name="type">text</xsl:attribute>
647 <xsl:call-template name="chopPunctuationFront">
648 <xsl:with-param name="chopString">
649 <xsl:call-template name="chopPunctuation">
650 <xsl:with-param name="chopString" select="."/>
658 <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='m']">
659 <dateValid point="start">
660 <xsl:value-of select="."/>
663 <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='n']">
664 <dateValid point="end">
665 <xsl:value-of select="."/>
668 <xsl:for-each select="marc:datafield[@tag=046]/marc:subfield[@code='j']">
670 <xsl:value-of select="."/>
674 <xsl:for-each select="marc:datafield[@tag=260]/marc:subfield[@code='b' or @code='c' or @code='g']">
676 <xsl:when test="@code='b'">
678 <xsl:call-template name="chopPunctuation">
679 <xsl:with-param name="chopString" select="."/>
680 <xsl:with-param name="punctuation">
681 <xsl:text>:,;/ </xsl:text>
686 <xsl:when test="@code='c'">
688 <xsl:call-template name="chopPunctuation">
689 <xsl:with-param name="chopString" select="."/>
693 <xsl:when test="@code='g'">
695 <xsl:value-of select="."/>
701 <xsl:variable name="dataField260c">
702 <xsl:call-template name="chopPunctuation">
703 <xsl:with-param name="chopString" select="marc:datafield[@tag=260]/marc:subfield[@code='c']"/>
707 <xsl:variable name="controlField008-7-10" select="normalize-space(substring($controlField008, 8, 4))"/>
708 <xsl:variable name="controlField008-11-14" select="normalize-space(substring($controlField008, 12, 4))"/>
709 <xsl:variable name="controlField008-6" select="normalize-space(substring($controlField008, 7, 1))"/>
711 <xsl:if test="$controlField008-6='e' or $controlField008-6='p' or $controlField008-6='r' or $controlField008-6='t' or $controlField008-6='s'">
712 <xsl:if test="$controlField008-7-10 and ($controlField008-7-10 != $dataField260c)">
713 <dateIssued encoding="marc">
714 <xsl:value-of select="$controlField008-7-10"/>
719 <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
720 <xsl:if test="$controlField008-7-10">
721 <dateIssued encoding="marc" point="start">
722 <xsl:value-of select="$controlField008-7-10"/>
727 <xsl:if test="$controlField008-6='c' or $controlField008-6='d' or $controlField008-6='i' or $controlField008-6='k' or $controlField008-6='m' or $controlField008-6='q' or $controlField008-6='u'">
728 <xsl:if test="$controlField008-11-14">
729 <dateIssued encoding="marc" point="end">
730 <xsl:value-of select="$controlField008-11-14"/>
735 <xsl:if test="$controlField008-6='q'">
736 <xsl:if test="$controlField008-7-10">
737 <dateIssued encoding="marc" point="start" qualifier="questionable">
738 <xsl:value-of select="$controlField008-7-10"/>
743 <xsl:if test="$controlField008-6='q'">
744 <xsl:if test="$controlField008-11-14">
745 <dateIssued encoding="marc" point="end" qualifier="questionable">
746 <xsl:value-of select="$controlField008-11-14"/>
751 <xsl:if test="$controlField008-6='t'">
752 <xsl:if test="$controlField008-11-14">
753 <copyrightDate encoding="marc">
754 <xsl:value-of select="$controlField008-11-14"/>
759 <xsl:for-each select="marc:datafield[@tag=033][@ind1=0 or @ind1=1]/marc:subfield[@code='a']">
760 <dateCaptured encoding="iso8601">
761 <xsl:value-of select="."/>
765 <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][1]">
766 <dateCaptured encoding="iso8601" point="start">
767 <xsl:value-of select="."/>
771 <xsl:for-each select="marc:datafield[@tag=033][@ind1=2]/marc:subfield[@code='a'][2]">
772 <dateCaptured encoding="iso8601" point="end">
773 <xsl:value-of select="."/>
777 <xsl:for-each select="marc:datafield[@tag=250]/marc:subfield[@code='a']">
779 <xsl:value-of select="."/>
783 <xsl:for-each select="marc:leader">
786 <xsl:when test="$leader7='a' or $leader7='c' or $leader7='d' or $leader7='m'">monographic</xsl:when>
787 <xsl:when test="$leader7='b' or $leader7='i' or $leader7='s'">continuing</xsl:when>
792 <xsl:for-each select="marc:datafield[@tag=310]|marc:datafield[@tag=321]">
794 <xsl:call-template name="subfieldSelect">
795 <xsl:with-param name="codes">ab</xsl:with-param>
800 <xsl:variable name="controlField008-35-37" select="normalize-space(translate(substring($controlField008,36,3),'|#',''))"/>
801 <xsl:if test="$controlField008-35-37">
803 <languageTerm authority="iso639-2b" type="code">
804 <xsl:value-of select="substring($controlField008,36,3)"/>
809 <xsl:for-each select="marc:datafield[@tag=041]">
811 <!-- <xsl:variable name="langCodes">
812 <xsl:copy-of select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/>
815 <xsl:variable name="langCodes" select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/>
818 <xsl:when test="marc:subfield[@code='2']='rfc3066'">
819 <!-- not stacked but could be repeated -->
820 <xsl:call-template name="rfcLanguages">
821 <xsl:with-param name="nodeNum">
822 <xsl:value-of select="1"/>
824 <xsl:with-param name="usedLanguages">
825 <xsl:text></xsl:text>
827 <xsl:with-param name="controlField008-35-37">
828 <xsl:value-of select="$controlField008-35-37"/>
834 <xsl:variable name="allLanguages">
835 <xsl:copy-of select="$langCodes"/>
837 <xsl:variable name="currentLanguage">
838 <xsl:value-of select="substring($allLanguages,1,3)"/>
840 <xsl:call-template name="isoLanguage">
841 <xsl:with-param name="currentLanguage">
842 <xsl:value-of select="substring($allLanguages,1,3)"/>
844 <xsl:with-param name="remainingLanguages">
845 <xsl:value-of select="substring($allLanguages,4,string-length($allLanguages)-3)"/>
847 <xsl:with-param name="usedLanguages">
848 <xsl:if test="$controlField008-35-37">
849 <xsl:value-of select="$controlField008-35-37"/>
857 <xsl:variable name="physicalDescription">
858 <xsl:if test="$typeOf008='CF' and marc:controlfield[@tag=007][substring(.,12,1)='a' or substring(.,12,1)='b']">
859 <digitalOrigin>reformatted digital</digitalOrigin>
862 <xsl:variable name="controlField008-23" select="substring($controlField008,24,1)"/>
863 <xsl:variable name="controlField008-29" select="substring($controlField008,30,1)"/>
865 <xsl:variable name="check008-23">
866 <xsl:if test="$typeOf008='BK' or $typeOf008='MU' or $typeOf008='SE' or $typeOf008='MM'">
867 <xsl:value-of select="true()"/>
871 <xsl:variable name="check008-29">
872 <xsl:if test="$typeOf008='MP' or $typeOf008='VM'">
873 <xsl:value-of select="true()"/>
878 <xsl:when test="($check008-23 and $controlField008-23='f') or ($check008-29 and $controlField008-29='f')">
879 <form authority="marcform">braille</form>
881 <xsl:when test="($controlField008-23=' ' and ($leader6='c' or $leader6='d')) or (($typeOf008='BK' or $typeOf008='SE') and ($controlField008-23=' ' or $controlField008='r'))">
882 <form authority="marcform">print</form>
884 <xsl:when test="$leader6 = 'm' or ($check008-23 and $controlField008-23='s') or ($check008-29 and $controlField008-29='s')">
885 <form authority="marcform">electronic</form>
887 <xsl:when test="($check008-23 and $controlField008-23='b') or ($check008-29 and $controlField008-29='b')">
888 <form authority="marcform">microfiche</form>
890 <xsl:when test="($check008-23 and $controlField008-23='a') or ($check008-29 and $controlField008-29='a')">
891 <form authority="marcform">microfilm</form>
895 <xsl:if test="marc:datafield[@tag=130]/marc:subfield[@code='h']">
896 <form authority="gmd">
897 <xsl:call-template name="chopBrackets">
898 <xsl:with-param name="chopString">
899 <xsl:value-of select="marc:datafield[@tag=130]/marc:subfield[@code='h']"/>
905 <xsl:if test="marc:datafield[@tag=240]/marc:subfield[@code='h']">
906 <form authority="gmd">
907 <xsl:call-template name="chopBrackets">
908 <xsl:with-param name="chopString">
909 <xsl:value-of select="marc:datafield[@tag=240]/marc:subfield[@code='h']"/>
914 <xsl:if test="marc:datafield[@tag=242]/marc:subfield[@code='h']">
915 <form authority="gmd">
916 <xsl:call-template name="chopBrackets">
917 <xsl:with-param name="chopString">
918 <xsl:value-of select="marc:datafield[@tag=242]/marc:subfield[@code='h']"/>
923 <xsl:if test="marc:datafield[@tag=245]/marc:subfield[@code='h']">
924 <form authority="gmd">
925 <xsl:call-template name="chopBrackets">
926 <xsl:with-param name="chopString">
927 <xsl:value-of select="marc:datafield[@tag=245]/marc:subfield[@code='h']"/>
932 <xsl:if test="marc:datafield[@tag=246]/marc:subfield[@code='h']">
933 <form authority="gmd">
934 <xsl:call-template name="chopBrackets">
935 <xsl:with-param name="chopString">
936 <xsl:value-of select="marc:datafield[@tag=246]/marc:subfield[@code='h']"/>
941 <xsl:if test="marc:datafield[@tag=730]/marc:subfield[@code='h']">
942 <form authority="gmd">
943 <xsl:call-template name="chopBrackets">
944 <xsl:with-param name="chopString">
945 <xsl:value-of select="marc:datafield[@tag=730]/marc:subfield[@code='h']"/>
950 <xsl:for-each select="marc:datafield[@tag=256]/marc:subfield[@code='a']">
952 <xsl:value-of select="."/>
956 <xsl:for-each select="marc:controlfield[@tag=007][substring(text(),1,1)='c']">
958 <xsl:when test="substring(text(),14,1)='a'">
959 <reformattingQuality>access</reformattingQuality>
961 <xsl:when test="substring(text(),14,1)='p'">
962 <reformattingQuality>preservation</reformattingQuality>
964 <xsl:when test="substring(text(),14,1)='r'">
965 <reformattingQuality>replacement</reformattingQuality>
970 <xsl:for-each select="marc:datafield[@tag=856]/marc:subfield[@code='q'][string-length(.)>1]">
972 <xsl:value-of select="."/>
976 <xsl:for-each select="marc:datafield[@tag=300]">
978 <xsl:call-template name="subfieldSelect">
979 <xsl:with-param name="codes">abce</xsl:with-param>
985 <xsl:if test="string-length(normalize-space($physicalDescription))">
986 <physicalDescription>
987 <xsl:copy-of select="$physicalDescription"/>
988 </physicalDescription>
991 <xsl:for-each select="marc:datafield[@tag=520]">
993 <xsl:call-template name="uri"/>
994 <xsl:call-template name="subfieldSelect">
995 <xsl:with-param name="codes">ab</xsl:with-param>
1000 <xsl:for-each select="marc:datafield[@tag=505]">
1002 <xsl:call-template name="uri"/>
1003 <xsl:call-template name="subfieldSelect">
1004 <xsl:with-param name="codes">agrt</xsl:with-param>
1005 </xsl:call-template>
1009 <xsl:for-each select="marc:datafield[@tag=521]">
1011 <xsl:call-template name="subfieldSelect">
1012 <xsl:with-param name="codes">ab</xsl:with-param>
1013 </xsl:call-template>
1017 <xsl:if test="$typeOf008='BK' or $typeOf008='CF' or $typeOf008='MU' or $typeOf008='VM'">
1018 <xsl:variable name="controlField008-22" select="substring($controlField008,23,1)"/>
1021 <xsl:when test="$controlField008-22='d'">
1022 <targetAudience authority="marctarget">adolescent</targetAudience>
1024 <xsl:when test="$controlField008-22='e'">
1025 <targetAudience authority="marctarget">adult</targetAudience>
1027 <xsl:when test="$controlField008-22='g'">
1028 <targetAudience authority="marctarget">general</targetAudience>
1030 <xsl:when test="$controlField008-22='b' or $controlField008-22='c' or $controlField008-22='j'">
1031 <targetAudience authority="marctarget">juvenile</targetAudience>
1033 <xsl:when test="$controlField008-22='a'">
1034 <targetAudience authority="marctarget">preschool</targetAudience>
1036 <xsl:when test="$controlField008-22='f'">
1037 <targetAudience authority="marctarget">specialized</targetAudience>
1042 <xsl:for-each select="marc:datafield[@tag=245]/marc:subfield[@code='c']">
1043 <note type="statement of responsibility">
1044 <xsl:value-of select="."/>
1048 <xsl:for-each select="marc:datafield[@tag=500]">
1050 <xsl:value-of select="marc:subfield[@code='a']"/>
1051 <xsl:call-template name="uri"/>
1055 <xsl:for-each select="marc:datafield[@tag=511]">
1056 <note type="performers">
1057 <xsl:call-template name="uri"/>
1058 <xsl:value-of select="marc:subfield[@code='a']"/>
1062 <xsl:for-each select="marc:datafield[@tag=518]">
1064 <xsl:call-template name="uri"/>
1065 <xsl:value-of select="marc:subfield[@code='a']"/>
1069 <xsl:for-each select="marc:datafield[@tag=501 or @tag=502 or @tag=504 or @tag=506 or @tag=507 or @tag=508 or @tag=513 or @tag=514 or @tag=515 or @tag=516 or @tag=522 or @tag=524 or @tag=525 or @tag=526 or @tag=530 or @tag=533 or @tag=534 or @tag=535 or @tag=536 or @tag=538 or @tag=540 or @tag=541 or @tag=544 or @tag=545 or @tag=546 or @tag=547 or @tag=550 or @tag=552 or @tag=555 or @tag=556 or @tag=561 or @tag=562 or @tag=565 or @tag=567 or @tag=580 or @tag=581 or @tag=583 or @tag=584 or @tag=585 or @tag=586]">
1071 <xsl:call-template name="uri"/>
1072 <xsl:variable name="str">
1073 <xsl:for-each select="marc:subfield[@code!='6' or @code!='8']">
1074 <xsl:value-of select="."/>
1075 <xsl:text> </xsl:text>
1078 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
1082 <xsl:for-each select="marc:datafield[@tag=034][marc:subfield[@code='d' or @code='e' or @code='f' or @code='g']]">
1086 <xsl:call-template name="subfieldSelect">
1087 <xsl:with-param name="codes">defg</xsl:with-param>
1088 </xsl:call-template>
1094 <xsl:for-each select="marc:datafield[@tag=043]">
1096 <xsl:for-each select="marc:subfield[@code='a' or @code='b' or @code='c']">
1098 <xsl:attribute name="authority">
1099 <xsl:if test="@code='a'">
1100 <xsl:text>marcgac</xsl:text>
1102 <xsl:if test="@code='b'">
1103 <xsl:value-of select="following-sibling::marc:subfield[@code=2]"/>
1105 <xsl:if test="@code='c'">
1106 <xsl:text>iso3166</xsl:text>
1109 <xsl:value-of select="self::marc:subfield"/>
1115 <xsl:for-each select="marc:datafield[@tag=255]">
1118 <xsl:for-each select="marc:subfield[@code='c']">
1120 <xsl:value-of select="."/>
1123 <xsl:for-each select="marc:subfield[@code='a']">
1125 <xsl:value-of select="."/>
1128 <xsl:for-each select="marc:subfield[@code='b']">
1130 <xsl:value-of select="."/>
1137 <xsl:apply-templates select="marc:datafield[653 >= @tag and @tag >= 600]"/>
1139 <xsl:apply-templates select="marc:datafield[@tag=656]"/>
1141 <xsl:for-each select="marc:datafield[@tag=752]">
1143 <hierarchicalGeographic>
1144 <xsl:for-each select="marc:subfield[@code='a']">
1146 <xsl:call-template name="chopPunctuation">
1147 <xsl:with-param name="chopString" select="."/>
1148 </xsl:call-template>
1151 <xsl:for-each select="marc:subfield[@code='b']">
1153 <xsl:call-template name="chopPunctuation">
1154 <xsl:with-param name="chopString" select="."/>
1155 </xsl:call-template>
1158 <xsl:for-each select="marc:subfield[@code='c']">
1160 <xsl:call-template name="chopPunctuation">
1161 <xsl:with-param name="chopString" select="."/>
1162 </xsl:call-template>
1165 <xsl:for-each select="marc:subfield[@code='d']">
1167 <xsl:call-template name="chopPunctuation">
1168 <xsl:with-param name="chopString" select="."/>
1169 </xsl:call-template>
1172 </hierarchicalGeographic>
1176 <xsl:for-each select="marc:datafield[@tag=045][marc:subfield[@code='b']]">
1181 <xsl:when test="@ind1=2">
1183 <temporal encoding="iso8601" point="start">
1184 <xsl:call-template name="chopPunctuation">
1185 <xsl:with-param name="chopString">
1186 <xsl:value-of select="marc:subfield[@code='b'][1]"/>
1188 </xsl:call-template>
1190 <temporal encoding="iso8601" point="end">
1191 <xsl:call-template name="chopPunctuation">
1192 <xsl:with-param name="chopString">
1195 <xsl:value-of select="marc:subfield[@code='b'][2]"/>
1197 </xsl:call-template>
1201 <xsl:for-each select="marc:subfield[@code='b']">
1202 <temporal encoding="iso8601">
1203 <xsl:call-template name="chopPunctuation">
1204 <xsl:with-param name="chopString" select="."/>
1205 </xsl:call-template>
1213 <xsl:for-each select="marc:datafield[@tag=050]">
1214 <xsl:for-each select="marc:subfield[@code='b']">
1215 <classification authority="lcc">
1216 <xsl:value-of select="preceding-sibling::marc:subfield[@code='a'][1]"/>
1217 <xsl:text> </xsl:text>
1218 <xsl:value-of select="text()"/>
1221 <xsl:for-each select="marc:subfield[@code='a'][not(following-sibling::marc:subfield[@code='b'])]">
1222 <classification authority="lcc">
1223 <xsl:value-of select="text()"/>
1228 <xsl:for-each select="marc:datafield[@tag=082]">
1229 <classification authority="ddc">
1230 <xsl:if test="marc:subfield[@code='2']">
1231 <xsl:attribute name="edition">
1232 <xsl:value-of select="marc:subfield[@code='2']"/>
1235 <xsl:call-template name="subfieldSelect">
1236 <xsl:with-param name="codes">ab</xsl:with-param>
1237 </xsl:call-template>
1241 <xsl:for-each select="marc:datafield[@tag=080]">
1242 <classification authority="udc">
1243 <xsl:call-template name="subfieldSelect">
1244 <xsl:with-param name="codes">abx</xsl:with-param>
1245 </xsl:call-template>
1249 <xsl:for-each select="marc:datafield[@tag=060]">
1250 <classification authority="nlm">
1251 <xsl:call-template name="subfieldSelect">
1252 <xsl:with-param name="codes">ab</xsl:with-param>
1253 </xsl:call-template>
1257 <xsl:for-each select="marc:datafield[@tag=086][@ind1=0]">
1258 <classification authority="sudocs">
1259 <xsl:value-of select="marc:subfield[@code='a']"/>
1263 <xsl:for-each select="marc:datafield[@tag=086][@ind1=1]">
1264 <classification authority="candoc">
1265 <xsl:value-of select="marc:subfield[@code='a']"/>
1269 <xsl:for-each select="marc:datafield[@tag=086]">
1271 <xsl:attribute name="authority">
1272 <xsl:value-of select="marc:subfield[@code='2']"/>
1274 <xsl:value-of select="marc:subfield[@code='a']"/>
1278 <xsl:for-each select="marc:datafield[@tag=084]">
1280 <xsl:attribute name="authority">
1281 <xsl:value-of select="marc:subfield[@code='2']"/>
1283 <xsl:call-template name="subfieldSelect">
1284 <xsl:with-param name="codes">ab</xsl:with-param>
1285 </xsl:call-template>
1289 <xsl:for-each select="marc:datafield[@tag=440]">
1290 <relatedItem type="series">
1293 <xsl:call-template name="chopPunctuation">
1294 <xsl:with-param name="chopString">
1295 <xsl:call-template name="subfieldSelect">
1296 <xsl:with-param name="codes">av</xsl:with-param>
1297 </xsl:call-template>
1299 </xsl:call-template>
1301 <xsl:call-template name="part"/>
1306 <xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
1307 <relatedItem type="series">
1310 <xsl:call-template name="chopPunctuation">
1311 <xsl:with-param name="chopString">
1312 <xsl:call-template name="subfieldSelect">
1313 <xsl:with-param name="codes">av</xsl:with-param>
1314 </xsl:call-template>
1316 </xsl:call-template>
1318 <xsl:call-template name="part"/>
1323 <xsl:for-each select="marc:datafield[@tag=510]">
1324 <relatedItem type="isReferencedBy">
1326 <xsl:call-template name="subfieldSelect">
1327 <xsl:with-param name="codes">abcx3</xsl:with-param>
1328 </xsl:call-template>
1333 <xsl:for-each select="marc:datafield[@tag=534]">
1334 <relatedItem type="original">
1335 <xsl:call-template name="relatedTitle"/>
1336 <xsl:call-template name="relatedName"/>
1337 <xsl:if test="marc:subfield[@code='b' or @code='c']">
1339 <xsl:for-each select="marc:subfield[@code='c']">
1341 <xsl:value-of select="."/>
1344 <xsl:for-each select="marc:subfield[@code='b']">
1346 <xsl:value-of select="."/>
1351 <xsl:call-template name="relatedIdentifierISSN"/>
1352 <xsl:for-each select="marc:subfield[@code='z']">
1353 <identifier type="isbn">
1354 <xsl:value-of select="."/>
1357 <xsl:call-template name="relatedNote"/>
1361 <xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='t']]">
1363 <xsl:call-template name="constituentOrRelatedType"/>
1366 <xsl:call-template name="chopPunctuation">
1367 <xsl:with-param name="chopString">
1368 <xsl:call-template name="specialSubfieldSelect">
1369 <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
1370 <xsl:with-param name="axis">t</xsl:with-param>
1371 <xsl:with-param name="afterCodes">g</xsl:with-param>
1372 </xsl:call-template>
1374 </xsl:call-template>
1376 <xsl:call-template name="part"/>
1378 <name type="personal">
1380 <xsl:call-template name="specialSubfieldSelect">
1381 <xsl:with-param name="anyCodes">aq</xsl:with-param>
1382 <xsl:with-param name="axis">t</xsl:with-param>
1383 <xsl:with-param name="beforeCodes">g</xsl:with-param>
1384 </xsl:call-template>
1386 <xsl:call-template name="termsOfAddress"/>
1387 <xsl:call-template name="nameDate"/>
1388 <xsl:call-template name="role"/>
1390 <xsl:call-template name="relatedForm"/>
1391 <xsl:call-template name="relatedIdentifierISSN"/>
1395 <xsl:for-each select="marc:datafield[@tag=710][marc:subfield[@code='t']]">
1397 <xsl:call-template name="constituentOrRelatedType"/>
1400 <xsl:call-template name="chopPunctuation">
1401 <xsl:with-param name="chopString">
1402 <xsl:call-template name="specialSubfieldSelect">
1403 <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
1404 <xsl:with-param name="axis">t</xsl:with-param>
1405 <xsl:with-param name="afterCodes">dg</xsl:with-param>
1406 </xsl:call-template>
1408 </xsl:call-template>
1410 <xsl:call-template name="relatedPartNumName"/>
1412 <name type="corporate">
1413 <xsl:for-each select="marc:subfield[@code='a']">
1415 <xsl:value-of select="."/>
1418 <xsl:for-each select="marc:subfield[@code='b']">
1420 <xsl:value-of select="."/>
1423 <xsl:variable name="tempNamePart">
1424 <xsl:call-template name="specialSubfieldSelect">
1425 <xsl:with-param name="anyCodes">c</xsl:with-param>
1426 <xsl:with-param name="axis">t</xsl:with-param>
1427 <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
1428 </xsl:call-template>
1430 <xsl:if test="normalize-space($tempNamePart)">
1432 <xsl:value-of select="$tempNamePart"/>
1435 <xsl:call-template name="role"/>
1437 <xsl:call-template name="relatedForm"/>
1438 <xsl:call-template name="relatedIdentifierISSN"/>
1442 <xsl:for-each select="marc:datafield[@tag=711][marc:subfield[@code='t']]">
1444 <xsl:call-template name="constituentOrRelatedType"/>
1447 <xsl:call-template name="chopPunctuation">
1448 <xsl:with-param name="chopString">
1449 <xsl:call-template name="specialSubfieldSelect">
1450 <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
1451 <xsl:with-param name="axis">t</xsl:with-param>
1452 <xsl:with-param name="afterCodes">g</xsl:with-param>
1453 </xsl:call-template>
1455 </xsl:call-template>
1457 <xsl:call-template name="relatedPartNumName"/>
1459 <name type="conference">
1461 <xsl:call-template name="specialSubfieldSelect">
1462 <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
1463 <xsl:with-param name="axis">t</xsl:with-param>
1464 <xsl:with-param name="beforeCodes">gn</xsl:with-param>
1465 </xsl:call-template>
1468 <xsl:call-template name="relatedForm"/>
1469 <xsl:call-template name="relatedIdentifierISSN"/>
1473 <xsl:for-each select="marc:datafield[@tag=730][@ind2=2]">
1475 <xsl:call-template name="constituentOrRelatedType"/>
1478 <xsl:call-template name="chopPunctuation">
1479 <xsl:with-param name="chopString">
1480 <xsl:call-template name="subfieldSelect">
1481 <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
1482 </xsl:call-template>
1484 </xsl:call-template>
1486 <xsl:call-template name="part"/>
1488 <xsl:call-template name="relatedForm"/>
1489 <xsl:call-template name="relatedIdentifierISSN"/>
1493 <xsl:for-each select="marc:datafield[@tag=740][@ind2=2]">
1495 <xsl:call-template name="constituentOrRelatedType"/>
1498 <xsl:call-template name="chopPunctuation">
1499 <xsl:with-param name="chopString">
1500 <xsl:value-of select="marc:subfield[@code='a']"/>
1502 </xsl:call-template>
1504 <xsl:call-template name="part"/>
1506 <xsl:call-template name="relatedForm"/>
1510 <xsl:for-each select="marc:datafield[@tag=760]|marc:datafield[@tag=762]">
1511 <relatedItem type="series">
1512 <xsl:call-template name="relatedItem76X-78X"/>
1516 <xsl:for-each select="marc:datafield[@tag=765]|marc:datafield[@tag=767]|marc:datafield[@tag=777]|marc:datafield[@tag=787]">
1518 <xsl:call-template name="relatedItem76X-78X"/>
1522 <xsl:for-each select="marc:datafield[@tag=775]">
1523 <relatedItem type="otherVersion">
1524 <xsl:call-template name="relatedItem76X-78X"/>
1528 <xsl:for-each select="marc:datafield[@tag=770]|marc:datafield[@tag=774]">
1529 <relatedItem type="constituent">
1530 <xsl:call-template name="relatedItem76X-78X"/>
1534 <xsl:for-each select="marc:datafield[@tag=772]|marc:datafield[@tag=773]">
1535 <relatedItem type="host">
1536 <xsl:call-template name="relatedItem76X-78X"/>
1540 <xsl:for-each select="marc:datafield[@tag=776]">
1541 <relatedItem type="otherFormat">
1542 <xsl:call-template name="relatedItem76X-78X"/>
1546 <xsl:for-each select="marc:datafield[@tag=780]">
1547 <relatedItem type="preceding">
1548 <xsl:call-template name="relatedItem76X-78X"/>
1552 <xsl:for-each select="marc:datafield[@tag=785]">
1553 <relatedItem type="succeeding">
1554 <xsl:call-template name="relatedItem76X-78X"/>
1558 <xsl:for-each select="marc:datafield[@tag=786]">
1559 <relatedItem type="original">
1560 <xsl:call-template name="relatedItem76X-78X"/>
1564 <xsl:for-each select="marc:datafield[@tag=800]">
1565 <relatedItem type="series">
1568 <xsl:call-template name="chopPunctuation">
1569 <xsl:with-param name="chopString">
1570 <xsl:call-template name="specialSubfieldSelect">
1571 <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
1572 <xsl:with-param name="axis">t</xsl:with-param>
1573 <xsl:with-param name="afterCodes">g</xsl:with-param>
1574 </xsl:call-template>
1576 </xsl:call-template>
1578 <xsl:call-template name="part"/>
1580 <name type="personal">
1582 <xsl:call-template name="chopPunctuation">
1583 <xsl:with-param name="chopString">
1584 <xsl:call-template name="specialSubfieldSelect">
1585 <xsl:with-param name="anyCodes">aq</xsl:with-param>
1586 <xsl:with-param name="axis">t</xsl:with-param>
1587 <xsl:with-param name="beforeCodes">g</xsl:with-param>
1588 </xsl:call-template>
1590 </xsl:call-template>
1592 <xsl:call-template name="termsOfAddress"/>
1593 <xsl:call-template name="nameDate"/>
1594 <xsl:call-template name="role"/>
1596 <xsl:call-template name="relatedForm"/>
1600 <xsl:for-each select="marc:datafield[@tag=810]">
1601 <relatedItem type="series">
1604 <xsl:call-template name="chopPunctuation">
1605 <xsl:with-param name="chopString">
1606 <xsl:call-template name="specialSubfieldSelect">
1607 <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param>
1608 <xsl:with-param name="axis">t</xsl:with-param>
1609 <xsl:with-param name="afterCodes">dg</xsl:with-param>
1610 </xsl:call-template>
1612 </xsl:call-template>
1614 <xsl:call-template name="relatedPartNumName"/>
1616 <name type="corporate">
1617 <xsl:for-each select="marc:subfield[@code='a']">
1619 <xsl:value-of select="."/>
1622 <xsl:for-each select="marc:subfield[@code='b']">
1625 <xsl:value-of select="."/>
1629 <xsl:call-template name="specialSubfieldSelect">
1630 <xsl:with-param name="anyCodes">c</xsl:with-param>
1631 <xsl:with-param name="axis">t</xsl:with-param>
1632 <xsl:with-param name="beforeCodes">dgn</xsl:with-param>
1633 </xsl:call-template>
1635 <xsl:call-template name="role"/>
1637 <xsl:call-template name="relatedForm"/>
1641 <xsl:for-each select="marc:datafield[@tag=811]">
1642 <relatedItem type="series">
1645 <xsl:call-template name="chopPunctuation">
1646 <xsl:with-param name="chopString">
1647 <xsl:call-template name="specialSubfieldSelect">
1648 <xsl:with-param name="anyCodes">tfklsv</xsl:with-param>
1649 <xsl:with-param name="axis">t</xsl:with-param>
1650 <xsl:with-param name="afterCodes">g</xsl:with-param>
1651 </xsl:call-template>
1653 </xsl:call-template>
1655 <xsl:call-template name="relatedPartNumName"/>
1657 <name type="conference">
1659 <xsl:call-template name="specialSubfieldSelect">
1660 <xsl:with-param name="anyCodes">aqdc</xsl:with-param>
1661 <xsl:with-param name="axis">t</xsl:with-param>
1662 <xsl:with-param name="beforeCodes">gn</xsl:with-param>
1663 </xsl:call-template>
1665 <xsl:call-template name="role"/>
1667 <xsl:call-template name="relatedForm"/>
1671 <xsl:for-each select="marc:datafield[@tag=830]">
1672 <relatedItem type="series">
1675 <xsl:call-template name="chopPunctuation">
1676 <xsl:with-param name="chopString">
1677 <xsl:call-template name="subfieldSelect">
1678 <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
1679 </xsl:call-template>
1681 </xsl:call-template>
1683 <xsl:call-template name="part"/>
1685 <xsl:call-template name="relatedForm"/>
1689 <xsl:for-each select="marc:datafield[@tag=856][@ind2=2]/marc:subfield[@code='q']">
1692 <xsl:value-of select="."/>
1693 </internetMediaType>
1697 <xsl:for-each select="marc:datafield[@tag=020]">
1698 <identifier type="isbn">
1699 <xsl:call-template name="isInvalid"/>
1700 <xsl:value-of select="marc:subfield[@code='a']"/>
1704 <xsl:for-each select="marc:datafield[@tag=024][@ind1=0]">
1705 <identifier type="isrc">
1706 <xsl:call-template name="isInvalid"/>
1707 <xsl:value-of select="marc:subfield[@code='a']"/>
1711 <xsl:for-each select="marc:datafield[@tag=024][@ind1=2]">
1712 <identifier type="ismn">
1713 <xsl:call-template name="isInvalid"/>
1714 <xsl:value-of select="marc:subfield[@code='a']"/>
1718 <xsl:for-each select="marc:datafield[@tag=022]">
1719 <identifier type="issn">
1720 <xsl:call-template name="isInvalid"/>
1721 <xsl:value-of select="marc:subfield[@code='a']"/>
1725 <xsl:for-each select="marc:datafield[@tag=010]">
1726 <identifier type="lccn">
1727 <xsl:call-template name="isInvalid"/>
1728 <xsl:value-of select="normalize-space(marc:subfield[@code='a'])"/>
1732 <xsl:for-each select="marc:datafield[@tag=028]">
1734 <xsl:call-template name="isInvalid"/>
1735 <xsl:attribute name="type">
1737 <xsl:when test="@ind1=0">issue number</xsl:when>
1738 <xsl:when test="@ind1=1">matrix number</xsl:when>
1739 <xsl:when test="@ind1=2">music plate</xsl:when>
1740 <xsl:when test="@ind1=3">music publisher</xsl:when>
1741 <xsl:when test="@ind1=4">videorecording identifier</xsl:when>
1744 <xsl:call-template name="subfieldSelect">
1745 <xsl:with-param name="codes">
1747 <xsl:when test="@ind1=0">ba</xsl:when>
1748 <xsl:otherwise>ab</xsl:otherwise>
1751 </xsl:call-template>
1755 <xsl:for-each select="marc:datafield[@tag=024][@ind1='4']">
1756 <identifier type="sici">
1757 <xsl:call-template name="isInvalid"/>
1758 <xsl:call-template name="subfieldSelect">
1759 <xsl:with-param name="codes">ab</xsl:with-param>
1760 </xsl:call-template>
1764 <xsl:for-each select="marc:datafield[@tag=037]">
1765 <identifier type="stock number">
1766 <xsl:call-template name="isInvalid"/>
1767 <xsl:call-template name="subfieldSelect">
1768 <xsl:with-param name="codes">ab</xsl:with-param>
1769 </xsl:call-template>
1773 <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]">
1775 <xsl:attribute name="type">
1777 <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:doi') or starts-with(marc:subfield[@code='u'],'doi')">doi</xsl:when>
1778 <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov')">hdl</xsl:when>
1779 <xsl:otherwise>uri</xsl:otherwise>
1783 <xsl:when test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl') or starts-with(marc:subfield[@code='u'],'http://hdl.loc.gov') ">
1784 <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"/>
1787 <xsl:value-of select="marc:subfield[@code='u']"/>
1791 <xsl:if test="starts-with(marc:subfield[@code='u'],'urn:hdl') or starts-with(marc:subfield[@code='u'],'hdl')">
1792 <identifier type="hdl">
1793 <xsl:if test="marc:subfield[@code='y' or @code='3' or @code='z']">
1794 <xsl:attribute name="displayLabel">
1795 <xsl:call-template name="subfieldSelect">
1796 <xsl:with-param name="codes">y3z</xsl:with-param>
1797 </xsl:call-template>
1800 <xsl:value-of select="concat('hdl:',substring-after(marc:subfield[@code='u'],'http://hdl.loc.gov/'))"/>
1805 <xsl:for-each select="marc:datafield[@tag=024][@ind1=1]">
1806 <identifier type="upc">
1807 <xsl:call-template name="isInvalid"/>
1808 <xsl:value-of select="marc:subfield[@code='a']"/>
1811 <!-- 1/04 fix added $y -->
1812 <xsl:for-each select="marc:datafield[@tag=856][marc:subfield[@code='u']]">
1815 <xsl:if test="marc:subfield[@code='y' or @code='3']">
1816 <xsl:attribute name="displayLabel">
1817 <xsl:call-template name="subfieldSelect">
1818 <xsl:with-param name="codes">y3</xsl:with-param>
1819 </xsl:call-template>
1822 <xsl:value-of select="marc:subfield[@code='u']"/>
1827 <xsl:for-each select="marc:datafield[@tag=852]">
1830 <xsl:call-template name="displayLabel"/>
1831 <xsl:call-template name="subfieldSelect">
1832 <xsl:with-param name="codes">abje</xsl:with-param>
1833 </xsl:call-template>
1838 <xsl:for-each select="marc:datafield[@tag=506]">
1839 <accessCondition type="restrictionOnAccess">
1840 <xsl:call-template name="subfieldSelect">
1841 <xsl:with-param name="codes">abcd35</xsl:with-param>
1842 </xsl:call-template>
1846 <xsl:for-each select="marc:datafield[@tag=540]">
1847 <accessCondition type="useAndReproduction">
1848 <xsl:call-template name="subfieldSelect">
1849 <xsl:with-param name="codes">abcde35</xsl:with-param>
1850 </xsl:call-template>
1855 <xsl:for-each select="marc:datafield[@tag=040]">
1856 <recordContentSource authority="marcorg">
1857 <xsl:value-of select="marc:subfield[@code='a']"/>
1858 </recordContentSource>
1861 <xsl:for-each select="marc:controlfield[@tag=008]">
1862 <recordCreationDate encoding="marc">
1863 <xsl:value-of select="substring(.,1,6)"/>
1864 </recordCreationDate>
1867 <xsl:for-each select="marc:controlfield[@tag=005]">
1868 <recordChangeDate encoding="iso8601">
1869 <xsl:value-of select="."/>
1873 <xsl:for-each select="marc:controlfield[@tag=001]">
1875 <xsl:if test="../marc:controlfield[@tag=003]">
1876 <xsl:attribute name="source">
1877 <xsl:value-of select="../marc:controlfield[@tag=003]"/>
1880 <xsl:value-of select="."/>
1884 <xsl:for-each select="marc:datafield[@tag=040]/marc:subfield[@code='b']">
1885 <languageOfCataloging>
1886 <languageTerm authority="iso639-2b" type="code">
1887 <xsl:value-of select="."/>
1889 </languageOfCataloging>
1894 <xsl:template name="displayForm">
1895 <xsl:for-each select="marc:subfield[@code='c']">
1897 <xsl:value-of select="."/>
1902 <xsl:template name="affiliation">
1903 <xsl:for-each select="marc:subfield[@code='u']">
1905 <xsl:value-of select="."/>
1910 <xsl:template name="uri">
1911 <xsl:for-each select="marc:subfield[@code='u']">
1912 <xsl:attribute name="xlink:href">
1913 <xsl:value-of select="."/>
1918 <xsl:template name="role">
1919 <xsl:for-each select="marc:subfield[@code='e']">
1921 <roleTerm type="text">
1922 <xsl:value-of select="."/>
1926 <xsl:for-each select="marc:subfield[@code='4']">
1928 <roleTerm authority="marcrelator" type="code">
1929 <xsl:value-of select="."/>
1935 <xsl:template name="part">
1936 <xsl:variable name="partNumber">
1937 <xsl:call-template name="specialSubfieldSelect">
1938 <xsl:with-param name="axis">n</xsl:with-param>
1939 <xsl:with-param name="anyCodes">n</xsl:with-param>
1940 <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
1941 </xsl:call-template>
1943 <xsl:variable name="partName">
1944 <xsl:call-template name="specialSubfieldSelect">
1945 <xsl:with-param name="axis">p</xsl:with-param>
1946 <xsl:with-param name="anyCodes">p</xsl:with-param>
1947 <xsl:with-param name="afterCodes">fgkdlmor</xsl:with-param>
1948 </xsl:call-template>
1950 <xsl:if test="string-length(normalize-space($partNumber))">
1952 <xsl:call-template name="chopPunctuation">
1953 <xsl:with-param name="chopString" select="$partNumber"/>
1954 </xsl:call-template>
1957 <xsl:if test="string-length(normalize-space($partName))">
1959 <xsl:call-template name="chopPunctuation">
1960 <xsl:with-param name="chopString" select="$partName"/>
1961 </xsl:call-template>
1966 <xsl:template name="relatedPart">
1967 <xsl:if test="@tag=773">
1968 <xsl:for-each select="marc:subfield[@code='g']">
1971 <xsl:value-of select="."/>
1975 <xsl:for-each select="marc:subfield[@code='q']">
1977 <xsl:call-template name="parsePart"/>
1983 <xsl:template name="relatedPartNumName">
1984 <xsl:variable name="partNumber">
1985 <xsl:call-template name="specialSubfieldSelect">
1986 <xsl:with-param name="axis">g</xsl:with-param>
1987 <xsl:with-param name="anyCodes">g</xsl:with-param>
1988 <xsl:with-param name="afterCodes">pst</xsl:with-param>
1989 </xsl:call-template>
1991 <xsl:variable name="partName">
1992 <xsl:call-template name="specialSubfieldSelect">
1993 <xsl:with-param name="axis">p</xsl:with-param>
1994 <xsl:with-param name="anyCodes">p</xsl:with-param>
1995 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
1996 </xsl:call-template>
1998 <xsl:if test="string-length(normalize-space($partNumber))">
2000 <xsl:value-of select="$partNumber"/>
2003 <xsl:if test="string-length(normalize-space($partName))">
2005 <xsl:value-of select="$partName"/>
2010 <xsl:template name="relatedName">
2011 <xsl:for-each select="marc:subfield[@code='a']">
2014 <xsl:value-of select="."/>
2020 <xsl:template name="relatedForm">
2021 <xsl:for-each select="marc:subfield[@code='h']">
2022 <physicalDescription>
2024 <xsl:value-of select="."/>
2026 </physicalDescription>
2030 <xsl:template name="relatedExtent">
2031 <xsl:for-each select="marc:subfield[@code='h']">
2032 <physicalDescription>
2034 <xsl:value-of select="."/>
2036 </physicalDescription>
2040 <xsl:template name="relatedNote">
2041 <xsl:for-each select="marc:subfield[@code='n']">
2043 <xsl:value-of select="."/>
2048 <xsl:template name="relatedSubject">
2049 <xsl:for-each select="marc:subfield[@code='j']">
2051 <temporal encoding="iso8601">
2052 <xsl:call-template name="chopPunctuation">
2053 <xsl:with-param name="chopString" select="."/>
2054 </xsl:call-template>
2060 <xsl:template name="relatedIdentifierISSN">
2061 <xsl:for-each select="marc:subfield[@code='x']">
2062 <identifier type="issn">
2063 <xsl:value-of select="."/>
2068 <xsl:template name="relatedIdentifierLocal">
2069 <xsl:for-each select="marc:subfield[@code='w']">
2070 <identifier type="local">
2071 <xsl:value-of select="."/>
2076 <xsl:template name="relatedIdentifier">
2077 <xsl:for-each select="marc:subfield[@code='o']">
2079 <xsl:value-of select="."/>
2084 <xsl:template name="relatedItem76X-78X">
2085 <xsl:call-template name="displayLabel"/>
2086 <xsl:call-template name="relatedTitle76X-78X"/>
2087 <xsl:call-template name="relatedName"/>
2088 <xsl:call-template name="relatedOriginInfo"/>
2089 <xsl:call-template name="relatedLanguage"/>
2090 <xsl:call-template name="relatedExtent"/>
2091 <xsl:call-template name="relatedNote"/>
2092 <xsl:call-template name="relatedSubject"/>
2093 <xsl:call-template name="relatedIdentifier"/>
2094 <xsl:call-template name="relatedIdentifierISSN"/>
2095 <xsl:call-template name="relatedIdentifierLocal"/>
2096 <xsl:call-template name="relatedPart"/>
2099 <xsl:template name="subjectGeographicZ">
2103 <xsl:call-template name="chopPunctuation">
2104 <xsl:with-param name="chopString" select="."/>
2105 </xsl:call-template>
2109 <xsl:template name="subjectTemporalY">
2111 <xsl:call-template name="chopPunctuation">
2112 <xsl:with-param name="chopString" select="."/>
2113 </xsl:call-template>
2117 <xsl:template name="subjectTopic">
2119 <xsl:call-template name="chopPunctuation">
2120 <xsl:with-param name="chopString" select="."/>
2121 </xsl:call-template>
2125 <xsl:template name="nameABCDN">
2126 <xsl:for-each select="marc:subfield[@code='a']">
2128 <xsl:call-template name="chopPunctuation">
2129 <xsl:with-param name="chopString" select="."/>
2130 </xsl:call-template>
2133 <xsl:for-each select="marc:subfield[@code='b']">
2135 <xsl:value-of select="."/>
2138 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
2140 <xsl:call-template name="subfieldSelect">
2141 <xsl:with-param name="codes">cdn</xsl:with-param>
2142 </xsl:call-template>
2147 <xsl:template name="nameABCDQ">
2149 <xsl:call-template name="chopPunctuation">
2150 <xsl:with-param name="chopString">
2151 <xsl:call-template name="subfieldSelect">
2152 <xsl:with-param name="codes">aq</xsl:with-param>
2153 </xsl:call-template>
2155 <xsl:with-param name="punctuation">
2156 <xsl:text>:,;/ </xsl:text>
2158 </xsl:call-template>
2160 <xsl:call-template name="termsOfAddress"/>
2161 <xsl:call-template name="nameDate"/>
2164 <xsl:template name="nameACDEQ">
2166 <xsl:call-template name="subfieldSelect">
2167 <xsl:with-param name="codes">acdeq</xsl:with-param>
2168 </xsl:call-template>
2172 <xsl:template name="constituentOrRelatedType">
2173 <xsl:if test="@ind2=2">
2174 <xsl:attribute name="type">constituent</xsl:attribute>
2178 <xsl:template name="relatedTitle">
2179 <xsl:for-each select="marc:subfield[@code='t']">
2182 <xsl:call-template name="chopPunctuation">
2183 <xsl:with-param name="chopString">
2184 <xsl:value-of select="."/>
2186 </xsl:call-template>
2192 <xsl:template name="relatedTitle76X-78X">
2193 <xsl:for-each select="marc:subfield[@code='t']">
2196 <xsl:call-template name="chopPunctuation">
2197 <xsl:with-param name="chopString">
2198 <xsl:value-of select="."/>
2200 </xsl:call-template>
2202 <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
2203 <xsl:call-template name="relatedPartNumName"/>
2207 <xsl:for-each select="marc:subfield[@code='p']">
2208 <titleInfo type="abbreviated">
2210 <xsl:call-template name="chopPunctuation">
2211 <xsl:with-param name="chopString">
2212 <xsl:value-of select="."/>
2214 </xsl:call-template>
2216 <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
2217 <xsl:call-template name="relatedPartNumName"/>
2221 <xsl:for-each select="marc:subfield[@code='s']">
2222 <titleInfo type="uniform">
2224 <xsl:call-template name="chopPunctuation">
2225 <xsl:with-param name="chopString">
2226 <xsl:value-of select="."/>
2228 </xsl:call-template>
2230 <xsl:if test="marc:datafield[@tag!=773]and marc:subfield[@code='g']">
2231 <xsl:call-template name="relatedPartNumName"/>
2237 <xsl:template name="relatedOriginInfo">
2238 <xsl:if test="marc:subfield[@code='b' or @code='d'] or marc:subfield[@code='f']">
2240 <xsl:if test="@tag=775">
2241 <xsl:for-each select="marc:subfield[@code='f']">
2244 <xsl:attribute name="type">code</xsl:attribute>
2245 <xsl:attribute name="authority">marcgac</xsl:attribute>
2246 <xsl:value-of select="."/>
2251 <xsl:for-each select="marc:subfield[@code='d']">
2253 <xsl:value-of select="."/>
2256 <xsl:for-each select="marc:subfield[@code='b']">
2258 <xsl:value-of select="."/>
2265 <xsl:template name="relatedLanguage">
2266 <xsl:for-each select="marc:subfield[@code='e']">
2267 <xsl:call-template name="getLanguage">
2268 <xsl:with-param name="langString">
2269 <xsl:value-of select="."/>
2271 </xsl:call-template>
2274 <xsl:template name="nameDate">
2275 <xsl:for-each select="marc:subfield[@code='d']">
2276 <namePart type="date">
2277 <xsl:call-template name="chopPunctuation">
2278 <xsl:with-param name="chopString" select="."/>
2279 </xsl:call-template>
2284 <xsl:template name="subjectAuthority">
2286 <xsl:if test="@ind2!=4">
2287 <xsl:if test="@ind2!=' '">
2288 <xsl:if test="@ind2!=8">
2289 <xsl:if test="@ind2!=9">
2290 <xsl:attribute name="authority">
2293 <xsl:when test="@ind2=0">lcsh</xsl:when>
2294 <xsl:when test="@ind2=1">lcshac</xsl:when>
2295 <xsl:when test="@ind2=2">mesh</xsl:when>
2297 <xsl:when test="@ind2=3">nal</xsl:when>
2298 <xsl:when test="@ind2=5">csh</xsl:when>
2299 <xsl:when test="@ind2=6">rvm</xsl:when>
2300 <xsl:when test="@ind2=7">
2301 <xsl:value-of select="marc:subfield[@code='2']"/>
2311 <xsl:template name="subjectAnyOrder">
2312 <xsl:for-each select="marc:subfield[@code='v' or @code='x' or @code='y' or @code='z']">
2314 <xsl:when test="@code='v'">
2315 <xsl:call-template name="subjectTopic"/>
2317 <xsl:when test="@code='x'">
2318 <xsl:call-template name="subjectTopic"/>
2320 <xsl:when test="@code='y'">
2321 <xsl:call-template name="subjectTemporalY"/>
2323 <xsl:when test="@code='z'">
2324 <xsl:call-template name="subjectGeographicZ"/>
2330 <xsl:template name="specialSubfieldSelect">
2331 <xsl:param name="anyCodes"/>
2332 <xsl:param name="axis"/>
2333 <xsl:param name="beforeCodes"/>
2334 <xsl:param name="afterCodes"/>
2335 <xsl:variable name="str">
2336 <xsl:for-each select="marc:subfield">
2337 <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])">
2338 <xsl:value-of select="text()"/>
2339 <xsl:text> </xsl:text>
2343 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
2346 <xsl:template match="marc:datafield[@tag=600]">
2348 <xsl:call-template name="subjectAuthority"/>
2349 <name type="personal">
2350 <xsl:call-template name="termsOfAddress"/>
2352 <xsl:call-template name="chopPunctuation">
2353 <xsl:with-param name="chopString">
2354 <xsl:call-template name="subfieldSelect">
2355 <xsl:with-param name="codes">aq</xsl:with-param>
2356 </xsl:call-template>
2358 </xsl:call-template>
2360 <xsl:call-template name="nameDate"/>
2361 <xsl:call-template name="affiliation"/>
2362 <xsl:call-template name="role"/>
2364 <xsl:call-template name="subjectAnyOrder"/>
2368 <xsl:template match="marc:datafield[@tag=610]">
2370 <xsl:call-template name="subjectAuthority"/>
2371 <name type="corporate">
2372 <xsl:for-each select="marc:subfield[@code='a']">
2374 <xsl:value-of select="."/>
2377 <xsl:for-each select="marc:subfield[@code='b']">
2379 <xsl:value-of select="."/>
2382 <xsl:if test="marc:subfield[@code='c' or @code='d' or @code='n' or @code='p']">
2384 <xsl:call-template name="subfieldSelect">
2385 <xsl:with-param name="codes">cdnp</xsl:with-param>
2386 </xsl:call-template>
2389 <xsl:call-template name="role"/>
2391 <xsl:call-template name="subjectAnyOrder"/>
2395 <xsl:template match="marc:datafield[@tag=611]">
2397 <xsl:call-template name="subjectAuthority"/>
2398 <name type="conference">
2400 <xsl:call-template name="subfieldSelect">
2401 <xsl:with-param name="codes">abcdeqnp</xsl:with-param>
2402 </xsl:call-template>
2404 <xsl:for-each select="marc:subfield[@code='4']">
2406 <roleTerm authority="marcrelator" type="code">
2407 <xsl:value-of select="."/>
2412 <xsl:call-template name="subjectAnyOrder"/>
2416 <xsl:template match="marc:datafield[@tag=630]">
2418 <xsl:call-template name="subjectAuthority"/>
2421 <xsl:call-template name="chopPunctuation">
2422 <xsl:with-param name="chopString">
2423 <xsl:call-template name="subfieldSelect">
2424 <xsl:with-param name="codes">adfhklor</xsl:with-param>
2425 </xsl:call-template>
2427 </xsl:call-template>
2428 <xsl:call-template name="part"/>
2431 <xsl:call-template name="subjectAnyOrder"/>
2435 <xsl:template match="marc:datafield[@tag=650]">
2437 <xsl:call-template name="subjectAuthority"/>
2439 <xsl:call-template name="chopPunctuation">
2440 <xsl:with-param name="chopString">
2441 <xsl:call-template name="subfieldSelect">
2442 <xsl:with-param name="codes">abcd</xsl:with-param>
2443 </xsl:call-template>
2445 </xsl:call-template>
2447 <xsl:call-template name="subjectAnyOrder"/>
2451 <xsl:template match="marc:datafield[@tag=651]">
2453 <xsl:call-template name="subjectAuthority"/>
2454 <xsl:for-each select="marc:subfield[@code='a']">
2457 <xsl:call-template name="chopPunctuation">
2458 <xsl:with-param name="chopString" select="."/>
2459 </xsl:call-template>
2463 <xsl:call-template name="subjectAnyOrder"/>
2467 <xsl:template match="marc:datafield[@tag=653]">
2469 <xsl:for-each select="marc:subfield[@code='a']">
2471 <xsl:value-of select="."/>
2477 <xsl:template match="marc:datafield[@tag=656]">
2479 <xsl:if test="marc:subfield[@code=2]">
2480 <xsl:attribute name="authority">
2481 <xsl:value-of select="marc:subfield[@code=2]"/>
2485 <xsl:call-template name="chopPunctuation">
2486 <xsl:with-param name="chopString">
2487 <xsl:value-of select="marc:subfield[@code='a']"/>
2489 </xsl:call-template>
2494 <xsl:template name="termsOfAddress">
2495 <xsl:if test="marc:subfield[@code='b' or @code='c']">
2496 <namePart type="termsOfAddress">
2497 <xsl:call-template name="chopPunctuation">
2498 <xsl:with-param name="chopString">
2499 <xsl:call-template name="subfieldSelect">
2500 <xsl:with-param name="codes">bc</xsl:with-param>
2501 </xsl:call-template>
2503 </xsl:call-template>
2508 <xsl:template name="displayLabel">
2509 <xsl:if test="marc:subfield[@code='i']">
2510 <xsl:attribute name="displayLabel">
2511 <xsl:value-of select="marc:subfield[@code='i']"/>
2514 <xsl:if test="marc:subfield[@code='3']">
2515 <xsl:attribute name="displayLabel">
2516 <xsl:value-of select="marc:subfield[@code='3']"/>
2521 <xsl:template name="isInvalid">
2522 <xsl:if test="marc:subfield[@code='z']">
2523 <xsl:attribute name="invalid">yes</xsl:attribute>
2527 <xsl:template name="subtitle">
2528 <xsl:if test="marc:subfield[@code='b']">
2530 <xsl:call-template name="chopPunctuation">
2531 <xsl:with-param name="chopString">
2532 <xsl:value-of select="marc:subfield[@code='b']"/>
2534 <!--<xsl:call-template name="subfieldSelect">
2535 <xsl:with-param name="codes">b</xsl:with-param>
2536 </xsl:call-template>-->
2538 </xsl:call-template>
2543 <xsl:template name="script">
2544 <xsl:param name="scriptCode"/>
2545 <xsl:attribute name="script">
2547 <xsl:when test="$scriptCode='(3'">Arabic</xsl:when>
2548 <xsl:when test="$scriptCode='(B'">Latin</xsl:when>
2549 <xsl:when test="$scriptCode='$1'">Chinese, Japanese, Korean</xsl:when>
2550 <xsl:when test="$scriptCode='(N'">Cyrillic</xsl:when>
2551 <xsl:when test="$scriptCode='(2'">Hebrew</xsl:when>
2552 <xsl:when test="$scriptCode='(S'">Greek</xsl:when>
2557 <xsl:template name="parsePart">
2558 <!-- assumes 773$q= 1:2:3<4
2559 with up to 3 levels and one optional start page
2561 <xsl:variable name="level1">
2563 <xsl:when test="contains(text(),':')">
2565 <xsl:value-of select="substring-before(text(),':')"/>
2567 <xsl:when test="not(contains(text(),':'))">
2569 <xsl:if test="contains(text(),'<')">
2571 <xsl:value-of select="substring-before(text(),'<')"/>
2573 <xsl:if test="not(contains(text(),'<'))">
2575 <xsl:value-of select="text()"/>
2580 <xsl:variable name="sici2">
2582 <xsl:when test="starts-with(substring-after(text(),$level1),':')">
2583 <xsl:value-of select="substring(substring-after(text(),$level1),2)"/>
2586 <xsl:value-of select="substring-after(text(),$level1)"/>
2590 <xsl:variable name="level2">
2592 <xsl:when test="contains($sici2,':')">
2594 <xsl:value-of select="substring-before($sici2,':')"/>
2596 <xsl:when test="contains($sici2,'<')">
2598 <xsl:value-of select="substring-before($sici2,'<')"/>
2601 <xsl:value-of select="$sici2"/>
2606 <xsl:variable name="sici3">
2608 <xsl:when test="starts-with(substring-after($sici2,$level2),':')">
2609 <xsl:value-of select="substring(substring-after($sici2,$level2),2)"/>
2612 <xsl:value-of select="substring-after($sici2,$level2)"/>
2616 <xsl:variable name="level3">
2618 <xsl:when test="contains($sici3,'<')">
2620 <xsl:value-of select="substring-before($sici3,'<')"/>
2623 <xsl:value-of select="$sici3"/>
2628 <xsl:variable name="page">
2629 <xsl:if test="contains(text(),'<')">
2630 <xsl:value-of select="substring-after(text(),'<')"/>
2633 <xsl:if test="$level1">
2636 <xsl:value-of select="$level1"/>
2640 <xsl:if test="$level2">
2643 <xsl:value-of select="$level2"/>
2647 <xsl:if test="$level3">
2650 <xsl:value-of select="$level3"/>
2654 <xsl:if test="$page">
2655 <extent unit="page">
2657 <xsl:value-of select="$page"/>
2663 <xsl:template name="getLanguage">
2664 <xsl:param name="langString"/>
2665 <xsl:param name="controlField008-35-37"/>
2666 <xsl:variable name="length" select="string-length($langString)"/>
2668 <xsl:when test="$length=0"/>
2669 <xsl:when test="$controlField008-35-37=substring($langString,1,3)">
2670 <xsl:call-template name="getLanguage">
2671 <xsl:with-param name="langString" select="substring($langString,4,$length)"/>
2672 <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/>
2673 </xsl:call-template>
2677 <languageTerm authority="iso639-2b" type="code">
2678 <xsl:value-of select="substring($langString,1,3)"/>
2681 <xsl:call-template name="getLanguage">
2682 <xsl:with-param name="langString" select="substring($langString,4,$length)"/>
2683 <xsl:with-param name="controlField008-35-37" select="$controlField008-35-37"/>
2684 </xsl:call-template>
2689 <xsl:template name="isoLanguage">
2690 <xsl:param name="currentLanguage"/>
2691 <xsl:param name="usedLanguages"/>
2692 <xsl:param name="remainingLanguages"/>
2694 <xsl:when test="string-length($currentLanguage)=0"/>
2695 <xsl:when test="not(contains($usedLanguages, $currentLanguage))">
2697 <languageTerm authority="iso639-2b" type="code">
2698 <xsl:value-of select="$currentLanguage"/>
2701 <xsl:call-template name="isoLanguage">
2702 <xsl:with-param name="currentLanguage">
2703 <xsl:value-of select="substring($remainingLanguages,1,3)"/>
2705 <xsl:with-param name="usedLanguages">
2706 <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
2708 <xsl:with-param name="remainingLanguages">
2709 <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"/>
2711 </xsl:call-template>
2714 <xsl:call-template name="isoLanguage">
2715 <xsl:with-param name="currentLanguage">
2716 <xsl:value-of select="substring($remainingLanguages,1,3)"/>
2718 <xsl:with-param name="usedLanguages">
2719 <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
2721 <xsl:with-param name="remainingLanguages">
2722 <xsl:value-of select="substring($remainingLanguages,4,string-length($remainingLanguages))"/>
2724 </xsl:call-template>
2729 <xsl:template name="chopBrackets">
2730 <xsl:param name="chopString"/>
2731 <xsl:variable name="string">
2732 <xsl:call-template name="chopPunctuation">
2733 <xsl:with-param name="chopString" select="$chopString"/>
2734 </xsl:call-template>
2736 <xsl:if test="substring($string, 1,1)='['">
2737 <xsl:value-of select="substring($string,2, string-length($string)-2)"/>
2739 <xsl:if test="substring($string, 1,1)!='['">
2740 <xsl:value-of select="$string"/>
2744 <xsl:template name="rfcLanguages">
2745 <xsl:param name="nodeNum"/>
2746 <xsl:param name="usedLanguages"/>
2747 <xsl:param name="controlField008-35-37"/>
2750 <xsl:variable name="currentLanguage" select="marc:subfield[position()=$nodeNum]/text()"/>
2752 <xsl:when test="not($currentLanguage)"/>
2753 <xsl:when test="$currentLanguage!=$controlField008-35-37 and $currentLanguage!='rfc3066'">
2754 <xsl:if test="not(contains($usedLanguages,$currentLanguage))">
2756 <languageTerm authority="rfc3066" type="code">
2757 <xsl:value-of select="$currentLanguage"/>
2761 <xsl:call-template name="rfcLanguages">
2763 <xsl:with-param name="nodeNum">
2764 <xsl:value-of select="$nodeNum+1"/>
2766 <xsl:with-param name="usedLanguages">
2767 <xsl:value-of select="concat($usedLanguages,'|',$currentLanguage)"/>
2769 <xsl:with-param name="controlField008-35-37">
2770 <xsl:value-of select="$controlField008-35-37"/>
2772 </xsl:call-template>
2775 <xsl:call-template name="rfcLanguages">
2776 <xsl:with-param name="nodeNum">
2777 <xsl:value-of select="$nodeNum+1"/>
2779 <xsl:with-param name="usedLanguages">
2780 <xsl:value-of select="concat($usedLanguages,$currentLanguage)"/>
2782 <xsl:with-param name="controlField008-35-37">
2783 <xsl:value-of select="$controlField008-35-37"/>
2785 </xsl:call-template>
2789 </xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved.
2791 <scenarios ><scenario default="no" name="Apr 02 Test" userelativepaths="yes" externalpreview="no" url="file:///n:/jackie/test_files/v3.xml" htmlbaseurl="" outputurl="file:///n:/temp/x.xml" processortype="xalan" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="yes" name="v3Test1" userelativepaths="yes" externalpreview="yes" url="MARCTest2.xml" htmlbaseurl="" outputurl="file:///n:/jackie/test_files/modsv3Converted.xml" processortype="internal" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="no" name="Scenario1" userelativepaths="yes" externalpreview="no" url="file:///n:/ckeith/DESKTOP/test.xml" htmlbaseurl="" outputurl="" processortype="xalan" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="no" name="Test" userelativepaths="yes" externalpreview="no" url="file:///n:/jackie/MARCXML/marcxmlfile.xml" htmlbaseurl="" outputurl="" processortype="xalan" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>