|
81 | 81 | <xsl:with-param name="v880Ref" select="$v880Ref"/>
|
82 | 82 | </xsl:call-template>
|
83 | 83 | </xsl:for-each>
|
84 |
| - |
| 84 | + |
85 | 85 | <xsl:for-each select="$v880Fields">
|
86 | 86 | <xsl:variable name="vTag">
|
87 | 87 | <xsl:value-of select="substring(marc:subfield[@code = '6'], 1, 3)"/>
|
|
93 | 93 | <xsl:variable name="v880Ref">
|
94 | 94 | <xsl:value-of select="concat('880-', $v880Occurrence)"/>
|
95 | 95 | </xsl:variable>
|
96 |
| - <xsl:variable name="relatedField" select="../marc:datafield[@tag = $vTag and contains(marc:subfield[@code = '6'], $v880Ref)]" |
97 |
| - /> |
98 |
| - <xsl:copy-of select="$relatedField"/> |
| 96 | + |
| 97 | + <!-- Is this 880 related to a 26X field in this record? --> |
| 98 | + <xsl:variable name="relatedField" select="../marc:datafield[@tag = $vTag and contains(marc:subfield[@code = '6'], $v880Ref)]" /> |
| 99 | + |
| 100 | + <!-- commented out on 30 Aug 2024. Did doing this break something? --> |
| 101 | + <!-- <xsl:copy-of select="$relatedField"/> --> |
| 102 | + |
| 103 | + <!-- If no related field was found, then we have an unpaied 880. We need to output it. --> |
99 | 104 | <xsl:if test="count($relatedField/marc:*) = 0">
|
100 | 105 | <xsl:variable name="dfFrom880-prenodeset">
|
101 | 106 | <marc:datafield>
|
|
121 | 126 | </xsl:for-each>
|
122 | 127 | </xsl:variable>
|
123 | 128 | <xsl:variable name="sfblocks" select="exsl:node-set($sfblocks-prenodeset)"/>
|
124 |
| - <!--<xsl:copy-of select="$sfblocks"/>--> |
| 129 | + <!-- <xsl:message><xsl:copy-of select="$sfblocks"/></xsl:message> --> |
125 | 130 |
|
126 | 131 | <xsl:for-each select="$sfblocks/marc:sfGroup">
|
127 | 132 | <xsl:variable name="sfgTag" select="@tag"/>
|
|
249 | 254 | </bf:status>
|
250 | 255 | </xsl:if>
|
251 | 256 |
|
252 |
| - <xsl:apply-templates |
253 |
| - select="$df/marc:sf[@code = '3'] | marc:df[@tag = '880']/marc:sf[@code = '3']" |
254 |
| - mode="subfield3"> |
255 |
| - <xsl:with-param name="serialization" select="$serialization"/> |
256 |
| - </xsl:apply-templates> |
| 257 | + <xsl:choose> |
| 258 | + <xsl:when test="$df/marc:sf[@code = '3']"> |
| 259 | + <xsl:apply-templates |
| 260 | + select="$df/marc:sf[@code = '3'][1]" |
| 261 | + mode="subfield3"> |
| 262 | + <xsl:with-param name="serialization" select="$serialization"/> |
| 263 | + </xsl:apply-templates> |
| 264 | + </xsl:when> |
| 265 | + <xsl:when test="marc:df[@tag = '880']/marc:sf[@code = '3']"> |
| 266 | + <xsl:apply-templates |
| 267 | + select="marc:df[@tag = '880']/marc:sf[@code = '3'][1]" |
| 268 | + mode="subfield3"> |
| 269 | + <xsl:with-param name="serialization" select="$serialization"/> |
| 270 | + </xsl:apply-templates> |
| 271 | + </xsl:when> |
| 272 | + </xsl:choose> |
257 | 273 | <xsl:for-each select="$df/marc:sf[@code = 'a']">
|
258 | 274 | <xsl:variable name="sfPos" select="@pos"/>
|
259 | 275 | <xsl:variable name="vLabel">
|
|
485 | 501 | </xsl:call-template>
|
486 | 502 | </xsl:variable>
|
487 | 503 | <xsl:variable name="parsedSfs" select="exsl:node-set($parsedSfs-prenodeset)"/>
|
| 504 | + <!-- <xsl:message><xsl:copy-of select="$parsedSfs"/></xsl:message> --> |
488 | 505 |
|
489 | 506 | <!-- Find the group numbers. -->
|
490 | 507 | <xsl:variable name="groups-prenodeset">
|
|
588 | 605 | <xsl:variable name="sf" select="$df/marc:subfield[$pos]"/>
|
589 | 606 |
|
590 | 607 | <xsl:choose>
|
| 608 | + <xsl:when test="$sf/@code = '3' or $sf/@code = '6'"> |
| 609 | + <marc:sf> |
| 610 | + <xsl:copy-of select="$sf/@*"/> |
| 611 | + <xsl:attribute name="gpos"> |
| 612 | + <xsl:value-of select="$gpos"/> |
| 613 | + </xsl:attribute> |
| 614 | + <xsl:attribute name="pos"> |
| 615 | + <xsl:value-of select="$pos"/> |
| 616 | + </xsl:attribute> |
| 617 | + <xsl:copy-of select="$sf/text()"/> |
| 618 | + </marc:sf> |
| 619 | + </xsl:when> |
591 | 620 | <xsl:when test="$df/@tag = '261' and ($sf/@code = 'a' or $sf/@code = 'b')">
|
592 | 621 | <xsl:variable name="map260sfs">
|
593 | 622 | <m sfCode="a">b</m>
|
|
656 | 685 | </marc:sf>
|
657 | 686 | </xsl:when>
|
658 | 687 | <xsl:when test="$sf/@code = 'a' or $sf/@code = 'b' or $sf/@code = 'c'">
|
659 |
| - <marc:sf> |
660 |
| - <xsl:copy-of select="$sf/@*"/> |
661 |
| - <xsl:attribute name="gpos"> |
662 |
| - <xsl:value-of select="$gpos"/> |
663 |
| - </xsl:attribute> |
664 |
| - <xsl:attribute name="pos"> |
665 |
| - <xsl:value-of select="$pos"/> |
666 |
| - </xsl:attribute> |
667 |
| - <xsl:copy-of select="$sf/text()"/> |
668 |
| - </marc:sf> |
669 |
| - </xsl:when> |
670 |
| - <xsl:when test="$sf/@code = 'e' or $sf/@code = 'f' or $sf/@code = 'g'"> |
671 |
| - <xsl:variable name="map260sfs"> |
672 |
| - <m sfCode="e">a</m> |
673 |
| - <m sfCode="f">b</m> |
674 |
| - <m sfCode="g">c</m> |
675 |
| - </xsl:variable> |
676 |
| - <marc:sf type="Manufacture"> |
677 |
| - <xsl:attribute name="code"> |
678 |
| - <xsl:value-of select="exsl:node-set($map260sfs)/m[@sfCode = $sf/@code]"/> |
679 |
| - </xsl:attribute> |
680 |
| - <xsl:attribute name="gpos"> |
681 |
| - <xsl:value-of select="$gpos"/> |
682 |
| - </xsl:attribute> |
683 |
| - <xsl:attribute name="pos"> |
684 |
| - <xsl:value-of select="$pos"/> |
685 |
| - </xsl:attribute> |
686 |
| - <xsl:copy-of select="$sf/text()"/> |
687 |
| - </marc:sf> |
688 |
| - </xsl:when> |
| 688 | + <marc:sf> |
| 689 | + <xsl:copy-of select="$sf/@*"/> |
| 690 | + <xsl:attribute name="gpos"> |
| 691 | + <xsl:value-of select="$gpos"/> |
| 692 | + </xsl:attribute> |
| 693 | + <xsl:attribute name="pos"> |
| 694 | + <xsl:value-of select="$pos"/> |
| 695 | + </xsl:attribute> |
| 696 | + <xsl:copy-of select="$sf/text()"/> |
| 697 | + </marc:sf> |
| 698 | + </xsl:when> |
| 699 | + <xsl:when test="$sf/@code = 'e' or $sf/@code = 'f' or $sf/@code = 'g'"> |
| 700 | + <xsl:variable name="map260sfs"> |
| 701 | + <m sfCode="e">a</m> |
| 702 | + <m sfCode="f">b</m> |
| 703 | + <m sfCode="g">c</m> |
| 704 | + </xsl:variable> |
| 705 | + <marc:sf type="Manufacture"> |
| 706 | + <xsl:attribute name="code"> |
| 707 | + <xsl:value-of select="exsl:node-set($map260sfs)/m[@sfCode = $sf/@code]"/> |
| 708 | + </xsl:attribute> |
| 709 | + <xsl:attribute name="gpos"> |
| 710 | + <xsl:value-of select="$gpos"/> |
| 711 | + </xsl:attribute> |
| 712 | + <xsl:attribute name="pos"> |
| 713 | + <xsl:value-of select="$pos"/> |
| 714 | + </xsl:attribute> |
| 715 | + <xsl:copy-of select="$sf/text()"/> |
| 716 | + </marc:sf> |
| 717 | + </xsl:when> |
689 | 718 | </xsl:choose>
|
690 | 719 |
|
691 | 720 | <xsl:variable name="next_gpos" select="$gpos + 1"/>
|
|
700 | 729 | <xsl:with-param name="pos" select="$next_pos"/>
|
701 | 730 | </xsl:call-template>
|
702 | 731 | </xsl:when>
|
| 732 | + <xsl:when |
| 733 | + test=" |
| 734 | + ($sf/@code = '6' and $df/marc:subfield[$next_pos][@code = '3' or @code = 'a']) |
| 735 | + or |
| 736 | + ($sf/@code = '3' and $df/marc:subfield[$next_pos][@code = 'a'])"> |
| 737 | + <xsl:call-template name="parse26x"> |
| 738 | + <xsl:with-param name="df" select="$df"/> |
| 739 | + <xsl:with-param name="gpos" select="$gpos"/> |
| 740 | + <xsl:with-param name="pos" select="$next_pos"/> |
| 741 | + </xsl:call-template> |
| 742 | + </xsl:when> |
703 | 743 | <xsl:when
|
704 | 744 | test="
|
705 | 745 | ($sf/@code = 'a' and $df/marc:subfield[$next_pos][@code = 'a'])
|
|
0 commit comments