Bugzilla – Attachment 8969 Details for
Bug 7818
support DOM mode for Zebra indexing of bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7818: add index_data_field option to DOM indexing repertoire
Bug-7818-add-indexdatafield-option-to-DOM-indexing.patch (text/plain), 5.00 KB, created by
Jared Camins-Esakov
on 2012-04-06 16:28:06 UTC
(
hide
)
Description:
Bug 7818: add index_data_field option to DOM indexing repertoire
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-04-06 16:28:06 UTC
Size:
5.00 KB
patch
obsolete
>From 20a6670e2c431a2393ab7be6af5076fa4c811122 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Mon, 26 Mar 2012 01:10:09 -0400 >Subject: [PATCH] Bug 7818: add index_data_field option to DOM indexing repertoire >Content-Type: text/plain; charset="UTF-8" > >Adds a new kohaidx:index_data_field index definition type which >indexes all of the subfields of a MARC data field as a single >phrase, separating the contents of each with a space. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >--- > etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl | 37 +++++++++++++++++++++++++++ > 1 files changed, 37 insertions(+), 0 deletions(-) > >diff --git a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl >index bfb79b4..3e3aed4 100644 >--- a/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl >+++ b/etc/zebradb/xsl/koha-indexdefs-to-zebra.xsl >@@ -15,6 +15,7 @@ > <xsl:key name="index_control_field_tag" match="kohaidx:index_control_field" use="@tag"/> > <xsl:key name="index_subfields_tag" match="kohaidx:index_subfields" use="@tag"/> > <xsl:key name="index_heading_tag" match="kohaidx:index_heading" use="@tag"/> >+ <xsl:key name="index_data_field_tag" match="kohaidx:index_data_field" use="@tag"/> > <xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/> > > <xsl:template match="kohaidx:index_defs"> >@@ -30,6 +31,7 @@ authority-zebra-indexdefs.xsl` (substituting the appropriate file names). > <xslo:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/> > <xslo:template match="text()"/> > <xslo:template match="text()" mode="index_subfields"/> >+ <xslo:template match="text()" mode="index_data_field"/> > <xslo:template match="text()" mode="index_heading"/> > <xslo:template match="text()" mode="index_match_heading"/> > <xslo:template match="text()" mode="index_subject_thesaurus"/> >@@ -50,6 +52,7 @@ authority-zebra-indexdefs.xsl` (substituting the appropriate file names). > <xslo:attribute name="z:id"><xslo:value-of select="$controlField001"/></xslo:attribute> > <xslo:apply-templates/> > <xslo:apply-templates mode="index_subfields"/> >+ <xslo:apply-templates mode="index_data_field"/> > <xslo:apply-templates mode="index_heading"/> > <xslo:apply-templates mode="index_match_heading"/> > <xslo:apply-templates mode="index_subject_thesaurus"/> >@@ -59,6 +62,7 @@ authority-zebra-indexdefs.xsl` (substituting the appropriate file names). > <xsl:call-template name="handle-index-leader"/> > <xsl:call-template name="handle-index-control-field"/> > <xsl:call-template name="handle-index-subfields"/> >+ <xsl:call-template name="handle-index-data-field"/> > <xsl:call-template name="handle-index-heading"/> > <xsl:call-template name="handle-index-match-heading"/> > <xsl:apply-templates/> >@@ -260,6 +264,39 @@ authority-zebra-indexdefs.xsl` (substituting the appropriate file names). > </xslo:for-each> > </xsl:template> > >+ <xsl:template name="handle-index-data-field"> >+ <xsl:for-each select="//kohaidx:index_data_field[generate-id() = generate-id(key('index_data_field_tag', @tag)[1])]"> >+ <xslo:template mode="index_data_field"> >+ <xsl:attribute name="match"> >+ <xsl:text>marc:datafield[@tag='</xsl:text> >+ <xsl:value-of select="@tag"/> >+ <xsl:text>']</xsl:text> >+ </xsl:attribute> >+ <xsl:for-each select="key('index_data_field_tag', @tag)"> >+ <xsl:call-template name="handle-one-data-field"/> >+ </xsl:for-each> >+ </xslo:template> >+ </xsl:for-each> >+ </xsl:template> >+ >+ <xsl:template name="handle-one-data-field"> >+ <xsl:variable name="indexes"> >+ <xsl:call-template name="get-target-indexes"/> >+ </xsl:variable> >+ <z:index> >+ <xsl:attribute name="name"><xsl:value-of select="normalize-space($indexes)"/></xsl:attribute> >+ <xslo:variable name="raw_heading"> >+ <xslo:for-each select="marc:subfield"> >+ <xslo:if test="position() > 1"> >+ <xslo:value-of select="substring(' ', 1, 1)"/> <!-- FIXME surely there's a better way to specify a space --> >+ </xslo:if> >+ <xslo:value-of select="."/> >+ </xslo:for-each> >+ </xslo:variable> >+ <xslo:value-of select="normalize-space($raw_heading)"/> >+ </z:index> >+ </xsl:template> >+ > <xsl:template name="handle-index-heading"> > <xsl:for-each select="//kohaidx:index_heading[generate-id() = generate-id(key('index_heading_tag', @tag)[1])]"> > <xslo:template mode="index_heading"> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7818
:
8965
|
8966
|
8967
|
8968
|
8969
|
8970
|
8971
|
8972
|
8973
|
8974
|
8982
|
9798
|
9968
|
10560
|
10617