+ <xslo:call-template name="chopPunctuation">
+ <xslo:with-param name="chopString">
+ <xslo:value-of select="."/>
+ </xslo:with-param>
+ </xslo:call-template>
+ </xslo:if>
+ </xslo:for-each>
+ </xslo:variable>
+ <xslo:value-of select="normalize-space($raw_heading)"/>
+ </z:index>
+ </xslo:template>
+ <xslo:template mode="index_match_heading" match="marc:datafield[@tag='500']">
+ <z:index name="Match:w Match:p">
+ <xslo:variable name="raw_heading">
+ <xslo:for-each select="marc:subfield">
+ <xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)" name="Match:w Match:p">
+ <xslo:if test="position() > 1">
+ <xslo:choose>
+ <xslo:when test="contains('vxyz', @code)">
+ <xslo:choose>
+ <xslo:when test="@code = $general_subdivision_subfield">
+ <xslo:text> generalsubdiv </xslo:text>
+ </xslo:when>
+ <xslo:when test="@code = $form_subdivision_subfield">
+ <xslo:text> formsubdiv </xslo:text>
+ </xslo:when>
+ <xslo:when test="@code = $chronological_subdivision_subfield">
+ <xslo:text> chronologicalsubdiv </xslo:text>
+ </xslo:when>
+ <xslo:when test="@code = $geographic_subdivision_subfield">
+ <xslo:text> geographicsubdiv </xslo:text>
+ </xslo:when>
+ </xslo:choose>
+ </xslo:when>
+ <xslo:otherwise>
+ <xslo:value-of select="substring(' ', 1, 1)"/>
+ </xslo:otherwise>
+ </xslo:choose>
+ </xslo:if>
+ <xslo:call-template name="chopPunctuation">
+ <xslo:with-param name="chopString">
+ <xslo:value-of select="."/>
+ </xslo:with-param>
+ </xslo:call-template>