OAI-PMH XSLT library

From Koha Wiki

Jump to: navigation, search
Home > Documentation
Home > Documentation
Home > Documentation
Koha > Library
Tips & Tricks > Tips & Tricks/Customising Notices and Slips > Tips & Tricks

You can use XSLT to alter the MARCXML output by Koha's OAI-PMH server. This paqe aims to collect some tips and tricks that might be useful.

See the documentation for advice on how you configure Koha to use custom XSLT for OAI-PMH output.

Put the biblionumber in 001

This transformation will remove the existing 001 field, and add a new 001 field that hs the biblionumber as its value.

<xsl:stylesheet version="1.0"

 <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

 <xsl:template match="node()|@*">
   <xsl:apply-templates select="node()|@*"/>

 <xsl:template match="marc:controlfield[@tag=001]"/>

 <xsl:template match="marc:leader">
   <xsl:apply-templates select="@*|node()"/>
   <xsl:if test="not(marc:controlfield[@tag=001])">
  </xsl:text><xsl:element name="controlfield" xmlns="http://www.loc.gov/MARC21/slim">
     <xsl:attribute name="tag">001</xsl:attribute>
     <xsl:value-of select="//marc:datafield[@tag=999]/marc:subfield[@code='c']/text()"/>

Personal tools