|
105 | 105 | </df> |
106 | 106 |
|
107 | 107 | <df tag="016"> |
108 | | - <context xpath="bf:Instance/bf:identifiedBy/bf:Local[bf:source/bf:Source]|bf:Instance/bf:adminMetadata/bf:AdminMetadata/bf:identifiedBy/bf:Local[bf:source//@rdf:*[.='http://id.loc.gov/authorities/names/no2004037399']]"> |
| 108 | + <context xpath="bf:Instance/bf:identifiedBy/bf:Local[bf:source]|bf:Instance/bf:adminMetadata/bf:AdminMetadata/bf:identifiedBy/bf:Local[bf:source//@rdf:*[.='http://id.loc.gov/authorities/names/no2004037399']]"> |
109 | 109 | <var name="vSourceUri"> |
110 | 110 | <switch> |
111 | 111 | <case test="bf:source/@rdf:resource"><transform><xsl:value-of select="bf:source/@rdf:resource"/></transform></case> |
|
146 | 146 | <switch> |
147 | 147 | <case test="contains($vSourceUri,'id.loc.gov')"> |
148 | 148 | <transform> |
149 | | - <xsl:call-template name="tUriCode"> |
150 | | - <xsl:with-param name="pUri" select="$vSourceUri"/> |
151 | | - </xsl:call-template> |
| 149 | + <xsl:variable name="vC"> |
| 150 | + <xsl:call-template name="tUriCode"> |
| 151 | + <xsl:with-param name="pUri" select="$vSourceUri"/> |
| 152 | + </xsl:call-template> |
| 153 | + </xsl:variable> |
| 154 | + <xsl:value-of select="translate($vC, $lower, $upper)" /> |
152 | 155 | </transform> |
153 | 156 | </case> |
154 | 157 | <case test="default"><transform><xsl:value-of select="$vSourceUri"/></transform></case> |
|
175 | 178 | <sf code="a"><select xpath="rdf:value"/></sf> |
176 | 179 | </case> |
177 | 180 | </switch> |
178 | | - <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:Agent/rdfs:label"/></sf> |
| 181 | + <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:*/rdfs:label"/></sf> |
179 | 182 | <sf code="d" chopPunct="true" repeatable="false"><select xpath="bf:date"/></sf> |
180 | 183 | <sf code="i" chopPunct="true" repeatable="false"><select xpath="bf:note/bf:Note/rdfs:label"/></sf> |
181 | 184 | </context> |
|
404 | 407 | </ind1> |
405 | 408 | <ind2 default="2"/> |
406 | 409 | <sf code="a" repeatable="false"><select xpath="rdf:value"/></sf> |
407 | | - <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:Agent/rdfs:label"/></sf> |
| 410 | + <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:*/rdfs:label"/></sf> |
408 | 411 | <sf code="q" chopPunct="true"><select xpath="bf:qualifier"/></sf> |
409 | 412 | </context> |
410 | 413 | </df> |
|
433 | 436 | <ind1 default=" "/> |
434 | 437 | <ind2 default=" "/> |
435 | 438 | <sf code="a" repeatable="false"><select xpath="rdf:value"/></sf> |
436 | | - <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:Agent/rdfs:label"/></sf> |
| 439 | + <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:*/rdfs:label"/></sf> |
437 | 440 | </context> |
438 | 441 | </df> |
439 | 442 |
|
|
730 | 733 | <ind1 default=" "/> |
731 | 734 | <ind2 default=" "/> |
732 | 735 | <sf code="a" repeatable="false"><select xpath="rdf:value"/></sf> |
733 | | - <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:Agent/rdfs:label"/></sf> |
| 736 | + <sf code="b" chopPunct="true" repeatable="false"><select xpath="bf:assigner/bf:*/rdfs:label"/></sf> |
734 | 737 | </context> |
735 | 738 | </df> |
736 | 739 |
|
|
1416 | 1419 | </df> |
1417 | 1420 | </case> |
1418 | 1421 | </switch> |
1419 | | - <switch> |
1420 | | - <case test="bf:Work/bf:language//@rdf:*[(local-name='resource' or local-name='about') and not(contains(., 'id.loc.gov/vocabulary/languages'))] or bf:Work/bf:language/*/bf:source"> |
| 1422 | + |
| 1423 | + <switch> |
| 1424 | + <case test=" |
| 1425 | + bf:Work/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')] or |
| 1426 | + bf:Work/bf:language/*/bf:source or |
| 1427 | + bf:Work/bf:accompaniedBy/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')] or |
| 1428 | + bf:Work/bf:note/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')] |
| 1429 | + "> |
1421 | 1430 | <df tag="041"> |
1422 | 1431 | <ind1 default="0"> |
1423 | 1432 | <switch> |
1424 | 1433 | <case test="bf:Work/bf:note/bf:Note[rdfs:label='Includes translation or is translation']">1</case> |
1425 | 1434 | <case test="bf:Work/bf:note/bf:Note[rdfs:label='Includes translation']">1</case> |
1426 | 1435 | </switch> |
1427 | 1436 | </ind1> |
1428 | | - <ind2 default=" "/> |
| 1437 | + <ind2 default="7"/> |
1429 | 1438 | <!-- making dubious assertion that first language property is primary --> |
1430 | 1439 | <transform> |
1431 | | - <xsl:variable name="vLangElements" select="bf:Work/bf:language/@rdf:resource[not(contains(., 'id.loc.gov/vocabulary/languages'))] | |
1432 | | - bf:Work/bf:language/bf:Language[bf:source and not(bf:part)]//@rdf:about[not(contains(., 'id.loc.gov/vocabulary/languages'))] | |
| 1440 | + <xsl:variable name="vLangElements" select=" |
| 1441 | + bf:Work/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')] | |
| 1442 | + bf:Work/bf:language/bf:Language[bf:source and not(bf:part)]//@rdf:about[not(contains(., 'id.loc.gov/vocabulary/'))] | |
1433 | 1443 | bf:Work/bf:language/bf:Language[bf:source] | |
1434 | 1444 | bf:Work/bf:language/bf:Language[bf:source and bf:part]"/> |
1435 | 1445 | <xsl:variable name="vFirstLangCode"> |
|
1440 | 1450 | <xsl:when test="starts-with($vLangElements[1],'http://id.loc.gov/vocabulary/iso639-2/')"> |
1441 | 1451 | <xsl:value-of select="substring-after($vLangElements[1],'http://id.loc.gov/vocabulary/iso639-2/')"/> |
1442 | 1452 | </xsl:when> |
| 1453 | + <xsl:when test="starts-with($vLangElements[1],'http://id.loc.gov/vocabulary/iso639-3/')"> |
| 1454 | + <xsl:value-of select="substring-after($vLangElements[1],'http://id.loc.gov/vocabulary/iso639-3/')"/> |
| 1455 | + </xsl:when> |
1443 | 1456 | <xsl:when test="starts-with($vLangElements[1],'http://id.loc.gov/vocabulary/iso639-5/')"> |
1444 | 1457 | <xsl:value-of select="substring-after($vLangElements[1],'http://id.loc.gov/vocabulary/iso639-5/')"/> |
1445 | 1458 | </xsl:when> |
|
1460 | 1473 | </xsl:variable> |
1461 | 1474 |
|
1462 | 1475 | <xsl:for-each select="$vLangElements| |
1463 | | - bf:Work/bf:accompaniedBy/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[not(contains(., 'id.loc.gov/vocabulary/languages'))][1] | |
1464 | | - bf:Work/bf:note/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[not(contains(., 'id.loc.gov/vocabulary/languages'))][1]"> |
| 1476 | + bf:Work/bf:accompaniedBy/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')][1] | |
| 1477 | + bf:Work/bf:note/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')][1]"> |
1465 | 1478 | <xsl:choose> |
1466 | | - <xsl:when test="position() = 1"> |
| 1479 | + <xsl:when test="position() = 1 and $vFirstLangCode!=''"> |
1467 | 1480 | <marc:subfield code="a"><xsl:value-of select="$vFirstLangCode"/></marc:subfield> |
1468 | 1481 | </xsl:when> |
1469 | 1482 | <xsl:otherwise> |
|
1475 | 1488 | <xsl:when test="starts-with(.,'http://id.loc.gov/vocabulary/iso639-2/')"> |
1476 | 1489 | <xsl:value-of select="substring-after(.,'http://id.loc.gov/vocabulary/iso639-2/')"/> |
1477 | 1490 | </xsl:when> |
| 1491 | + <xsl:when test="starts-with(.,'http://id.loc.gov/vocabulary/iso639-3/')"> |
| 1492 | + <xsl:value-of select="substring-after(.,'http://id.loc.gov/vocabulary/iso639-3/')"/> |
| 1493 | + </xsl:when> |
1478 | 1494 | <xsl:when test="starts-with(.,'http://id.loc.gov/vocabulary/iso639-5/')"> |
1479 | 1495 | <xsl:value-of select="substring-after(.,'http://id.loc.gov/vocabulary/iso639-5/')"/> |
1480 | 1496 | </xsl:when> |
|
1538 | 1554 | </xsl:for-each> |
1539 | 1555 | </transform> |
1540 | 1556 |
|
1541 | | - <var name="vSourceLang" xpath="bf:Work/bf:language/@rdf:resource[not(contains(., 'id.loc.gov/vocabulary/languages'))]| |
1542 | | - bf:Work/bf:language/bf:Language[bf:source//@rdf:*[not(contains(., 'id.loc.gov/vocabulary/languages'))]]| |
| 1557 | + <var name="vSourceLang" xpath="bf:Work/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')]| |
| 1558 | + bf:Work/bf:accompaniedBy/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')] | |
| 1559 | + bf:Work/bf:note/bf:*[contains(rdf:type/@rdf:resource, 'id.loc.gov/vocabulary/resourceComponents')]/bf:language//@rdf:*[contains(., 'id.loc.gov/vocabulary/iso639-')] | |
| 1560 | + bf:Work/bf:language/bf:Language[bf:source//@rdf:*[not(contains(., 'id.loc.gov/vocabulary/'))]]| |
1543 | 1561 | bf:Work/bf:language/bf:Language[bf:source]" /> |
1544 | 1562 | <var name="vSourceUri"> |
1545 | 1563 | <switch> |
| 1564 | + <case test="contains($vSourceLang[1], 'id.loc.gov/vocabulary/iso639-')"><transform><xsl:value-of select="$vSourceLang[1]"/></transform></case> |
1546 | 1565 | <case test="$vSourceLang[1]/bf:source/@rdf:resource"><transform><xsl:value-of select="$vSourceLang[1]/bf:source/@rdf:resource"/></transform></case> |
1547 | 1566 | <case test="$vSourceLang[1]/bf:source/bf:Source/@rdf:about"><transform><xsl:value-of select="$vSourceLang[1]/bf:source/bf:Source/@rdf:about"/></transform></case> |
1548 | 1567 | </switch> |
1549 | 1568 | </var> |
1550 | 1569 | <transform> |
1551 | 1570 | <marc:subfield code="2"> |
1552 | 1571 | <xsl:choose> |
| 1572 | + <xsl:when test="$vSourceUri != ''"> |
| 1573 | + <xsl:choose> |
| 1574 | + <xsl:when test="contains($vSourceUri,'id.loc.gov/vocabulary/iso639-1')">iso639-1</xsl:when> |
| 1575 | + <xsl:when test="contains($vSourceUri,'id.loc.gov/vocabulary/iso639-2')">iso639-2</xsl:when> |
| 1576 | + <xsl:when test="contains($vSourceUri,'id.loc.gov/vocabulary/iso639-3')">iso639-3</xsl:when> |
| 1577 | + </xsl:choose> |
| 1578 | + </xsl:when> |
1553 | 1579 | <xsl:when test="$vSourceLang[1]/bf:source/bf:Source/*[local-name()='code']"> |
1554 | 1580 | <xsl:value-of select="$vSourceLang[1]/bf:source/bf:Source/*[local-name()='code']"/> |
1555 | 1581 | </xsl:when> |
1556 | 1582 | <xsl:when test="$vSourceLang[1]/bf:source/madsrdf:Authority/*[local-name()='code']"> |
1557 | 1583 | <xsl:value-of select="$vSourceLang[1]/bf:source/madsrdf:Authority/*[local-name()='code']"/> |
1558 | 1584 | </xsl:when> |
1559 | | - <xsl:when test="$vSourceUri != ''"> |
1560 | | - <xsl:choose> |
1561 | | - <xsl:when test="contains($vSourceUri,'id.loc.gov')"> |
1562 | | - <xsl:call-template name="tUriCode"> |
1563 | | - <xsl:with-param name="pUri" select="$vSourceUri"/> |
1564 | | - </xsl:call-template> |
1565 | | - </xsl:when> |
1566 | | - <xsl:otherwise><xsl:value-of select="$vSourceUri"/></xsl:otherwise> |
1567 | | - </xsl:choose> |
1568 | | - </xsl:when> |
1569 | 1585 | <xsl:otherwise> |
1570 | 1586 | <xsl:call-template name="tChopPunct"> |
1571 | 1587 | <xsl:with-param name="pString" select="$vSourceLang[1]/bf:source/bf:Source/rdfs:label"/> |
|
2029 | 2045 | </case> |
2030 | 2046 | </switch> |
2031 | 2047 |
|
2032 | | - <df tag="046"> |
2033 | | - <context xpath="bf:Work/bf:originDate[@rdf:datatype='http://id.loc.gov/datatypes/edtf']"> |
2034 | | - <ind1 default=" "/> |
2035 | | - <ind2 default=" "/> |
| 2048 | + <select xpath="bf:Work/bf:originDate[@rdf:datatype='http://id.loc.gov/datatypes/edtf']"> |
| 2049 | + <var name="vCF008PreNS"> |
| 2050 | + <transform> |
| 2051 | + <xsl:apply-templates select="ancestor::rdf:RDF" mode="generate-008"> |
| 2052 | + <xsl:with-param name="vAdminMetadata" select="$vAdminMetadata"/> |
| 2053 | + </xsl:apply-templates> |
| 2054 | + </transform> |
| 2055 | + </var> |
| 2056 | + <var name="vCF008" xpath="exsl:node-set($vCF008PreNS)" /> |
| 2057 | + <var name="vDateType"> |
| 2058 | + <transform> |
| 2059 | + <xsl:value-of select="substring($vCF008, 7, 1)" /> |
| 2060 | + </transform> |
| 2061 | + </var> |
2036 | 2062 | <var name="v046DateTime1"> |
2037 | 2063 | <transform> |
2038 | 2064 | <xsl:call-template name="EDTF-Date1"> |
|
2061 | 2087 | </xsl:call-template> |
2062 | 2088 | </transform> |
2063 | 2089 | </var> |
2064 | | - <sf code="k"> |
2065 | | - <transform> |
2066 | | - <xsl:value-of select="concat(translate($v046Date1,'-',''),translate($v046Time1,':',''))"/> |
2067 | | - </transform> |
2068 | | - </sf> |
2069 | 2090 | <switch> |
2070 | | - <case test="$v046DateTime2"> |
2071 | | - <sf code="l"> |
2072 | | - <transform> |
2073 | | - <xsl:variable name="v046Date2"> |
2074 | | - <xsl:call-template name="EDTF-DatePart"> |
2075 | | - <xsl:with-param name="pEDTFDate" select="$v046DateTime2"/> |
2076 | | - </xsl:call-template> |
2077 | | - </xsl:variable> |
2078 | | - <xsl:variable name="v046Time2"> |
2079 | | - <xsl:call-template name="EDTF-TimePart"> |
2080 | | - <xsl:with-param name="pEDTFDate" select="$v046DateTime2"/> |
2081 | | - </xsl:call-template> |
2082 | | - </xsl:variable> |
2083 | | - <xsl:value-of select="concat(translate($v046Date2,'-',''),translate($v046Time2,':',''))"/> |
2084 | | - </transform> |
2085 | | - </sf> |
| 2091 | + <case test="$vDateType != 'r'"> |
| 2092 | + <df tag="046"> |
| 2093 | + <ind1 default=" "/> |
| 2094 | + <ind2 default=" "/> |
| 2095 | + <sf code="k"> |
| 2096 | + <transform> |
| 2097 | + <xsl:value-of select="concat(translate($v046Date1,'-',''),translate($v046Time1,':',''))"/> |
| 2098 | + </transform> |
| 2099 | + </sf> |
| 2100 | + <switch> |
| 2101 | + <case test="$v046DateTime2"> |
| 2102 | + <sf code="l"> |
| 2103 | + <transform> |
| 2104 | + <xsl:variable name="v046Date2"> |
| 2105 | + <xsl:call-template name="EDTF-DatePart"> |
| 2106 | + <xsl:with-param name="pEDTFDate" select="$v046DateTime2"/> |
| 2107 | + </xsl:call-template> |
| 2108 | + </xsl:variable> |
| 2109 | + <xsl:variable name="v046Time2"> |
| 2110 | + <xsl:call-template name="EDTF-TimePart"> |
| 2111 | + <xsl:with-param name="pEDTFDate" select="$v046DateTime2"/> |
| 2112 | + </xsl:call-template> |
| 2113 | + </xsl:variable> |
| 2114 | + <xsl:value-of select="concat(translate($v046Date2,'-',''),translate($v046Time2,':',''))"/> |
| 2115 | + </transform> |
| 2116 | + </sf> |
| 2117 | + </case> |
| 2118 | + </switch> |
| 2119 | + <sf code="2"><transform><xsl:value-of select="'edtf'" /></transform></sf> |
| 2120 | + </df> |
2086 | 2121 | </case> |
2087 | 2122 | </switch> |
2088 | | - </context> |
2089 | | - </df> |
| 2123 | + </select> |
2090 | 2124 |
|
2091 | 2125 | <switch> |
2092 | 2126 | <case test="bf:Work/bf:instrument/bf:MusicInstrument or |
|
0 commit comments