optimisation + encoding set.
FIXME : unimarc hard coded.
This commit is contained in:
parent
0bc3591452
commit
cc7c0c66fb
1 changed files with 13 additions and 9 deletions
|
@ -109,20 +109,24 @@ if(not $no_marcxml){
|
|||
my $marcxml = $data->[1];
|
||||
|
||||
eval{
|
||||
my $record = MARC::Record->new_from_xml($marcxml);
|
||||
my $record = MARC::Record->new_from_xml($marcxml,'UTF-8','UNIMARC');
|
||||
my @field = $record->field('010');
|
||||
my $flag = 0;
|
||||
foreach my $field (@field){
|
||||
my $subfield = $field->subfield('a');
|
||||
if($subfield){
|
||||
my $isbn = $subfield;
|
||||
$isbn =~ s/-//g;
|
||||
$field->update('a' => $isbn);
|
||||
$flag = 1;
|
||||
}
|
||||
}
|
||||
if($flag){
|
||||
$marcxml = $record->as_xml;
|
||||
# Update
|
||||
my $sth = $dbh->prepare($update_marcxml);
|
||||
$sth->execute($marcxml,$biblioitemnumber);
|
||||
}
|
||||
};
|
||||
if($@){
|
||||
print "\n /!\\ pb getting $biblioitemnumber : $@";
|
||||
|
|
Loading…
Reference in a new issue