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

(-)a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml (-1 / +9 lines)
Lines 18-30 authority-zebra-indexdefs.xsl` Link Here
18
  <kohaidx:index_subfields tag="200" subfields="abcdfgjxyz">
18
  <kohaidx:index_subfields tag="200" subfields="abcdfgjxyz">
19
    <kohaidx:target_index>Personal-name:w</kohaidx:target_index>
19
    <kohaidx:target_index>Personal-name:w</kohaidx:target_index>
20
    <kohaidx:target_index>Personal-name:p</kohaidx:target_index>
20
    <kohaidx:target_index>Personal-name:p</kohaidx:target_index>
21
    <kohaidx:target_index>Personal-name:s</kohaidx:target_index>
22
  </kohaidx:index_subfields>
23
  <kohaidx:index_heading tag="200" subfields="abcdfgjxyz">
21
    <kohaidx:target_index>Heading:w</kohaidx:target_index>
24
    <kohaidx:target_index>Heading:w</kohaidx:target_index>
22
    <kohaidx:target_index>Heading:p</kohaidx:target_index>
25
    <kohaidx:target_index>Heading:p</kohaidx:target_index>
26
    <kohaidx:target_index>Heading:s</kohaidx:target_index>
27
  </kohaidx:index_heading>
28
  <kohaidx:index_match_heading tag="200" subfields="abcdfgjxyz">
23
    <kohaidx:target_index>Match:w</kohaidx:target_index>
29
    <kohaidx:target_index>Match:w</kohaidx:target_index>
24
    <kohaidx:target_index>Match:p</kohaidx:target_index>
30
    <kohaidx:target_index>Match:p</kohaidx:target_index>
31
    <kohaidx:target_index>Match:s</kohaidx:target_index>
25
    <kohaidx:target_index>Match-heading:w</kohaidx:target_index>
32
    <kohaidx:target_index>Match-heading:w</kohaidx:target_index>
26
    <kohaidx:target_index>Match-heading:p</kohaidx:target_index>
33
    <kohaidx:target_index>Match-heading:p</kohaidx:target_index>
27
  </kohaidx:index_subfields>
34
    <kohaidx:target_index>Match-heading:s</kohaidx:target_index>
35
  </kohaidx:index_match_heading>
28
  <kohaidx:index_subfields tag="200" subfields="a">
36
  <kohaidx:index_subfields tag="200" subfields="a">
29
    <kohaidx:target_index>Heading:s</kohaidx:target_index>
37
    <kohaidx:target_index>Heading:s</kohaidx:target_index>
30
    <kohaidx:target_index>Heading-Main:w</kohaidx:target_index>
38
    <kohaidx:target_index>Heading-Main:w</kohaidx:target_index>
(-)a/etc/zebradb/marc_defs/unimarc/authorities/authority-zebra-indexdefs.xsl (-2 / +77 lines)
Lines 17-22 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
17
  <xslo:template match="text()" mode="index_heading_conditional"/>
17
  <xslo:template match="text()" mode="index_heading_conditional"/>
18
  <xslo:template match="text()" mode="index_match_heading"/>
18
  <xslo:template match="text()" mode="index_match_heading"/>
19
  <xslo:template match="text()" mode="index_subject_thesaurus"/>
19
  <xslo:template match="text()" mode="index_subject_thesaurus"/>
20
  <xslo:template match="text()" mode="index_sort_tit"/>
20
  <xslo:template match="/">
21
  <xslo:template match="/">
21
    <xslo:if test="marc:collection">
22
    <xslo:if test="marc:collection">
22
      <collection>
23
      <collection>
Lines 42-47 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
42
      <xslo:apply-templates mode="index_match_heading"/>
43
      <xslo:apply-templates mode="index_match_heading"/>
43
      <xslo:apply-templates mode="index_subject_thesaurus"/>
44
      <xslo:apply-templates mode="index_subject_thesaurus"/>
44
      <xslo:apply-templates mode="index_all"/>
45
      <xslo:apply-templates mode="index_all"/>
46
      <xslo:apply-templates mode="index_sort_tit"/>
45
    </z:record>
47
    </z:record>
46
  </xslo:template>
48
  </xslo:template>
47
  <xslo:template match="marc:controlfield[@tag='001']">
49
  <xslo:template match="marc:controlfield[@tag='001']">
Lines 52-58 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
52
  <xslo:template mode="index_subfields" match="marc:datafield[@tag='200']">
54
  <xslo:template mode="index_subfields" match="marc:datafield[@tag='200']">
53
    <xslo:for-each select="marc:subfield">
55
    <xslo:for-each select="marc:subfield">
54
      <xslo:if test="contains('abcdfgjxyz', @code)">
56
      <xslo:if test="contains('abcdfgjxyz', @code)">
55
        <z:index name="Personal-name:w Personal-name:p Heading:w Heading:p Match:w Match:p Match-heading:w Match-heading:p">
57
        <z:index name="Personal-name:w Personal-name:p Personal-name:s">
56
          <xslo:value-of select="."/>
58
          <xslo:value-of select="."/>
57
        </z:index>
59
        </z:index>
58
      </xslo:if>
60
      </xslo:if>
Lines 646-656 definition file (probably something like {biblio,authority}-koha-indexdefs.xml) Link Here
646
      </xslo:if>
648
      </xslo:if>
647
    </xslo:for-each>
649
    </xslo:for-each>
648
  </xslo:template>
650
  </xslo:template>
651
  <xslo:template mode="index_heading" match="marc:datafield[@tag='200']">
652
    <z:index name="Heading:w Heading:p Heading:s">
653
      <xslo:variable name="raw_heading">
654
        <xslo:for-each select="marc:subfield">
655
          <xslo:if test="contains('abcdfgjxyz', @code)" name="Heading:w Heading:p Heading:s">
656
            <xslo:if test="position() &gt; 1">
657
              <xslo:choose>
658
                <xslo:when test="contains('', @code)">
659
                  <xslo:text>--</xslo:text>
660
                </xslo:when>
661
                <xslo:otherwise>
662
                  <xslo:value-of select="substring(' ', 1, 1)"/>
663
                </xslo:otherwise>
664
              </xslo:choose>
665
            </xslo:if>
666
            <xslo:value-of select="."/>
667
          </xslo:if>
668
        </xslo:for-each>
669
      </xslo:variable>
670
      <xslo:value-of select="normalize-space($raw_heading)"/>
671
    </z:index>
672
  </xslo:template>
673
  <xslo:template mode="index_match_heading" match="marc:datafield[@tag='200']">
674
    <z:index name="Match:w Match:p Match:s Match-heading:w Match-heading:p Match-heading:s">
675
      <xslo:variable name="raw_heading">
676
        <xslo:for-each select="marc:subfield">
677
          <xslo:if test="contains('abcdfgjxyz', @code)" name="Match:w Match:p Match:s Match-heading:w Match-heading:p Match-heading:s">
678
            <xslo:if test="position() &gt; 1">
679
              <xslo:choose>
680
                <xslo:when test="contains('', @code)">
681
                  <xslo:choose>
682
                    <xslo:when test="@code = $general_subdivision_subfield">
683
                      <xslo:text> generalsubdiv </xslo:text>
684
                    </xslo:when>
685
                    <xslo:when test="@code = $form_subdivision_subfield">
686
                      <xslo:text> formsubdiv </xslo:text>
687
                    </xslo:when>
688
                    <xslo:when test="@code = $chronological_subdivision_subfield">
689
                      <xslo:text> chronologicalsubdiv </xslo:text>
690
                    </xslo:when>
691
                    <xslo:when test="@code = $geographic_subdivision_subfield">
692
                      <xslo:text> geographicsubdiv </xslo:text>
693
                    </xslo:when>
694
                  </xslo:choose>
695
                </xslo:when>
696
                <xslo:otherwise>
697
                  <xslo:value-of select="substring(' ', 1, 1)"/>
698
                </xslo:otherwise>
699
              </xslo:choose>
700
            </xslo:if>
701
            <xslo:call-template name="chopPunctuation">
702
              <xslo:with-param name="chopString">
703
                <xslo:value-of select="."/>
704
              </xslo:with-param>
705
            </xslo:call-template>
706
          </xslo:if>
707
        </xslo:for-each>
708
      </xslo:variable>
709
      <xslo:value-of select="normalize-space($raw_heading)"/>
710
    </z:index>
711
  </xslo:template>
649
  <xslo:template mode="index_all" match="text()">
712
  <xslo:template mode="index_all" match="text()">
650
    <z:index name="Any:w Any:p">
713
    <z:index name="Any:w Any:p">
651
      <xslo:value-of select="."/>
714
      <xslo:value-of select="."/>
652
    </z:index>
715
    </z:index>
653
  </xslo:template>
716
  </xslo:template>
717
  <xslo:template mode="index_sort_tit" match="marc:datafield[@tag='245']">
718
    <xslo:variable name="chop">
719
      <xslo:choose>
720
        <xslo:when test="not(number(@ind2))">0</xslo:when>
721
        <xslo:otherwise>
722
          <xslo:value-of select="number(@ind2)"/>
723
        </xslo:otherwise>
724
      </xslo:choose>
725
    </xslo:variable>
726
    <z:index name="Title:s">
727
      <xslo:value-of select="substring(marc:subfield[@code='a'], $chop+1)"/>
728
    </z:index>
729
  </xslo:template>
654
  <xslo:template name="chopPunctuation">
730
  <xslo:template name="chopPunctuation">
655
    <xslo:param name="chopString"/>
731
    <xslo:param name="chopString"/>
656
    <xslo:variable name="length" select="string-length($chopString)"/>
732
    <xslo:variable name="length" select="string-length($chopString)"/>
657
- 

Return to bug 18017