View | Details | Raw Unified | Return to bug 18540
Collapse All | Expand All

(-)a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml (+3 lines)
Lines 397-402 Link Here
397
    <target_index>Title-collective:w</target_index>
397
    <target_index>Title-collective:w</target_index>
398
  </index_data_field>
398
  </index_data_field>
399
  <!--record.abs line 113: melm 245$a      Title-cover:w,Title-cover:p,Title-cover:s,Title:w,Title:p,Title:s-->
399
  <!--record.abs line 113: melm 245$a      Title-cover:w,Title-cover:p,Title-cover:s,Title:w,Title:p,Title:s-->
400
  <index_sort_title tag="245" subfields="a">
401
    <target_index>Title:s</target_index>
402
  </index_sort_title>
400
  <index_subfields tag="245" subfields="a">
403
  <index_subfields tag="245" subfields="a">
401
    <target_index>Title-cover:w</target_index>
404
    <target_index>Title-cover:w</target_index>
402
    <target_index>Title-cover:p</target_index>
405
    <target_index>Title-cover:p</target_index>
(-)a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl (-14 / +29 lines)
Lines 19-24 Link Here
19
    <xsl:key name="index_data_field_tag"    match="kohaidx:index_data_field"    use="@tag"/>
19
    <xsl:key name="index_data_field_tag"    match="kohaidx:index_data_field"    use="@tag"/>
20
    <xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
20
    <xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
21
    <xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
21
    <xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
22
    <xsl:key name="index_sort_title_tag"          match="kohaidx:index_sort_title" use="@tag"/>
22
23
23
    <xsl:template match="kohaidx:index_defs">
24
    <xsl:template match="kohaidx:index_defs">
24
    <xsl:comment>
25
    <xsl:comment>
Lines 39-45 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
39
            <xslo:template match="text()" mode="index_heading_conditional"/>
40
            <xslo:template match="text()" mode="index_heading_conditional"/>
40
            <xslo:template match="text()" mode="index_match_heading"/>
41
            <xslo:template match="text()" mode="index_match_heading"/>
41
            <xslo:template match="text()" mode="index_subject_thesaurus"/>
42
            <xslo:template match="text()" mode="index_subject_thesaurus"/>
42
            <xslo:template match="text()" mode="index_sort_tit"/>
43
            <xslo:template match="text()" mode="index_sort_title"/>
43
            <xslo:template match="/">
44
            <xslo:template match="/">
44
                <xslo:if test="marc:collection">
45
                <xslo:if test="marc:collection">
45
                    <collection>
46
                    <collection>
Lines 66-72 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
66
                    <xslo:apply-templates mode="index_match_heading"/>
67
                    <xslo:apply-templates mode="index_match_heading"/>
67
                    <xslo:apply-templates mode="index_subject_thesaurus"/>
68
                    <xslo:apply-templates mode="index_subject_thesaurus"/>
68
                    <xslo:apply-templates mode="index_all"/>
69
                    <xslo:apply-templates mode="index_all"/>
69
                    <xslo:apply-templates mode="index_sort_tit"/>
70
                    <xslo:apply-templates mode="index_sort_title"/>
70
                </z:record>
71
                </z:record>
71
            </xslo:template>
72
            </xslo:template>
72
73
Lines 78-100 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
78
            <xsl:call-template name="handle-index-heading"/>
79
            <xsl:call-template name="handle-index-heading"/>
79
            <xsl:call-template name="handle-index-heading-conditional"/>
80
            <xsl:call-template name="handle-index-heading-conditional"/>
80
            <xsl:call-template name="handle-index-match-heading"/>
81
            <xsl:call-template name="handle-index-match-heading"/>
82
            <xsl:call-template name="handle-index-sort-title"/>
81
            <xsl:apply-templates/>
83
            <xsl:apply-templates/>
82
            <xslo:template mode="index_all" match="text()">
84
            <xslo:template mode="index_all" match="text()">
83
                <z:index name="Any:w Any:p">
85
                <z:index name="Any:w Any:p">
84
                    <xslo:value-of select="."/>
86
                    <xslo:value-of select="."/>
85
                </z:index>
87
                </z:index>
86
            </xslo:template>
88
            </xslo:template>
87
            <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
88
                <xslo:variable name="chop">
89
                    <xslo:choose>
90
                        <xslo:when test="not(number(@ind2))">0</xslo:when>
91
                        <xslo:otherwise><xslo:value-of select="number(@ind2)"/></xslo:otherwise>
92
                    </xslo:choose>
93
                </xslo:variable>
94
                <z:index name="Title:s">
95
                    <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
96
                </z:index>
97
            </xslo:template>
98
            <xslo:template name="chopPunctuation">
89
            <xslo:template name="chopPunctuation">
99
            <xslo:param name="chopString"/>
90
            <xslo:param name="chopString"/>
100
                <xslo:variable name="length" select="string-length($chopString)"/>
91
                <xslo:variable name="length" select="string-length($chopString)"/>
Lines 450-455 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
450
        </z:index>
441
        </z:index>
451
    </xsl:template>
442
    </xsl:template>
452
443
444
    <xsl:template name="handle-index-sort-title">
445
        <xsl:for-each select="//kohaidx:index_sort_title[generate-id() = generate-id(key('index_sort_title_tag', @tag)[1])]">
446
            <xslo:template mode="index_sort_title">
447
                <xsl:attribute name="match">
448
                    <xsl:text>marc:datafield[@tag='</xsl:text>
449
                    <xsl:value-of select="@tag"/>
450
                    <xsl:text>']</xsl:text>
451
                </xsl:attribute>
452
                <xsl:for-each select="key('index_sort_title_tag', @tag)">
453
                    <xslo:variable name="chop">
454
                        <xslo:choose>
455
                          <xslo:when test="not(number(@ind2))">0</xslo:when>
456
                          <xslo:otherwise>
457
                            <xslo:value-of select="number(@ind2)"/>
458
                          </xslo:otherwise>
459
                        </xslo:choose>
460
                    </xslo:variable>
461
                    <z:index name="Title:s">
462
                        <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
463
                    </z:index>
464
                </xsl:for-each>
465
            </xslo:template>
466
        </xsl:for-each>
467
    </xsl:template>
468
453
    <xsl:template name="handle-index-match-heading">
469
    <xsl:template name="handle-index-match-heading">
454
        <xsl:for-each select="//kohaidx:index_match_heading[generate-id() = generate-id(key('index_match_heading_tag', @tag)[1])]">
470
        <xsl:for-each select="//kohaidx:index_match_heading[generate-id() = generate-id(key('index_match_heading_tag', @tag)[1])]">
455
            <xslo:template mode="index_match_heading">
471
            <xslo:template mode="index_match_heading">
456
- 

Return to bug 18540