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

--- Comment #14 from David Cook <[email protected]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to