--- branches/hidra/all2xml.pl 2006/05/24 19:08:35 743
+++ branches/hidra/all2xml.pl 2006/10/29 17:56:58 760
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Biblio::Isis;
+use Biblio::Isis 0.23;
use Getopt::Std;
use Data::Dumper;
use XML::Simple;
@@ -76,6 +76,9 @@
my $last_field_name; # cache to prevent repeated fields
+my $broken_cdata = XMLin(']]>') eq '>';
+warn "XML::Simple on this system seems broken with .\n" if ($broken_cdata);
+
sub data2xml {
use xmlify;
@@ -207,6 +210,7 @@
delete $x->{value};
delete $x->{delimiter};
$x->{content} = $v;
+ $d =~ s#>$## if ($d && $broken_cdata);
$x->{delimiter} = $d;
}
return $x;
@@ -706,8 +710,7 @@
$config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 );
# check for broken XML::Simple
- if ( XMLin(']]>') eq '>' ) {
- warn "XML::Simple on this system seems broken with .\n";
+ if ( $broken_cdata ) {
map {
$config->{format}->{$_}->{content} =~ s#>$##;
} keys %{ $config->{format} };
@@ -782,7 +785,10 @@
my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!";
$import2cp = Text::Iconv->new($config->{isis_codepage},$codepage);
- my $db = new Biblio::Isis( isisdb => $isis_db );
+ my $db = new Biblio::Isis(
+ isisdb => $isis_db,
+ join_subfields_with => ' ; ',
+ );
if (! $db) {
print STDERR "FATAL: can't read ISIS database: $isis_db, skipping...\n";