+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">cdgnt</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </span>
+ </xsl:if>
+ <!-- Display dates for 100 and 700 fields -->
+ <xsl:if test="(@tag=100 or @tag=700) and marc:subfield[@code='d']">
+ <span class="authordates">
+ <xsl:text>, </xsl:text>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">d</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </span>
+ </xsl:if>
+ <!-- Display title portion for 100 and 700 fields -->
+ <xsl:if test="@tag=700 and marc:subfield[@code='t']">
+ <span class="titleportion">
+ <xsl:text>. </xsl:text>
+ <xsl:call-template name="chopPunctuation">
+ <xsl:with-param name="chopString">
+ <xsl:call-template name="subfieldSelect">
+ <xsl:with-param name="codes">t</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </span>
+ </xsl:if>
+ <!-- Display relators for 1XX and 7XX fields -->
+ <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
+ <span class="relatorcode">
+ <xsl:text> [</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@tag=111 or @tag=711">
+ <xsl:choose>
+ <!-- Prefer j over 4 for 111 and 711 -->
+ <xsl:when test="marc:subfield[@code='j']">
+ <xsl:for-each select="marc:subfield[@code='j']">
+ <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:when>
+ <!-- Prefer e over 4 on 100 and 110 -->
+ <xsl:when test="marc:subfield[@code='e']">
+ <xsl:for-each select="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]">
+ <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>