[Koha-bugs] [Bug 15187] Adding 880 Fields to index-list in order to Increase Search for ALL non-latin Scripts

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 2 07:54:49 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15187

--- Comment #14 from David Cook <dcook at prosentient.com.au> ---
(In reply to David Cook from comment #13)
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:marc="http://www.loc.gov/MARC21/slim"
>  version="1.0">
> <xsl:output indent="yes"
>       method="xml"
>       version="1.0"
>       encoding="UTF-8"/>
> 
>  <xsl:template name="identity" match="node()|@*">
>    <xsl:copy>
>      <xsl:apply-templates select="@*|node()"/>
>    </xsl:copy>
>  </xsl:template>
> 
>  <xsl:template match="marc:datafield[@tag=880]">
>     <xsl:call-template name="identity"/>
>     <xsl:variable name="tag" select="substring(marc:subfield[@code=6],1,3)"/>
>     <xsl:text>&#xa;</xsl:text>
>     <xsl:text>  </xsl:text>
>     <xsl:element name="datafield" namespace="http://www.loc.gov/MARC21/slim">
>         <xsl:attribute name="tag"><xsl:value-of
> select="substring(marc:subfield[@code=6],1,3)"/></xsl:attribute>
>         <xsl:attribute name="ind1"><xsl:value-of
> select="@ind1"/></xsl:attribute>
>         <xsl:attribute name="ind2"><xsl:value-of
> select="@ind2"/></xsl:attribute>
>         <xsl:apply-templates select="marc:subfield[@code != '6']"/>
>     </xsl:element>
> </xsl:template>
> 
> </xsl:stylesheet>

Steps to get this to work in a instance-specific context:

1. I saved the above as /etc/koha/zebradb/xsl/preprocess_marcxml.xsl
2. cp /etc/koha/zebradb/biblios/etc/dom-config.xml
/etc/koha/sites/kohadev/test-dom-config.xml
3. vi /etc/koha/sites/kohadev/zebra-biblios-dom.cfg
#For marcxml, I replaced /etc/koha/zebradb/biblios/etc/dom-config.xml with
/etc/koha/sites/kohadev/test-dom-config.xml
4. vi /etc/koha/sites/kohadev/test-dom-config.xml
#Use the following:
<dom>
  <extract name="index">
    <xslt stylesheet="preprocess_marcxml.xsl"/>
    <xslt stylesheet="biblio-zebra-indexdefs.xsl"/>
  </extract>
  <retrieve name="marc">
    <xslt stylesheet="identity.xsl" />
  </retrieve>
  <retrieve name="marcxml">
    <xslt stylesheet="identity.xsl" />
  </retrieve>
  <retrieve name="zebra">
    <xslt stylesheet="zebra.xsl"/>
  </retrieve>
  <retrieve name="index">
    <xslt stylesheet="biblio-zebra-indexdefs.xsl"/>
  </retrieve>
  <input>
    <xmlreader level="1"/>
  </input>
</dom>

5. koha-rebuild-zebra -f -b -v kohadev

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list