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

--- Comment #13 from David Cook <[email protected]> ---
It's a bit of a hack and I haven't tried it yet with the Zebra pipelines yet,
but I'll include my transform here. It copies all the existing XML elements,
but for 880 elements it creates a new element based off the linkage, and it
just copies the indicators and subfields into that new element according to the
MARC bib spec.

I would've liked to have integrated this into Koha's existing XSLTs but I
couldn't see an easy way of doing so, although I have a few ideas about how
maybe it could work... 

<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>

-- 
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