705 |
my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type_base} || die "can't find which tag to use for type $type"; |
my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type_base} || die "can't find which tag to use for type $type"; |
706 |
$config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 ); |
$config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 ); |
707 |
|
|
708 |
|
# check for broken XML::Simple |
709 |
|
if ( XMLin('<foo><![CDATA[<bar>]]></foo>') eq '<bar>>' ) { |
710 |
|
warn "XML::Simple on this system seems broken with <![CDATA[..]]>.\n"; |
711 |
|
map { |
712 |
|
$config->{format}->{$_}->{content} =~ s#>$##; |
713 |
|
} keys %{ $config->{format} }; |
714 |
|
} |
715 |
|
|
716 |
# helper for progress bar |
# helper for progress bar |
717 |
sub fmt_time { |
sub fmt_time { |
718 |
my $t = shift || 0; |
my $t = shift || 0; |