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="marc">
4 <xsl:include href="http://www.loc.gov/marcxml/xslt/MARC21slimUtils.xsl"/>
5 <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
8 adapted from MARC21Slim2MODS3.xsl ntra 7/6/05
9 revised rsg/jer 11/29/05
12 <!-- authority attribute defaults to 'naf' if not set using this authority parameter, for <authority> descriptors: name, titleInfo, geographic -->
13 <xsl:param name="authority"/>
14 <xsl:variable name="auth">
16 <xsl:when test="$authority">
17 <xsl:value-of select="$authority"/>
19 <xsl:otherwise>naf</xsl:otherwise>
22 <xsl:variable name="controlField008-11" select="substring(descendant-or-self::marc:controlfield[@tag=008],12,1)"/>
23 <xsl:variable name="controlField008-14" select="substring(descendant-or-self::marc:controlfield[@tag=008],15,1)"/>
24 <xsl:template match="/">
26 <xsl:when test="descendant-or-self::marc:collection">
27 <madsCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mads http://www.loc.gov/standards/mads/mads.xsd">
28 <xsl:for-each select="descendant-or-self::marc:collection/marc:record">
30 <xsl:call-template name="marcRecord"/>
36 <mads version="beta" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mads http://www.loc.gov/standards/mads/mads.xsd">
37 <xsl:for-each select="descendant-or-self::marc:record">
38 <xsl:call-template name="marcRecord"/>
45 <xsl:template name="marcRecord">
46 <xsl:if test="contains(marc:datafield[@tag='035'],'tea2003000479')">
50 <xsl:apply-templates select="marc:datafield[100 <= @tag and @tag < 200]"/>
53 <xsl:apply-templates select="marc:datafield[500 <= @tag and @tag <= 585]|marc:datafield[700 <= @tag and @tag <= 785]"/>
56 <xsl:apply-templates select="marc:datafield[400 <= @tag and @tag <= 485]"/>
58 <xsl:apply-templates select="marc:datafield[667 <= @tag and @tag <= 688]"/>
60 <xsl:apply-templates select="marc:datafield[@tag=856]"/>
62 <xsl:apply-templates select="marc:datafield[@tag=010]"/>
63 <xsl:apply-templates select="marc:datafield[@tag=024]"/>
64 <xsl:apply-templates select="marc:datafield[@tag=040]/marc:subfield[@code='a']"/>
65 <xsl:apply-templates select="marc:controlfield[@tag=008]"/>
66 <xsl:apply-templates select="marc:controlfield[@tag=005]"/>
67 <xsl:apply-templates select="marc:controlfield[@tag=001]"/>
68 <xsl:apply-templates select="marc:datafield[@tag=040]/marc:subfield[@code='b']"/>
72 <!-- start of secondary templates -->
74 <!-- ======== xlink ======== -->
76 <!-- <xsl:template name="uri">
77 <xsl:for-each select="marc:subfield[@code='0']">
78 <xsl:attribute name="xlink:href">
79 <xsl:value-of select="."/>
84 <xsl:template match="marc:subfield[@code='i']">
85 <xsl:attribute name="type">
86 <xsl:value-of select="."/>
90 <xsl:template name="role">
91 <xsl:for-each select="marc:subfield[@code='e']">
93 <roleTerm type="text">
94 <xsl:value-of select="."/>
100 <xsl:template name="part">
101 <xsl:variable name="partNumber">
102 <xsl:call-template name="specialSubfieldSelect">
103 <xsl:with-param name="axis">n</xsl:with-param>
104 <xsl:with-param name="anyCodes">n</xsl:with-param>
105 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
108 <xsl:variable name="partName">
109 <xsl:call-template name="specialSubfieldSelect">
110 <xsl:with-param name="axis">p</xsl:with-param>
111 <xsl:with-param name="anyCodes">p</xsl:with-param>
112 <xsl:with-param name="afterCodes">fghkdlmor</xsl:with-param>
115 <xsl:if test="string-length(normalize-space($partNumber))">
117 <xsl:call-template name="chopPunctuation">
118 <xsl:with-param name="chopString" select="$partNumber"/>
122 <xsl:if test="string-length(normalize-space($partName))">
124 <xsl:call-template name="chopPunctuation">
125 <xsl:with-param name="chopString" select="$partName"/>
131 <xsl:template name="nameABCDN">
132 <xsl:for-each select="marc:subfield[@code='a']">
134 <xsl:call-template name="chopPunctuation">
135 <xsl:with-param name="chopString" select="."/>
139 <xsl:for-each select="marc:subfield[@code='b']">
141 <xsl:value-of select="."/>
144 <xsl:if test="marc:subfield[@code='c'] or marc:subfield[@code='d'] or marc:subfield[@code='n']">
146 <xsl:call-template name="subfieldSelect">
147 <xsl:with-param name="codes">cdn</xsl:with-param>
153 <xsl:template name="nameABCDQ">
155 <xsl:call-template name="chopPunctuation">
156 <xsl:with-param name="chopString">
157 <xsl:call-template name="subfieldSelect">
158 <xsl:with-param name="codes">aq</xsl:with-param>
163 <xsl:call-template name="termsOfAddress"/>
164 <xsl:call-template name="nameDate"/>
167 <xsl:template name="nameACDENQ">
169 <xsl:call-template name="subfieldSelect">
170 <xsl:with-param name="codes">acdenq</xsl:with-param>
175 <xsl:template name="nameDate">
176 <xsl:for-each select="marc:subfield[@code='d']">
177 <namePart type="date">
178 <xsl:call-template name="chopPunctuation">
179 <xsl:with-param name="chopString" select="."/>
185 <xsl:template name="specialSubfieldSelect">
186 <xsl:param name="anyCodes"/>
187 <xsl:param name="axis"/>
188 <xsl:param name="beforeCodes"/>
189 <xsl:param name="afterCodes"/>
190 <xsl:variable name="str">
191 <xsl:for-each select="marc:subfield">
192 <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])">
193 <xsl:value-of select="text()"/>
194 <xsl:text> </xsl:text>
198 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
201 <xsl:template name="termsOfAddress">
202 <xsl:if test="marc:subfield[@code='b' or @code='c']">
203 <namePart type="termsOfAddress">
204 <xsl:call-template name="chopPunctuation">
205 <xsl:with-param name="chopString">
206 <xsl:call-template name="subfieldSelect">
207 <xsl:with-param name="codes">bc</xsl:with-param>
215 <xsl:template name="displayLabel">
216 <xsl:if test="marc:subfield[@code='z']">
217 <xsl:attribute name="displayLabel">
218 <xsl:value-of select="marc:subfield[@code='z']"/>
221 <xsl:if test="marc:subfield[@code='3']">
222 <xsl:attribute name="displayLabel">
223 <xsl:value-of select="marc:subfield[@code='3']"/>
228 <xsl:template name="isInvalid">
229 <xsl:if test="marc:subfield[@code='z']">
230 <xsl:attribute name="invalid">yes</xsl:attribute>
234 <xsl:template name="sub2Attribute">
236 <xsl:if test="marc:subfield[@code='2']">
237 <xsl:attribute name="type">
238 <xsl:value-of select="marc:subfield[@code='2']"/>
242 <xsl:template match="marc:controlfield[@tag=001]">
244 <xsl:if test="../marc:controlfield[@tag=003]">
245 <xsl:attribute name="source">
246 <xsl:value-of select="../marc:controlfield[@tag=003]"/>
249 <xsl:value-of select="."/>
253 <xsl:template match="marc:controlfield[@tag=005]">
254 <recordChangeDate encoding="iso8601">
255 <xsl:value-of select="."/>
259 <xsl:template match="marc:controlfield[@tag=008]">
260 <recordCreationDate encoding="marc">
261 <xsl:value-of select="substring(.,1,6)"/>
262 </recordCreationDate>
265 <xsl:template match="marc:datafield[@tag=010]">
267 <xsl:call-template name="isInvalid"/>
268 <xsl:call-template name="sub2Attribute"/>
269 <xsl:value-of select="marc:subfield[@code='a']"/>
273 <xsl:template match="marc:datafield[@tag=024]">
275 <xsl:call-template name="isInvalid"/>
276 <xsl:call-template name="sub2Attribute"/>
277 <xsl:value-of select="marc:subfield[@code='a']"/>
281 <xsl:template match="marc:datafield[@tag=040]/marc:subfield[@code='a']">
282 <recordContentSource authority="marcorg">
283 <xsl:value-of select="."/>
284 </recordContentSource>
287 <xsl:template match="marc:datafield[@tag=040]/marc:subfield[@code='b']">
288 <languageOfCataloging>
289 <languageTerm authority="iso639-2b" type="code">
290 <xsl:value-of select="."/>
292 </languageOfCataloging>
295 <!-- ========== names ========== -->
296 <xsl:template match="marc:datafield[@tag=100]">
297 <name type="personal">
298 <xsl:call-template name="setAuthority"/>
299 <xsl:call-template name="nameABCDQ"/>
300 <xsl:call-template name="role"/>
302 <xsl:apply-templates select="*[marc:subfield[not(contains('abcdeq',@code))]]"/>
303 <xsl:call-template name="title"/>
304 <xsl:apply-templates/>
307 <xsl:template match="marc:datafield[@tag=110]">
308 <name type="corporate">
309 <xsl:call-template name="setAuthority"/>
310 <xsl:call-template name="nameABCDN"/>
311 <xsl:call-template name="role"/>
313 <xsl:apply-templates/>
316 <xsl:template match="marc:datafield[@tag=111]">
317 <name type="conference">
318 <xsl:call-template name="setAuthority"/>
319 <xsl:call-template name="nameACDENQ"/>
321 <xsl:apply-templates/>
324 <xsl:template match="marc:datafield[@tag=400]">
326 <xsl:call-template name="variantTypeAttribute"/>
327 <name type="personal">
328 <xsl:call-template name="nameABCDQ"/>
329 <xsl:call-template name="role"/>
331 <xsl:apply-templates/>
332 <xsl:call-template name="title"/>
336 <xsl:template match="marc:datafield[@tag=410]">
338 <xsl:call-template name="variantTypeAttribute"/>
339 <name type="corporate">
340 <xsl:call-template name="nameABCDN"/>
341 <xsl:call-template name="role"/>
343 <xsl:apply-templates/>
347 <xsl:template match="marc:datafield[@tag=411]">
349 <xsl:call-template name="variantTypeAttribute"/>
350 <name type="conference">
351 <xsl:call-template name="nameACDENQ"/>
353 <xsl:apply-templates/>
357 <xsl:template match="marc:datafield[@tag=500]|marc:datafield[@tag=700]">
359 <xsl:call-template name="relatedTypeAttribute"/>
360 <!-- <xsl:call-template name="uri"/> -->
361 <name type="personal">
362 <xsl:call-template name="setAuthority"/>
363 <xsl:call-template name="nameABCDQ"/>
364 <xsl:call-template name="role"/>
366 <xsl:call-template name="title"/>
367 <xsl:apply-templates/>
371 <xsl:template match="marc:datafield[@tag=510]|marc:datafield[@tag=710]">
373 <xsl:call-template name="relatedTypeAttribute"/>
374 <!-- <xsl:call-template name="uri"/> -->
375 <name type="corporate">
376 <xsl:call-template name="setAuthority"/>
377 <xsl:call-template name="nameABCDN"/>
378 <xsl:call-template name="role"/>
380 <xsl:apply-templates/>
384 <xsl:template match="marc:datafield[@tag=511]|marc:datafield[@tag=711]">
386 <xsl:call-template name="relatedTypeAttribute"/>
387 <!-- <xsl:call-template name="uri"/> -->
388 <name type="conference">
389 <xsl:call-template name="setAuthority"/>
390 <xsl:call-template name="nameACDENQ"/>
392 <xsl:apply-templates/>
396 <!-- ========== titles ========== -->
397 <xsl:template match="marc:datafield[@tag=130]">
398 <xsl:call-template name="uniform-title"/>
399 <xsl:apply-templates/>
402 <xsl:template match="marc:datafield[@tag=430]">
404 <xsl:call-template name="variantTypeAttribute"/>
405 <xsl:call-template name="uniform-title"/>
406 <xsl:apply-templates/>
410 <xsl:template match="marc:datafield[@tag=530]|marc:datafield[@tag=730]">
412 <xsl:call-template name="relatedTypeAttribute"/>
413 <xsl:call-template name="uniform-title"/>
414 <xsl:apply-templates/>
418 <xsl:template name="title">
420 <xsl:call-template name="setAuthority"/>
422 <xsl:variable name="str">
423 <xsl:for-each select="marc:subfield">
424 <xsl:if test="(contains('tfghklmors',@code) )">
425 <xsl:value-of select="text()"/>
426 <xsl:text> </xsl:text>
431 <xsl:call-template name="chopPunctuation">
432 <xsl:with-param name="chopString">
433 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
437 <xsl:call-template name="part"/>
438 <!-- <xsl:call-template name="uri"/> -->
442 <xsl:template name="uniform-title">
444 <xsl:call-template name="setAuthority"/>
446 <xsl:variable name="str">
447 <xsl:for-each select="marc:subfield">
448 <xsl:if test="(contains('adfghklmors',@code) )">
449 <xsl:value-of select="text()"/>
450 <xsl:text> </xsl:text>
455 <xsl:call-template name="chopPunctuation">
456 <xsl:with-param name="chopString">
457 <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
461 <xsl:call-template name="part"/>
462 <!-- <xsl:call-template name="uri"/> -->
467 <!-- ========== topics ========== -->
468 <xsl:template match="marc:subfield[@code='x']">
470 <xsl:call-template name="chopPunctuation">
471 <xsl:with-param name="chopString">
472 <xsl:value-of select="."/>
478 <xsl:template match="marc:datafield[@tag=150][marc:subfield[@code='a' or @code='b']]|marc:datafield[@tag=180][marc:subfield[@code='x']]">
479 <xsl:call-template name="topic"/>
482 <xsl:template match="marc:datafield[@tag=450][marc:subfield[@code='a' or @code='b']]|marc:datafield[@tag=480][marc:subfield[@code='x']]">
484 <xsl:call-template name="variantTypeAttribute"/>
485 <xsl:call-template name="topic"/>
489 <xsl:template match="marc:datafield[@tag=550 or @tag=750][marc:subfield[@code='a' or @code='b']]">
491 <xsl:call-template name="relatedTypeAttribute"/>
492 <!-- <xsl:call-template name="uri"/> -->
493 <xsl:call-template name="topic"/>
497 <xsl:template name="topic">
499 <xsl:if test="@tag=550 or @tag=750">
500 <xsl:call-template name="subfieldSelect">
501 <xsl:with-param name="codes">ab</xsl:with-param>
504 <xsl:call-template name="setAuthority"/>
505 <xsl:call-template name="chopPunctuation">
506 <xsl:with-param name="chopString">
508 <xsl:when test="@tag=180 or @tag=480 or @tag=580 or @tag=780">
509 <xsl:apply-templates select="marc:subfield[@code='x']"/>
512 <xsl:call-template name="subfieldSelect">
513 <xsl:with-param name="codes">ab</xsl:with-param>
520 <xsl:apply-templates/>
523 <!-- ========= temporals ========== -->
525 <xsl:template match="marc:subfield[@code='y']">
527 <xsl:call-template name="chopPunctuation">
528 <xsl:with-param name="chopString">
529 <xsl:value-of select="."/>
535 <xsl:template match="marc:datafield[@tag=148][marc:subfield[@code='a']]|marc:datafield[@tag=182 ][marc:subfield[@code='y']]">
536 <xsl:call-template name="temporal"/>
539 <xsl:template match="marc:datafield[@tag=448][marc:subfield[@code='a']]|marc:datafield[@tag=482][marc:subfield[@code='y']]">
541 <xsl:call-template name="variantTypeAttribute"/>
542 <xsl:call-template name="temporal"/>
546 <xsl:template match="marc:datafield[@tag=548 or @tag=748][marc:subfield[@code='a']]|marc:datafield[@tag=582 or @tag=782][marc:subfield[@code='y']]">
548 <xsl:call-template name="relatedTypeAttribute"/>
549 <!-- <xsl:call-template name="uri"/> -->
550 <xsl:call-template name="temporal"/>
554 <xsl:template name="temporal">
556 <xsl:if test="@tag=548 or @tag=748">
557 <xsl:value-of select="marc:subfield[@code='a']"/>
559 <xsl:call-template name="setAuthority"/>
560 <xsl:call-template name="chopPunctuation">
561 <xsl:with-param name="chopString">
563 <xsl:when test="@tag=182 or @tag=482 or @tag=582 or @tag=782">
564 <xsl:apply-templates select="marc:subfield[@code='y']"/>
567 <xsl:value-of select="marc:subfield[@code='a']"/>
573 <xsl:apply-templates/>
576 <!-- ========== genre ========== -->
577 <xsl:template match="marc:subfield[@code='v']">
579 <xsl:call-template name="chopPunctuation">
580 <xsl:with-param name="chopString">
581 <xsl:value-of select="."/>
587 <xsl:template match="marc:datafield[@tag=155][marc:subfield[@code='a']]|marc:datafield[@tag=185][marc:subfield[@code='v']]">
588 <xsl:call-template name="genre"/>
591 <xsl:template match="marc:datafield[@tag=455][marc:subfield[@code='a']]|marc:datafield[@tag=485 ][marc:subfield[@code='v']]">
593 <xsl:call-template name="variantTypeAttribute"/>
594 <xsl:call-template name="genre"/>
598 <xsl:template match="marc:datafield[@tag=555]">
600 <xsl:call-template name="relatedTypeAttribute"/>
601 <!-- <xsl:call-template name="uri"/> -->
602 <xsl:call-template name="genre"/>
606 <xsl:template match="marc:datafield[@tag=555 or @tag=755][marc:subfield[@code='a']]|marc:datafield[@tag=585][marc:subfield[@code='v']]">
608 <xsl:call-template name="relatedTypeAttribute"/>
609 <xsl:call-template name="genre"/>
613 <xsl:template name="genre">
615 <xsl:if test="@tag=555">
616 <xsl:value-of select="marc:subfield[@code='a']"/>
618 <xsl:call-template name="setAuthority"/>
619 <xsl:call-template name="chopPunctuation">
620 <xsl:with-param name="chopString">
622 <xsl:when test="@tag=185 or @tag=485 or @tag=585">
623 <xsl:apply-templates select="marc:subfield[@code='v']"/>
626 <xsl:value-of select="marc:subfield[@code='a']"/>
632 <xsl:apply-templates/>
635 <!-- ========= geographic ========== -->
636 <xsl:template match="marc:subfield[@code='z']">
638 <xsl:call-template name="chopPunctuation">
639 <xsl:with-param name="chopString">
640 <xsl:value-of select="."/>
646 <xsl:template name="geographic">
648 <xsl:if test="@tag=551">
649 <xsl:value-of select="marc:subfield[@code='a']"/>
651 <xsl:call-template name="setAuthority"/>
652 <xsl:call-template name="chopPunctuation">
653 <xsl:with-param name="chopString">
655 <xsl:when test="@tag=181 or @tag=481 or @tag=581">
656 <xsl:apply-templates select="marc:subfield[@code='z']"/>
659 <xsl:value-of select="marc:subfield[@code='a']"/>
665 <xsl:apply-templates/>
668 <xsl:template match="marc:datafield[@tag=151][marc:subfield[@code='a']]|marc:datafield[@tag=181][marc:subfield[@code='z']]">
669 <xsl:call-template name="geographic"/>
672 <xsl:template match="marc:datafield[@tag=451][marc:subfield[@code='a']]|marc:datafield[@tag=481][marc:subfield[@code='z']]">
674 <xsl:call-template name="variantTypeAttribute"/>
675 <xsl:call-template name="geographic"/>
679 <xsl:template match="marc:datafield[@tag=551]|marc:datafield[@tag=581][marc:subfield[@code='z']]">
681 <xsl:call-template name="relatedTypeAttribute"/>
682 <!-- <xsl:call-template name="uri"/> -->
683 <xsl:call-template name="geographic"/>
687 <xsl:template match="marc:datafield[@tag=580]">
689 <xsl:call-template name="relatedTypeAttribute"/>
690 <xsl:apply-templates/>
694 <xsl:template match="marc:datafield[@tag=751][marc:subfield[@code='z']]|marc:datafield[@tag=781][marc:subfield[@code='z']]">
696 <xsl:call-template name="relatedTypeAttribute"/>
697 <xsl:call-template name="geographic"/>
701 <xsl:template match="marc:datafield[@tag=755]">
703 <xsl:call-template name="relatedTypeAttribute"/>
704 <xsl:call-template name="genre"/>
705 <xsl:call-template name="setAuthority"/>
706 <xsl:apply-templates/>
710 <xsl:template match="marc:datafield[@tag=780]">
712 <xsl:call-template name="relatedTypeAttribute"/>
713 <xsl:apply-templates/>
717 <xsl:template match="marc:datafield[@tag=785]">
719 <xsl:call-template name="relatedTypeAttribute"/>
720 <xsl:apply-templates/>
724 <!-- ========== notes ========== -->
725 <xsl:template match="marc:datafield[667 <= @tag and @tag <= 688]">
728 <xsl:when test="@tag=667">
729 <xsl:attribute name="type">nonpublic</xsl:attribute>
731 <xsl:when test="@tag=670">
732 <xsl:attribute name="type">source</xsl:attribute>
734 <xsl:when test="@tag=675">
735 <xsl:attribute name="type">notFound</xsl:attribute>
737 <xsl:when test="@tag=678">
738 <xsl:attribute name="type">history</xsl:attribute>
740 <xsl:when test="@tag=681">
741 <xsl:attribute name="type">subject example</xsl:attribute>
743 <xsl:when test="@tag=682">
744 <xsl:attribute name="type">deleted heading information</xsl:attribute>
746 <xsl:when test="@tag=688">
747 <xsl:attribute name="type">application history</xsl:attribute>
750 <xsl:call-template name="chopPunctuation">
751 <xsl:with-param name="chopString">
753 <xsl:when test="@tag=667 or @tag=675">
754 <xsl:value-of select="marc:subfield[@code='a']"/>
756 <xsl:when test="@tag=670 or @tag=678">
757 <xsl:call-template name="subfieldSelect">
758 <xsl:with-param name="codes">ab</xsl:with-param>
761 <xsl:when test="680 <= @tag and @tag <=688">
762 <xsl:call-template name="subfieldSelect">
763 <xsl:with-param name="codes">ai</xsl:with-param>
771 <!-- ========== url ========== -->
772 <xsl:template match="marc:datafield[@tag=856][marc:subfield[@code='u']]">
774 <xsl:if test="marc:subfield[@code='z' or @code='3']">
775 <xsl:attribute name="displayLabel">
776 <xsl:call-template name="subfieldSelect">
777 <xsl:with-param name="codes">z3</xsl:with-param>
781 <xsl:value-of select="marc:subfield[@code='u']"/>
785 <xsl:template name="relatedTypeAttribute">
787 <xsl:when test="@tag=500 or @tag=510 or @tag=511 or @tag=548 or @tag=550 or @tag=551 or @tag=555 or @tag=580 or @tag=581 or @tag=582 or @tag=585">
788 <xsl:if test="substring(marc:subfield[@code='w'],1,1)='a'">
789 <xsl:attribute name="type">earlier</xsl:attribute>
791 <xsl:if test="substring(marc:subfield[@code='w'],1,1)='b'">
792 <xsl:attribute name="type">later</xsl:attribute>
794 <xsl:if test="substring(marc:subfield[@code='w'],1,1)='t'">
795 <xsl:attribute name="type">parentOrg</xsl:attribute>
797 <xsl:if test="substring(marc:subfield[@code='w'],1,1)='g'">
798 <xsl:attribute name="type">broader</xsl:attribute>
800 <xsl:if test="substring(marc:subfield[@code='w'],1,1)='h'">
801 <xsl:attribute name="type">narrower</xsl:attribute>
803 <xsl:if test="contains('fin|', substring(marc:subfield[@code='w'],1,1))">
804 <xsl:attribute name="type">other</xsl:attribute>
807 <xsl:when test="@tag=530 or @tag=730">
808 <xsl:attribute name="type">other</xsl:attribute>
812 <xsl:attribute name="type">equivalent</xsl:attribute>
815 <xsl:apply-templates select="marc:subfield[@code='i']"/>
818 <xsl:template name="variantTypeAttribute">
820 <xsl:when test="@tag=400 or @tag=410 or @tag=411 or @tag=451 or @tag=455 or @tag=480 or @tag=481 or @tag=482 or @tag=485">
821 <xsl:if test="substring(marc:subfield[@code='w'],1,1)='d'">
822 <xsl:attribute name="type">acronym</xsl:attribute>
824 <xsl:if test="contains('fit', substring(marc:subfield[@code='w'],1,1))">
825 <xsl:attribute name="type">other</xsl:attribute>
830 <xsl:attribute name="type">other</xsl:attribute>
833 <xsl:apply-templates select="marc:subfield[@code='i']"/>
835 <xsl:template name="setAuthority">
837 <!-- can be called from the datafield or subfield level, so "..//@tag" means
838 the tag can be at the subfield's parent level or at the datafields own level -->
839 <xsl:when test="ancestor-or-self::marc:datafield/@tag=100 and (@ind1=0 or @ind1=1) and $controlField008-11='a' and $controlField008-14='a'">
840 <xsl:attribute name="authority"><xsl:text>naf</xsl:text></xsl:attribute>
842 <xsl:when test="ancestor-or-self::marc:datafield/@tag=100 and (@ind1=0 or @ind1=1) and $controlField008-11='a' and $controlField008-14='b'">
843 <xsl:attribute name="authority"><xsl:text>lcsh</xsl:text></xsl:attribute>
845 <xsl:when test="ancestor-or-self::marc:datafield/@tag=100 and (@ind1=0 or @ind1=1) and $controlField008-11='k'">
846 <xsl:attribute name="authority"><xsl:text>lacnaf</xsl:text></xsl:attribute>
848 <xsl:when test="ancestor-or-self::marc:datafield/@tag=100 and @ind1=3 and $controlField008-11='a' and $controlField008-14='b'">
849 <xsl:attribute name="authority"><xsl:text>lcsh</xsl:text></xsl:attribute>
851 <xsl:when test="ancestor-or-self::marc:datafield/@tag=100 and @ind1=3 and $controlField008-11='k' and $controlField008-14='b'">
852 <xsl:attribute name="authority">cash</xsl:attribute>
854 <xsl:when test="ancestor-or-self::marc:datafield/@tag=110 and $controlField008-11='a' and $controlField008-14='a'">
855 <xsl:attribute name="authority">naf</xsl:attribute>
857 <xsl:when test="ancestor-or-self::marc:datafield/@tag=110 and $controlField008-11='a' and $controlField008-14='b'">
858 <xsl:attribute name="authority">lcsh</xsl:attribute>
860 <xsl:when test="ancestor-or-self::marc:datafield/@tag=110 and $controlField008-11='k' and $controlField008-14='a'">
861 <xsl:attribute name="authority"><xsl:text>lacnaf</xsl:text></xsl:attribute>
863 <xsl:when test="ancestor-or-self::marc:datafield/@tag=110 and $controlField008-11='k' and $controlField008-14='b'">
864 <xsl:attribute name="authority"><xsl:text>cash</xsl:text></xsl:attribute>
866 <xsl:when test="100 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 155 and $controlField008-11='b'">
867 <xsl:attribute name="authority"><xsl:text>lcshcl</xsl:text></xsl:attribute>
869 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=100 or ancestor-or-self::marc:datafield/@tag=110 or ancestor-or-self::marc:datafield/@tag=111 or ancestor-or-self::marc:datafield/@tag=130 or ancestor-or-self::marc:datafield/@tag=151) and $controlField008-11='c'">
870 <xsl:attribute name="authority"><xsl:text>nlmnaf</xsl:text></xsl:attribute>
872 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=100 or ancestor-or-self::marc:datafield/@tag=110 or ancestor-or-self::marc:datafield/@tag=111 or ancestor-or-self::marc:datafield/@tag=130 or ancestor-or-self::marc:datafield/@tag=151) and $controlField008-11='d'">
873 <xsl:attribute name="authority"><xsl:text>nalnaf</xsl:text></xsl:attribute>
875 <xsl:when test="100 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 155 and $controlField008-11='r'">
876 <xsl:attribute name="authority"><xsl:text>aat</xsl:text></xsl:attribute>
878 <xsl:when test="100 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 155 and $controlField008-11='s'">
879 <xsl:attribute name="authority">sears</xsl:attribute>
881 <xsl:when test="100 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 155 and $controlField008-11='v'">
882 <xsl:attribute name="authority">rvm</xsl:attribute>
884 <xsl:when test="100 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 155 and $controlField008-11='z'">
885 <xsl:attribute name="authority"><xsl:value-of select="../marc:datafield[ancestor-or-self::marc:datafield/@tag=040]/marc:subfield[@code='f']"/></xsl:attribute>
887 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=111 or ancestor-or-self::marc:datafield/@tag=130) and $controlField008-11='a' and $controlField008-14='a'">
888 <xsl:attribute name="authority"><xsl:text>naf</xsl:text></xsl:attribute>
890 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=111 or ancestor-or-self::marc:datafield/@tag=130) and $controlField008-11='a' and $controlField008-14='b'">
891 <xsl:attribute name="authority"><xsl:text>lcsh</xsl:text></xsl:attribute>
893 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=111 or ancestor-or-self::marc:datafield/@tag=130) and $controlField008-11='k' ">
894 <xsl:attribute name="authority"><xsl:text>lacnaf</xsl:text></xsl:attribute>
896 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=148 or ancestor-or-self::marc:datafield/@tag=150 or ancestor-or-self::marc:datafield/@tag=155) and $controlField008-11='a' ">
897 <xsl:attribute name="authority"><xsl:text>lcsh</xsl:text></xsl:attribute>
899 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=148 or ancestor-or-self::marc:datafield/@tag=150 or ancestor-or-self::marc:datafield/@tag=155) and $controlField008-11='a' ">
900 <xsl:attribute name="authority"><xsl:text>lcsh</xsl:text></xsl:attribute>
902 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=148 or ancestor-or-self::marc:datafield/@tag=150 or ancestor-or-self::marc:datafield/@tag=155) and $controlField008-11='c' ">
903 <xsl:attribute name="authority"><xsl:text>mesh</xsl:text></xsl:attribute>
905 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=148 or ancestor-or-self::marc:datafield/@tag=150 or ancestor-or-self::marc:datafield/@tag=155) and $controlField008-11='d' ">
906 <xsl:attribute name="authority"><xsl:text>nal</xsl:text></xsl:attribute>
908 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=148 or ancestor-or-self::marc:datafield/@tag=150 or ancestor-or-self::marc:datafield/@tag=155) and $controlField008-11='k' ">
909 <xsl:attribute name="authority"><xsl:text>cash</xsl:text></xsl:attribute>
911 <xsl:when test="ancestor-or-self::marc:datafield/@tag=151 and $controlField008-11='a' and $controlField008-14='a'">
912 <xsl:attribute name="authority"><xsl:text>naf</xsl:text></xsl:attribute>
914 <xsl:when test="ancestor-or-self::marc:datafield/@tag=151 and $controlField008-11='a' and $controlField008-14='b'">
915 <xsl:attribute name="authority">lcsh</xsl:attribute>
917 <xsl:when test="ancestor-or-self::marc:datafield/@tag=151 and $controlField008-11='k' and $controlField008-14='a'">
918 <xsl:attribute name="authority">lacnaf</xsl:attribute>
920 <xsl:when test="ancestor-or-self::marc:datafield/@tag=151 and $controlField008-11='k' and $controlField008-14='b'">
921 <xsl:attribute name="authority">cash</xsl:attribute>
924 <xsl:when test="(..//ancestor-or-self::marc:datafield/@tag=180 or ..//ancestor-or-self::marc:datafield/@tag=181 or ..//ancestor-or-self::marc:datafield/@tag=182 or ..//ancestor-or-self::marc:datafield/@tag=185) and $controlField008-11='a'">
925 <xsl:attribute name="authority">lcsh</xsl:attribute>
928 <xsl:when test="ancestor-or-self::marc:datafield/@tag=700 and (@ind1='0' or @ind1='1') and @ind2='0'">
929 <xsl:attribute name="authority">naf</xsl:attribute>
931 <xsl:when test="ancestor-or-self::marc:datafield/@tag=700 and (@ind1='0' or @ind1='1') and @ind2='5'">
932 <xsl:attribute name="authority">lacnaf</xsl:attribute>
934 <xsl:when test="ancestor-or-self::marc:datafield/@tag=700 and @ind1='3' and @ind2='0'">
935 <xsl:attribute name="authority">lcsh</xsl:attribute>
937 <xsl:when test="ancestor-or-self::marc:datafield/@tag=700 and @ind1='3' and @ind2='5'">
938 <xsl:attribute name="authority">cash</xsl:attribute>
940 <xsl:when test="(700 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 755 ) and @ind2='1'">
941 <xsl:attribute name="authority">lcshcl</xsl:attribute>
943 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=700 or ancestor-or-self::marc:datafield/@tag=710 or ancestor-or-self::marc:datafield/@tag=711 or ancestor-or-self::marc:datafield/@tag=730 or ancestor-or-self::marc:datafield/@tag=751) and @ind2='2'">
944 <xsl:attribute name="authority">nlmnaf</xsl:attribute>
946 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=700 or ancestor-or-self::marc:datafield/@tag=710 or ancestor-or-self::marc:datafield/@tag=711 or ancestor-or-self::marc:datafield/@tag=730 or ancestor-or-self::marc:datafield/@tag=751) and @ind2='3'">
947 <xsl:attribute name="authority">nalnaf</xsl:attribute>
949 <xsl:when test="(700 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 755 ) and @ind2='6'">
950 <xsl:attribute name="authority">rvm</xsl:attribute>
952 <xsl:when test="(700 <= ancestor-or-self::marc:datafield/@tag and ancestor-or-self::marc:datafield/@tag <= 755 ) and @ind2='7'">
953 <xsl:attribute name="authority">
954 <xsl:value-of select="marc:subfield[@code='2']"/>
957 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=710 or ancestor-or-self::marc:datafield/@tag=711 or ancestor-or-self::marc:datafield/@tag=730 or ancestor-or-self::marc:datafield/@tag=751) and @ind2='5'">
958 <xsl:attribute name="authority">lacnaf</xsl:attribute>
960 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=710 or ancestor-or-self::marc:datafield/@tag=711 or ancestor-or-self::marc:datafield/@tag=730 or ancestor-or-self::marc:datafield/@tag=751) and @ind2='0'">
961 <xsl:attribute name="authority">naf</xsl:attribute>
963 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=748 or ancestor-or-self::marc:datafield/@tag=750 or ancestor-or-self::marc:datafield/@tag=755) and @ind2='0'">
964 <xsl:attribute name="authority">lcsh</xsl:attribute>
966 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=748 or ancestor-or-self::marc:datafield/@tag=750 or ancestor-or-self::marc:datafield/@tag=755) and @ind2='2'">
967 <xsl:attribute name="authority">mesh</xsl:attribute>
969 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=748 or ancestor-or-self::marc:datafield/@tag=750 or ancestor-or-self::marc:datafield/@tag=755) and @ind2='3'">
970 <xsl:attribute name="authority">nal</xsl:attribute>
972 <xsl:when test="(ancestor-or-self::marc:datafield/@tag=748 or ancestor-or-self::marc:datafield/@tag=750 or ancestor-or-self::marc:datafield/@tag=755) and @ind2='5'">
973 <xsl:attribute name="authority">cash</xsl:attribute>
978 <!--<xsl:template name="oldsetAuth">
979 <xsl:param name="ind2"/>
980 <xsl:if test="100 <= @tag and @tag < 200">
981 <xsl:attribute name="authority">
982 <xsl:value-of select="$auth"/>
985 <xsl:if test="(700 <= @tag and @tag < 800) or /marc:datafield[700 <=@tag and @tag < 800]">
986 <xsl:attribute name="authority">
988 <xsl:when test="$ind2='0'">naf</xsl:when>
989 <xsl:when test="$ind2='2'">nlm</xsl:when>
990 <xsl:when test="$ind2='3'">nal</xsl:when>
991 <xsl:when test="$ind2='5'">lac</xsl:when>
992 <xsl:when test="$ind2='6'">rvm</xsl:when>
993 <xsl:when test="$ind2='7'"><xsl:value-of select="../marc:subfield[@code='2']"/></xsl:when>
999 <!--<xsl:template name="oldsetAuth2">
1000 <xsl:param name="ind2"/>
1001 <xsl:if test="(100 <= @tag and @tag < 200) or ../marc:datafield[100 <=@tag and @tag < 200]">
1002 <xsl:attribute name="authority">
1004 <xsl:when test="$controlField008-11='a'">lcsh</xsl:when>
1005 <xsl:when test="$controlField008-11='b'">lcac</xsl:when>
1006 <xsl:when test="$controlField008-11='c'">mesh</xsl:when>
1007 <xsl:when test="$controlField008-11='d'">nal</xsl:when>
1008 <xsl:when test="$controlField008-11='k'">cash</xsl:when>
1009 <xsl:when test="$controlField008-11='r'">aat</xsl:when>
1010 <xsl:when test="$controlField008-11='s'">sears</xsl:when>
1011 <xsl:when test="$controlField008-11='v'">rvm</xsl:when>
1012 <xsl:when test="$controlField008-11='z'"><xsl:value-of select="../marc:datafield[@tag=040]/marc:subfield[@code='f']"/></xsl:when>
1016 <xsl:if test="(500 <= @tag and @tag < 800) or /marc:datafield[500 <=@tag and @tag < 800]">
1017 <xsl:attribute name="authority">
1019 <xsl:when test="$ind2='0'">lcsh</xsl:when>
1020 <xsl:when test="$ind2='1'">lcac</xsl:when>
1021 <xsl:when test="$ind2='2'">mesh</xsl:when>
1022 <xsl:when test="$ind2='3'">nal</xsl:when>
1023 <xsl:when test="$ind2='5'">cash</xsl:when>
1024 <xsl:when test="$ind2='6'">rvm</xsl:when>
1025 <xsl:when test="$ind2='7'"><xsl:value-of select="../marc:subfield[@code='2']"/></xsl:when>
1030 <!--<xsl:template match="marc:subfield[@code='0']">
1031 <xsl:attribute name="xlink:href">
1032 <xsl:value-of select="."/>
1036 <xsl:template match="*"/>
1037 <!--<xsl:template match="*">
1038 <n><xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
1039 <xsl:attribute name="code"><xsl:value-of select="@code"/></xsl:attribute>
1040 <xsl:value-of select="name()"/>
1042 <v><xsl:value-of select="."/></v></n>
1044 </xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2003 Copyright Sonic Software Corporation. All rights reserved.
1046 <scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\documents\mads_short.xml" htmlbaseurl="" outputurl="" processortype="internal" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperInfo srcSchemaPath="" srcSchemaRoot="" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>