--- trunk/all2xml.pl 2003/07/04 15:05:23 57 +++ trunk/all2xml.pl 2003/07/04 16:56:40 58 @@ -18,7 +18,8 @@ my $config; -use index_DBI; # there is no other, right now ;-) +#use index_DBI; # default DBI module for index +use index_DBI_cache; # faster DBI module using memory cache my $index; my %opts; @@ -240,7 +241,11 @@ print STDERR "reading ./import_xml/$type.xml\n"; - $config=XMLin("./import_xml/$type.xml", forcearray => [ $type2tag{$type} ], forcecontent => 1); + # extract just type basic + my $type_base = $type; + $type_base =~ s/_.+$//g; + + $config=XMLin("./import_xml/$type.xml", forcearray => [ $type2tag{$type_base} ], forcecontent => 1); # output current progress indicator my $last_p = 0; @@ -258,7 +263,8 @@ # now read database print STDERR "using: $type...\n"; - if ($type eq "isis") { + if ($type_base eq "isis") { + my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!"; $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); @@ -278,7 +284,7 @@ my $swishpath = $path."#".int($row->{mfn}); - if (my $xml = data2xml($type,$row,$add_xml)) { + if (my $xml = data2xml($type_base,$row,$add_xml)) { $xml = $cp2utf->convert($xml); use bytes; # as opposed to chars print "Path-Name: $swishpath\n"; @@ -289,7 +295,7 @@ } print STDERR "\n"; - } elsif ($type eq "excel") { + } elsif ($type_base eq "excel") { use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::Utility qw(int2col);