/[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 248 by dpavlin, Mon Mar 8 18:07:37 2004 UTC revision 249 by dpavlin, Mon Mar 8 21:10:02 2004 UTC
# Line 211  sub data2xml { Line 211  sub data2xml {
211                          # placeholder for all repeatable entries for index                          # placeholder for all repeatable entries for index
212    
213                          sub chk_eval($) {                          sub chk_eval($) {
214                                  my $data = shift || return;                                  my $data = shift;
215                                  if ($data =~ s/eval{([^}]+)}//) {                                  if ($data =~ s/eval{([^}]+)}//) {
216                                          if (eval "$1") {                                          if (eval "$1") {
217                                                  return $data;                                                  return $data;
# Line 291  sub data2xml { Line 291  sub data2xml {
291                                  }                                  }
292                                  # type="swish" ; field for swish                                  # type="swish" ; field for swish
293                                  if ($swish) {                                  if ($swish) {
                                         my $tmp;  
294                                          if ($filter && ($s || $se)) {                                          if ($filter && ($s || $se)) {
295                                                  no strict 'refs';                                                  no strict 'refs';
296                                                  my $tmp = join(" ",&$filter($swish)) if ($s || $se);                                                  my $tmp = join(" ",&$filter($swish)) if ($s || $se);
297                                                    $swish_data .= $tmp if ($s);
298                                                    $swish_exact_data .= "xxbxx $tmp xxexx " if ($se && $tmp ne "");
299    
300                                          } else {                                          } else {
301                                                  $tmp = $swish;                                                  $swish_data .= $swish if ($s);
302                                                    $swish_exact_data .= "xxbxx $swish xxexx " if ($se && $swish ne "");
303                                          }                                          }
   
                                         $tmp = chk_eval($tmp);  
                                         $swish_data .= $tmp if ($s);  
                                         $swish_exact_data .= "xxbxx $tmp xxexx " if ($se && $tmp ne "");  
304                                  }                                  }
305    
306                                  # type="display" ; field for display                                  # type="display" ; field for display
# Line 741  print STDERR "using: $type...\n"; Line 740  print STDERR "using: $type...\n";
740                  print STDERR "\n";                  print STDERR "\n";
741    
742          } elsif ($type_base eq "excel") {          } elsif ($type_base eq "excel") {
743                  use Spreadsheet::ParseExcel;                  require Spreadsheet::ParseExcel;
744                  use Spreadsheet::ParseExcel::Utility qw(int2col);                  require Spreadsheet::ParseExcel::Utility;
745                    import Spreadsheet::ParseExcel::Utility qw(int2col);
746                                    
747                  $import2cp = Text::Iconv->new($config->{excel_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{excel_codepage},$codepage);
748                  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!";
# Line 796  print STDERR "using: $type...\n"; Line 796  print STDERR "using: $type...\n";
796                  }                  }
797          } elsif ($type_base eq "marc") {          } elsif ($type_base eq "marc") {
798    
799                  use MARC;                  require MARC;
800                                    
801                  $import2cp = Text::Iconv->new($config->{marc_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{marc_codepage},$codepage);
802                  my $marc_file = $cfg -> val($database, 'marc_file') || die "$database doesn't have 'marc_file' defined!";                  my $marc_file = $cfg -> val($database, 'marc_file') || die "$database doesn't have 'marc_file' defined!";

Legend:
Removed from v.248  
changed lines
  Added in v.249

  ViewVC Help
Powered by ViewVC 1.1.26