xml record :
<?xml version="1.0" encoding="UTF-8"?>
<record
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/
standards/marcxml/schema/MARC21slim.xsd"
 xmlns="http://www.loc.gov/MARC21/slim";>

 <leader>00154nx  a2200073   4500 </leader>
 <datafield tag="200" ind1=" " ind2="1">
   <subfield code="a">Cohen</subfield>
   <subfield code="b">Bernard</subfield>
   <subfield code="f">1956-</subfield>
   <subfield code="4">Traducteur</subfield>
 </datafield>
 <datafield tag="100" ind1=" " ind2=" ">
   <subfield code="a">19980227afrey50      ba0</subfield>
 </datafield>
 <controlfield tag="001">14286</controlfield>
 <datafield tag="152" ind1=" " ind2=" ">
   <subfield code="b">NP</subfield>
 </datafield>
</record>

00162lbána2200073uel4500200004600000100002900046001000600075152000700081.
1.a.  .    Cohen.bBernard.f1956-.4Traducteur.  .a19980227afrey50
ba0.14286.  .bNP..

Here is part of my code :
            my $record;
            eval {
                $record =
MARC::Record->new_from_xml($marcxml,'UTF-8',"UNIMARCAUTH");
                $record->encoding('UTF-8');
            };
            if($@){
                print "  There was some pb getting authority :
".$authid."\n";
            }
            my $leader=$record->leader;
            substr($leader,0,5)='     ';
            substr($leader,10,7)='22     ';
            $record->leader(substr($leader,0,24));
            print $record->as_usmarc();

But it was not a single record. It was part of a batch.
And it seems that trying to decode the marc record on its own leads to
problems.

Anyway, why is there a change in leader  from 00154nx  a2200073   4500
to 00162lbána2200073uel4500 ?
This leads to problem with MARC decoding.
Is there something to do about it ?
Coud MARC::File::XML be a little more verbose about errors ?

-- 
Henri Damien LAURENT et Paul POULAIN
Consultants indépendants
en logiciels libres et bibliothéconomie (http://www.koha-fr.org)


Reply via email to