/[webpac]/branches/hidra/all2xml.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/hidra/all2xml.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 723 by dpavlin, Mon Apr 3 08:02:51 2006 UTC revision 743 by dpavlin, Wed May 24 19:08:35 2006 UTC
# Line 705  foreach my $database ($cfg->Sections) { Line 705  foreach my $database ($cfg->Sections) {
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;
# Line 816  foreach my $database ($cfg->Sections) { Line 824  foreach my $database ($cfg->Sections) {
824                  my $excel_file = $cfg -> val($database, 'excel_file') || die "$database doesn't have 'excel_file' defined!";                  my $excel_file = $cfg -> val($database, 'excel_file') || die "$database doesn't have 'excel_file' defined!";
825    
826                  my $sheet = x($config->{sheet}) || die "no sheet in $type.xml";                  my $sheet = x($config->{sheet}) || die "no sheet in $type.xml";
827                  my $start_row = x($config->{start_row}) - 1 || die "no start_row in $type.xml";                  my $start_row = x($config->{start_row}) || die "no start_row in $type.xml";
828                    $start_row--;
829    
830                  my $oBook = Spreadsheet::ParseExcel::Workbook->Parse($excel_file) || die "can't open Excel file '$excel_file'";                  my $oBook = Spreadsheet::ParseExcel::Workbook->Parse($excel_file) || die "can't open Excel file '$excel_file'";
831    

Legend:
Removed from v.723  
changed lines
  Added in v.743

  ViewVC Help
Powered by ViewVC 1.1.26