INSERT INTO config.xml_transform VALUES ( 'marc21expand880', 'http://www.loc.gov/MARC21/slim', 'marc', '' );
-- Index Definitions
-INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, facet_field, authority_xpath ) VALUES
- (1, 'series', 'seriestitle', oils_i18n_gettext(1, 'Series Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo$$, TRUE, '//@xlink:href' );
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, facet_field, authority_xpath, browse_xpath ) VALUES
+ (1, 'series', 'seriestitle', oils_i18n_gettext(1, 'Series Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo[@type="nfi"]$$, TRUE, '//@xlink:href', $$//*/*[local-name() != "nonSort"]$$ ); -- vim */
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath ) VALUES
(2, 'title', 'abbreviated', oils_i18n_gettext(2, 'Abbreviated Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='abbreviated')]$$, '//@xlink:href' );
-INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath ) VALUES
- (3, 'title', 'translated', oils_i18n_gettext(3, 'Translated Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='translated')]$$, '//@xlink:href' );
-INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath ) VALUES
- (4, 'title', 'alternative', oils_i18n_gettext(4, 'Alternate Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='alternative')]$$, '//@xlink:href' );
-INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath ) VALUES
- (5, 'title', 'uniform', oils_i18n_gettext(5, 'Uniform Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='uniform')]$$, '//@xlink:href' );
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath, browse_xpath ) VALUES
+ (3, 'title', 'translated', oils_i18n_gettext(3, 'Translated Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='translated-nfi')]$$, '//@xlink:href', $$//*/*[local-name() != "nonSort"]$$ ); -- vim */
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath, browse_xpath ) VALUES
+ (4, 'title', 'alternative', oils_i18n_gettext(4, 'Alternate Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='alternative-nfi')]$$, '//@xlink:href', $$//*/*[local-name() != "nonSort"]$$ ); -- vim */
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath, browse_xpath ) VALUES
+ (5, 'title', 'uniform', oils_i18n_gettext(5, 'Uniform Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='uniform-nfi')]$$, '//@xlink:href', $$//*/*[local-name() != "nonSort"]$$ ); -- vim */
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, authority_xpath, browse_field ) VALUES
(6, 'title', 'proper', oils_i18n_gettext(6, 'Title Proper', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:titleNonfiling[mods32:title and not (@type)]$$, '//@xlink:href', FALSE );
</titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='242']">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <!-- 1/04 removed $h, b -->
+ <xsl:with-param name="codes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo type="translated">
<!--09/01/04 Added subfield $y-->
<xsl:for-each select="marc:subfield[@code='y']">
</xsl:attribute>
</xsl:for-each>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <!-- 1/04 removed $h, b -->
- <xsl:with-param name="codes">a</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<!-- 1/04 fix -->
<xsl:call-template name="subtitle"/>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="translated-nfi">
+ <xsl:for-each select="marc:subfield[@code='y']">
+ <xsl:attribute name="lang">
+ <xsl:value-of select="text()"/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="subtitle"/>
+ <xsl:call-template name="part"/>
+ </titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='246']">
<titleInfo type="alternative">
</titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='130']|marc:datafield[@tag='240']|marc:datafield[@tag='730'][@ind2!='2']">
+ <xsl:variable name="nfi">
+ <xsl:choose>
+ <xsl:when test="@tag='240'">
+ <xsl:value-of select="@ind2"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@ind1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="uri" />
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <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'])))">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo type="uniform">
<title>
- <xsl:call-template name="uri" />
- <xsl:variable name="str">
- <xsl:for-each select="marc:subfield">
- <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'])))">
- <xsl:value-of select="text()"/>
- <xsl:text> </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop"/>
</title>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="uniform-nfi">
+ <xsl:choose>
+ <xsl:when test="$nfi>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,$nfi)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,$nfi+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop"/>
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"/>
+ </titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='740'][@ind2!='2']">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ah</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo type="alternative">
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">ah</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="alternative-nfi">
+ <xsl:choose>
+ <xsl:when test="@ind1>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind1)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind1+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"/>
+ </titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='100']">
<name type="personal">
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=440]">
<relatedItem type="series">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">av</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">av</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"></xsl:call-template>
</titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ <xsl:call-template name="part"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"></xsl:call-template>
+ </titleInfo>
</relatedItem>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
<xsl:for-each select="marc:datafield[@tag=740][@ind2=2]">
<relatedItem>
<xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"></xsl:call-template>
</titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind1>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind1)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind1+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"></xsl:call-template>
+ </titleInfo>
<xsl:call-template name="relatedForm"></xsl:call-template>
</relatedItem>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='830']">
<relatedItem type="series">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"/>
+ </titleInfo>
<xsl:call-template name="relatedForm"/>
</relatedItem>
</xsl:for-each>
<xsl:template match="marc:datafield[@tag=630]">
<subject>
<xsl:call-template name="subjectAuthority"></xsl:call-template>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfhklor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">adfhklor</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="part"></xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
+ <xsl:call-template name="part"></xsl:call-template>
+ </titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind1>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind1)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind1+1)"/>
+ </title>
+ <xsl:call-template name="part"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"></xsl:call-template>
</titleInfo>
<xsl:call-template name="subjectAnyOrder"></xsl:call-template>
</subject>
field_class IN ('subject','series','title','author') AND
browse_field IS TRUE;
-INSERT INTO config.metabib_field (
- id, field_class, name, label, xpath, format,
- search_field, facet_field, browse_field
-) VALUES (
- 31, 'title', 'browse',
- oils_i18n_gettext(31, 'Title Proper (Browse)', 'cmf', 'label'),
- $$//mods32:mods/mods32:titleInfo[not (@type)]/mods32:title$$,
- 'mods32', FALSE, FALSE, TRUE
-);
+-- INSERT INTO config.metabib_field (
+-- id, field_class, name, label, xpath, format,
+-- search_field, facet_field, browse_field
+-- ) VALUES (
+-- 31, 'title', 'browse',
+-- oils_i18n_gettext(31, 'Title Proper (Browse)', 'cmf', 'label'),
+-- $$//mods32:mods/mods32:titleInfo[not (@type)]/mods32:title$$,
+-- 'mods32', FALSE, FALSE, TRUE
+-- );
ALTER TYPE metabib.field_entry_template ADD ATTRIBUTE authority BIGINT;
</titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='242']">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <!-- 1/04 removed $h, b -->
+ <xsl:with-param name="codes">a</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo type="translated">
<!--09/01/04 Added subfield $y-->
<xsl:for-each select="marc:subfield[@code='y']">
</xsl:attribute>
</xsl:for-each>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <!-- 1/04 removed $h, b -->
- <xsl:with-param name="codes">a</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<!-- 1/04 fix -->
<xsl:call-template name="subtitle"/>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="translated-nfi">
+ <xsl:for-each select="marc:subfield[@code='y']">
+ <xsl:attribute name="lang">
+ <xsl:value-of select="text()"/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="subtitle"/>
+ <xsl:call-template name="part"/>
+ </titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='246']">
<titleInfo type="alternative">
</titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='130']|marc:datafield[@tag='240']|marc:datafield[@tag='730'][@ind2!='2']">
+ <xsl:variable name="nfi">
+ <xsl:choose>
+ <xsl:when test="@tag='240'">
+ <xsl:value-of select="@ind2"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@ind1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="uri" />
+ <xsl:variable name="str">
+ <xsl:for-each select="marc:subfield">
+ <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'])))">
+ <xsl:value-of select="text()"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo type="uniform">
<title>
- <xsl:call-template name="uri" />
- <xsl:variable name="str">
- <xsl:for-each select="marc:subfield">
- <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'])))">
- <xsl:value-of select="text()"/>
- <xsl:text> </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:value-of select="substring($str,1,string-length($str)-1)"/>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop"/>
</title>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="uniform-nfi">
+ <xsl:choose>
+ <xsl:when test="$nfi>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,$nfi)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,$nfi+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop"/>
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"/>
+ </titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='740'][@ind2!='2']">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">ah</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo type="alternative">
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">ah</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="alternative-nfi">
+ <xsl:choose>
+ <xsl:when test="@ind1>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind1)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind1+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"/>
+ </titleInfo>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='100']">
<name type="personal">
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=440]">
<relatedItem type="series">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">av</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">av</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"></xsl:call-template>
</titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ <xsl:call-template name="part"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"></xsl:call-template>
+ </titleInfo>
</relatedItem>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag=490][@ind1=0]">
<xsl:for-each select="marc:datafield[@tag=740][@ind2=2]">
<relatedItem>
<xsl:call-template name="constituentOrRelatedType"></xsl:call-template>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:value-of select="marc:subfield[@code='a']"></xsl:value-of>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"></xsl:call-template>
</titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind1>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind1)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind1+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"></xsl:call-template>
+ </titleInfo>
<xsl:call-template name="relatedForm"></xsl:call-template>
</relatedItem>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="marc:datafield[@tag='830']">
<relatedItem type="series">
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">adfgklmorsv</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
<xsl:call-template name="part"/>
</titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind2>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind2)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind2+1)"/>
+ </title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"/>
+ </titleInfo>
<xsl:call-template name="relatedForm"/>
</relatedItem>
</xsl:for-each>
<xsl:template match="marc:datafield[@tag=630]">
<subject>
<xsl:call-template name="subjectAuthority"></xsl:call-template>
+ <xsl:variable name="titleChop">
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">adfhklor</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<titleInfo>
<title>
- <xsl:call-template name="chopPunctuation">
- <xsl:with-param name="chopString">
- <xsl:call-template name="subfieldSelect">
- <xsl:with-param name="codes">adfhklor</xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="part"></xsl:call-template>
+ <xsl:value-of select="$titleChop" />
</title>
+ <xsl:call-template name="part"></xsl:call-template>
+ </titleInfo>
+ <titleInfo type="nfi">
+ <xsl:choose>
+ <xsl:when test="@ind1>0">
+ <nonSort>
+ <xsl:value-of select="substring($titleChop,1,@ind1)"/>
+ </nonSort>
+ <title>
+ <xsl:value-of select="substring($titleChop,@ind1+1)"/>
+ </title>
+ <xsl:call-template name="part"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>
+ <xsl:value-of select="$titleChop" />
+ </title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="part"></xsl:call-template>
</titleInfo>
<xsl:call-template name="subjectAnyOrder"></xsl:call-template>
</subject>
END;
$p$ LANGUAGE PLPGSQL;
+UPDATE config.metabib_field
+SET
+ xpath = $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo[@type="nfi"]$$,
+ browse_xpath = $$//*/*[local-name() != "nonSort"]$$ -- vim highlighting */
+WHERE
+ field_class = 'series' AND name = 'seriestitle' ;
+
+UPDATE config.metabib_field
+SET
+ xpath = $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='alternative-nfi')]$$,
+ browse_xpath = $$//*/*[local-name() != "nonSort"]$$ -- vim highlighting */
+WHERE
+ field_class = 'title' AND name = 'alternative' ;
+
+UPDATE config.metabib_field
+SET
+ xpath = $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='uniform-nfi')]$$,
+ browse_xpath = $$//*/*[local-name() != "nonSort"]$$ -- vim highlighting */
+WHERE
+ field_class = 'title' AND name = 'uniform' ;
+
+UPDATE config.metabib_field
+SET
+ xpath = $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='translated-nfi')]$$,
+ browse_xpath = $$//*/*[local-name() != "nonSort"]$$ -- vim highlighting */
+WHERE
+ field_class = 'title' AND name = 'translated' ;
+
COMMIT;