<target_index>Title-cover:s</target_index>
<target_index>Title:w</target_index>
<target_index>Title:p</target_index>
- <target_index>Title:s</target_index>
</index_subfields>
<!--record.abs line 114: melm 245$c Author,Author-in-order:w,Author-in-order:p,Author-in-order:s-->
<index_subfields tag="245" subfields="c">
<xslo:template match="text()" mode="index_heading_conditional"/>
<xslo:template match="text()" mode="index_match_heading"/>
<xslo:template match="text()" mode="index_subject_thesaurus"/>
+ <xslo:template match="text()" mode="index_sort_tit"/>
<xslo:template match="/">
<xslo:if test="marc:collection">
<collection>
<xslo:apply-templates mode="index_match_heading"/>
<xslo:apply-templates mode="index_subject_thesaurus"/>
<xslo:apply-templates mode="index_all"/>
+ <xslo:apply-templates mode="index_sort_tit"/>
</z:record>
</xslo:template>
<xslo:template match="marc:leader">
<xslo:template mode="index_subfields" match="marc:datafield[@tag='245']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('a', @code)">
- <z:index name="Title-cover:w Title-cover:p Title-cover:s Title:w Title:p Title:s">
+ <z:index name="Title-cover:w Title-cover:p Title-cover:s Title:w Title:p">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:value-of select="."/>
</z:index>
</xslo:template>
+ <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
+ <xslo:variable name="chop">
+ <xslo:choose>
+ <xslo:when test="not(number(@ind2))">0</xslo:when>
+ <xslo:otherwise>
+ <xslo:value-of select="number(@ind2)"/>
+ </xslo:otherwise>
+ </xslo:choose>
+ </xslo:variable>
+ <z:index name="Title:s">
+ <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
+ </z:index>
+ </xslo:template>
<xslo:template name="chopPunctuation">
<xslo:param name="chopString"/>
<xslo:variable name="length" select="string-length($chopString)"/>
<xslo:template match="text()" mode="index_heading_conditional"/>
<xslo:template match="text()" mode="index_match_heading"/>
<xslo:template match="text()" mode="index_subject_thesaurus"/>
+ <xslo:template match="text()" mode="index_sort_tit"/>
<xslo:template match="/">
<xslo:if test="marc:collection">
<collection>
<xslo:apply-templates mode="index_match_heading"/>
<xslo:apply-templates mode="index_subject_thesaurus"/>
<xslo:apply-templates mode="index_all"/>
+ <xslo:apply-templates mode="index_sort_tit"/>
</z:record>
</xslo:template>
<xslo:value-of select="."/>
</z:index>
</xslo:template>
+ <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
+ <xslo:variable name="chop">
+ <xslo:choose>
+ <xslo:when test="not(number(@ind2))">0</xslo:when>
+ <xslo:otherwise><xslo:value-of select="number(@ind2)"/></xslo:otherwise>
+ </xslo:choose>
+ </xslo:variable>
+ <z:index name="Title:s">
+ <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
+ </z:index>
+ </xslo:template>
<xslo:template name="chopPunctuation">
<xslo:param name="chopString"/>
<xslo:variable name="length" select="string-length($chopString)"/>