[Koha-bugs] [Bug 16488] UNIMARC to MARC21 XSLT to be used in z39.50 import sources

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 24 19:40:05 CET 2023


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

Franck Theeten <franck.theeten at africamuseum.be> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |franck.theeten at africamuseum
                   |                            |.be

--- Comment #24 from Franck Theeten <franck.theeten at africamuseum.be> ---
Dear list,

We had also the issue of not being able to decipher the accented UTF-8
characters of the SRU server of the BNF in Koha, and maybe found a solution by
doing a slight modification in the XSLT file of MARCEDIT (see comment 3 of
Theodoros Theodoropoulos).
The leader field of a MARC XML document must declare the encoding in its 9th
bit (10th character).
It has to be “a” for UTF-8 documents, and blank for non_UTF-8.
https://knowledge.exlibrisgroup.com/Voyager/Knowledge_Articles/Determine_the_character_set_of_a_MARC_record

But the XSLT file leaves it always blank.
I had to modify a line in the XSLT (see below) that generates the bits 8 to 16
in the leader. 
Maybe I could send the updated file to a GIT repository available to the
community ?

Best regards,  

Franck


------------
Original file:

 <xsl:template name="transform-leader">
    <xsl:variable name="leader" select="marc:leader"/>
    <xsl:variable name="leader05" select="translate(substring($leader,06,1),
'o', 'c')"/>
    <xsl:variable name="leader06" select="translate(substring($leader,07,1),
'hmn', 'aor')"/>
    <xsl:variable name="leader07" select="substring($leader,08,1)"/>
    <xsl:variable name="leader08-16" select="'  22     '"/>
    <xsl:variable name="leader17" select="translate(substring($leader,18,1),
'23', '87')"/>
    <xsl:variable name="leader18" select="translate(substring($leader,19,1), '
n', 'i ')"/>
    <xsl:variable name="leader19-23" select="' 4500'"/>

------------
Same snippet with correction :
--------------
<xsl:template name="transform-leader">
    <xsl:variable name="leader" select="marc:leader"/>
    <xsl:variable name="leader05" select="translate(substring($leader,06,1),
'o', 'c')"/>
    <xsl:variable name="leader06" select="translate(substring($leader,07,1),
'hmn', 'aor')"/>
    <xsl:variable name="leader07" select="substring($leader,08,1)"/>
    <xsl:variable name="leader08-16" select="' a22     '"/>
    <xsl:variable name="leader17" select="translate(substring($leader,18,1),
'23', '87')"/>
    <xsl:variable name="leader18" select="translate(substring($leader,19,1), '
n', 'i ')"/>
    <xsl:variable name="leader19-23" select="' 4500'"/>

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


More information about the Koha-bugs mailing list