633 |
|
|
634 |
foreach my $database ($cfg->Sections) { |
foreach my $database ($cfg->Sections) { |
635 |
|
|
636 |
|
# save database name in global variable path for later |
637 |
|
# (need for index filter creation) |
638 |
|
$path = $database; |
639 |
|
|
640 |
my $type = lc($cfg -> val($database, 'type')) || die "$database doesn't have 'type' defined"; |
my $type = lc($cfg -> val($database, 'type')) || die "$database doesn't have 'type' defined"; |
641 |
my $add_xml = $cfg -> val($database, 'xml'); # optional |
my $add_xml = $cfg -> val($database, 'xml'); # optional |
642 |
|
|
742 |
$import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); |
$import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); |
743 |
my $db = new Biblio::Isis( isisdb => $isis_db ); |
my $db = new Biblio::Isis( isisdb => $isis_db ); |
744 |
|
|
745 |
my $max_rowid = $db->count; |
if (! $db) { |
|
|
|
|
if (! $max_rowid) { |
|
746 |
print STDERR "FATAL: can't read ISIS database: $isis_db, skipping...\n"; |
print STDERR "FATAL: can't read ISIS database: $isis_db, skipping...\n"; |
747 |
next; |
next; |
748 |
} |
} |
749 |
|
|
750 |
print STDERR "Reading database: $isis_db [$max_rowid rows]\n"; |
my $max_rowid = $db->count if ($db); |
751 |
|
|
752 |
$path = $database; |
print STDERR "Reading database: $isis_db [$max_rowid rows]\n"; |
753 |
|
|
754 |
for (my $row_id = 1; $row_id <= $max_rowid; $row_id++ ) { |
for (my $row_id = 1; $row_id <= $max_rowid; $row_id++ ) { |
755 |
my $row = $db->to_hash( $row_id ); |
my $row = $db->to_hash( $row_id ); |
832 |
print "Document-Type: XML\n\n$xml\n"; |
print "Document-Type: XML\n\n$xml\n"; |
833 |
} |
} |
834 |
} |
} |
835 |
|
|
836 |
|
print STDERR "\n"; |
837 |
|
|
838 |
} elsif ($type_base eq "marc") { |
} elsif ($type_base eq "marc") { |
839 |
|
|
840 |
require MARC::File::USMARC; |
require MARC::File::USMARC; |