Bug 13382 - RDA: 700/710/711 display in XSLT

Test Plan:
1) Apply this patch
2) Ensure you are using the default XSLT setting for the staff and opac record details
3) Find or create a record with MARC tags 700,710,711
4) Perform an opac search that would show the record in the search results.
5) Click title to review record.
6) Note the fields updates 700,710,711 to show subfields a, b, c, d, e, f, g, h, i, k, l, m, n, o, p, r, s, t, u, x. Multiple fields are separated by span class=separator |. Adds Related and Contained Works as new headings.
7) Repeat steps 4 - 6 for the staff interface

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Winona Salesky 2015-04-21 22:49:57 -04:00 committed by Tomas Cohen Arazi
parent 511587395f
commit cfacda2bb4
2 changed files with 284 additions and 36 deletions

View File

@ -144,8 +144,16 @@
</xsl:if>
<!-- Author Statement -->
<xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
<xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
<xsl:call-template name="showAuthor">
<xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/>
<xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
</xsl:call-template>
<!-- #13382 Suppress 700$i and 7xx/@ind2=2 -->
<xsl:call-template name="showAuthor">
<xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
<xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
</xsl:call-template>
<xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''">
<span class="results_summary type"><span class="label">Material type: </span>
@ -530,6 +538,91 @@
</span>
</xsl:if>
<!-- #13382 Added Related works 700$i -->
<xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
<span class="results_summary related_works"><span class="label">Related Works: </span>
<xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
<xsl:variable name="str">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$str"/>
</xsl:with-param>
</xsl:call-template>
<!-- add relator code too between brackets-->
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<span class="relatorcode">
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code='e']">
<xsl:for-each select="marc:subfield[@code='e']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="marc:subfield[@code='4']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</span>
</xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<!-- #13382 Added Contained Works 7xx@ind2=2 -->
<xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
<span class="results_summary contained_works"><span class="label">Contained Works: </span>
<xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
<xsl:variable name="str">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$str"/>
</xsl:with-param>
</xsl:call-template>
<!-- add relator code too between brackets-->
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<span class="relatorcode">
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code='e']">
<xsl:for-each select="marc:subfield[@code='e']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="marc:subfield[@code='4']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</span>
</xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
<span class="results_summary subjects"><span class="label">Subject(s): </span>
<xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
@ -1030,7 +1123,8 @@
<xsl:choose>
<xsl:when test="position()&gt;1"/>
<xsl:when test="@tag&lt;700">Author(s): </xsl:when>
<xsl:otherwise>Additional author(s): </xsl:otherwise>
<!--#13382 Changed Additional author to contributor -->
<xsl:otherwise>Contributor(s): </xsl:otherwise>
</xsl:choose>
<a>
<xsl:choose>
@ -1042,28 +1136,57 @@
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCQ"/></xsl:when>
<xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
<xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
<xsl:when test="@tag=100"><xsl:call-template name="nameABCQ"/></xsl:when>
<xsl:when test="@tag=110"><xsl:call-template name="nameABCDN"/></xsl:when>
<xsl:when test="@tag=111"><xsl:call-template name="nameACDEQ"/></xsl:when>
<!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
<!--#13382 Added all relevant subfields 4, e, are handled separately -->
<xsl:when test="@tag=700 or @tag=710 or @tag=711">
<xsl:variable name="str">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdfghiklmnoprstux</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$str"/>
</xsl:with-param>
<xsl:with-param name="punctuation">
<xsl:text>:,;/. </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<!-- add relator code too between brackets-->
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<span class="relatorcode">
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
<xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
<xsl:when test="marc:subfield[@code='e']">
<xsl:for-each select="marc:subfield[@code='e']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="marc:subfield[@code=4]">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</span>
</xsl:if>
</a>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</h5>
</xsl:if>
</xsl:if>
</xsl:template>
<!-- #1807 Strip unwanted parenthesis from subjects for searching -->

View File

@ -163,18 +163,20 @@
</xsl:call-template>
</h5>
</xsl:if>
<xsl:choose>
<xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]">
<h5 class="author">by
<xsl:call-template name="showAuthor">
<xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111 or @tag=700 or @tag=710 or @tag=711]"/>
<xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
<xsl:with-param name="materialTypeLabel" select="$materialTypeLabel"/>
<xsl:with-param name="theme" select="$theme"/>
</xsl:call-template>
</h5>
</xsl:when>
</xsl:choose>
<!--#13382 Added Author Statement to seperate Authors and Contributors -->
<xsl:call-template name="showAuthor">
<xsl:with-param name="authorfield" select="marc:datafield[(@tag=100 or @tag=110 or @tag=111)]"/>
<xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
<xsl:with-param name="materialTypeLabel" select="$materialTypeLabel"/>
<xsl:with-param name="theme" select="$theme"/>
</xsl:call-template>
<xsl:call-template name="showAuthor">
<!-- #13382 suppress 700$i and 7xx/@ind2=2 -->
<xsl:with-param name="authorfield" select="marc:datafield[(@tag=700 or @tag=710 or @tag=711) and not(@ind2=2) and not(marc:subfield[@code='i'])]"/>
<xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/>
</xsl:call-template>
<xsl:if test="$DisplayOPACiconsXSLT!='0'">
<xsl:if test="$materialTypeCode!=''">
@ -578,6 +580,91 @@
</span>
</xsl:if>
<!-- #13382 Added Related works 700$i -->
<xsl:if test="marc:datafield[@tag=700][marc:subfield[@code='i']] or marc:datafield[@tag=710][marc:subfield[@code='i']] or marc:datafield[@tag=711][marc:subfield[@code='i']]">
<span class="results_summary related_works"><span class="label">Related Works: </span>
<xsl:for-each select="marc:datafield[@tag=700][marc:subfield[@code='i']] | marc:datafield[@tag=710][marc:subfield[@code='i']] | marc:datafield[@tag=711][marc:subfield[@code='i']]">
<xsl:variable name="str">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$str"/>
</xsl:with-param>
</xsl:call-template>
<!-- add relator code too between brackets-->
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<span class="relatorcode">
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code='e']">
<xsl:for-each select="marc:subfield[@code='e']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="marc:subfield[@code='4']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</span>
</xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<!-- #13382 Added Contained Works 7xx@ind2=2 -->
<xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]">
<span class="results_summary contained_works"><span class="label">Contained Works: </span>
<xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]">
<xsl:variable name="str">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$str"/>
</xsl:with-param>
</xsl:call-template>
<!-- add relator code too between brackets-->
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<span class="relatorcode">
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code='e']">
<xsl:for-each select="marc:subfield[@code='e']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="marc:subfield[@code='4']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</span>
</xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6' and not(@tag=655)]">
<span class="results_summary subjects"><span class="label">Subject(s): </span>
<xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6'][not(@tag=655)]">
@ -1096,10 +1183,17 @@
<xsl:param name="UseAuthoritiesForTracings" />
<xsl:param name="materialTypeLabel" />
<xsl:param name="theme" />
<xsl:for-each select="$authorfield">
<xsl:choose><xsl:when test="position()!=1"><xsl:text>; </xsl:text></xsl:when></xsl:choose>
<xsl:if test="count($authorfield)&gt;0">
<h5 class="author">
<xsl:for-each select="$authorfield">
<xsl:choose>
<xsl:when test="position()&gt;1"/>
<xsl:when test="@tag&lt;700">Author(s): </xsl:when>
<!--#13382 Changed Additional author to contributor -->
<xsl:otherwise>Contributor(s): </xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="not(@tag=111 or @tag=711)" />
<xsl:when test="not(@tag=111) or @tag=700 or @tag=710 or @tag=711"/>
<xsl:when test="marc:subfield[@code='n']">
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
@ -1138,20 +1232,47 @@
</xsl:choose>
<span property="name">
<xsl:choose>
<xsl:when test="@tag=100 or @tag=700"><xsl:call-template name="nameABCQ"/></xsl:when>
<xsl:when test="@tag=110 or @tag=710"><xsl:call-template name="nameABCDN"/></xsl:when>
<xsl:when test="@tag=111 or @tag=711"><xsl:call-template name="nameACDEQ"/></xsl:when>
<xsl:when test="@tag=100"><xsl:call-template name="nameABCQ"/></xsl:when>
<xsl:when test="@tag=110"><xsl:call-template name="nameABCDN"/></xsl:when>
<xsl:when test="@tag=111"><xsl:call-template name="nameACDEQ"/></xsl:when>
<!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
<!--#13382 Added all relevant subfields 4, e, are handled separately -->
<xsl:when test="@tag=700 or @tag=710 or @tag=711">
<xsl:variable name="str">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcdfghiklmnoprstux</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="$str"/>
</xsl:with-param>
<xsl:with-param name="punctuation">
<xsl:text>:,;/. </xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</span></span></span>
<!-- add relator code too between brackets-->
<xsl:if test="marc:subfield[@code='4' or @code='e']">
<span class="relatorcode">
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
<xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
<xsl:text> [</xsl:text>
<xsl:choose>
<xsl:when test="marc:subfield[@code='e']">
<xsl:for-each select="marc:subfield[@code='e']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="marc:subfield[@code=4]">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:text>]</xsl:text>
</span>
</xsl:if>
</a>
@ -1167,7 +1288,11 @@
</a>
</xsl:if>
</xsl:for-each>
<xsl:text>.</xsl:text>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise>
</xsl:choose>
</h5>
</xsl:if>
</xsl:template>
<xsl:template name="nameABCQ">