[Koha] koha authorities update linking authorities in subfield 0

schnydszch eugenegf at yahoo.com
Mon Sep 21 23:43:01 NZST 2015


Thanks Katrin! I will file a enhancement bug for this. Just in case for those
interested, I used MARCEdit's MARC Tools and added the following XSLT to
transform the MARCXML into MARCXML adding the desired Control Nos.:

<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:dc="http://purl.org/dc/elements/1.1/"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="rdf dc marc">
 <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
 <xsl:key name="term" match="datafield[@tag='151']|datafield[@tag='150']"
use="subfield[@code='a']" />

 <xsl:template match="datafield[@tag='550'][subfield[@code='a']]">
   <xsl:variable name="t550a" select="subfield[@code='a']" />
   <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
     <xsl:for-each select="key('term',$t550a)">
       <subfield code="9">
         <xsl:value-of select="../controlfield[@tag='001']" />
       </subfield>
      </xsl:for-each>
    </xsl:copy>
 </xsl:template>

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



--
View this message in context: http://koha.1045719.n5.nabble.com/koha-authorities-update-linking-authorities-in-subfield-0-tp5852941p5854033.html
Sent from the Koha-general mailing list archive at Nabble.com.


More information about the Koha mailing list