/[webpac]/trunk/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 /trunk/all2xml.pl

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

revision 180 by dpavlin, Tue Nov 25 20:04:24 2003 UTC revision 747 by dpavlin, Tue Jun 6 12:34:25 2006 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use OpenIsis;  use Biblio::Isis;
5  use Getopt::Std;  use Getopt::Std;
6  use Data::Dumper;  use Data::Dumper;
7  use XML::Simple;  use XML::Simple;
 use Text::Unaccent 1.02;        # 1.01 won't compile on my platform,  
8  use Text::Iconv;  use Text::Iconv;
9  use Config::IniFiles;  use Config::IniFiles;
10  use Encode;  use Encode;
11  #use GDBM_File;  #use GDBM_File;
12  use Fcntl;      # for O_RDWR  use Fcntl;      # for O_RDWR
13  use TDB_File;  use TDB_File;
14    use Carp;
15    
16  $|=1;  $|=1;
17    
18  my $config_file = $0;  my $config_file = $0;
19  $config_file =~ s/\.pl$/.conf/;  $config_file =~ s/\.pl$/.conf/;
20    $config_file = $ARGV[0] if ($ARGV[0] && -f $ARGV[0]);
21  die "FATAL: can't find configuration file '$config_file'" if (! -e $config_file);  die "FATAL: can't find configuration file '$config_file'" if (! -e $config_file);
22    
23  my $config;  my $config;
24    
25  #use index_DBI;         # default DBI module for index  #use index_DBI;         # default DBI module for index
26  use index_DBI_cache;    # faster DBI module using memory cache  #use index_DBI_cache;   # faster DBI module using memory cache
27    use index_DBI_filter;   # filter support for indexes
28  my $index;  my $index;
29    
30  my %opts;  my %opts;
# Line 61  my %type2tag = ( Line 63  my %type2tag = (
63          'isis' => 'isis',          'isis' => 'isis',
64          'excel' => 'column',          'excel' => 'column',
65          'marc' => 'marc',          'marc' => 'marc',
66          'feed' => 'feed'          'feed' => 'feed',
67  );  );
68    
69  my $cache;      # for cacheing  my $cache;      # for cacheing
# Line 72  my %lhash; Line 74  my %lhash;
74  # if you are tight on memory, turn this off  # if you are tight on memory, turn this off
75  my $use_lhash_cache = 1;  my $use_lhash_cache = 1;
76    
77    my $last_field_name;    # cache to prevent repeated fields
78    
79    my $broken_cdata = XMLin('<foo><![CDATA[<bar>]]></foo>') eq '<bar>>';
80    warn "XML::Simple on this system seems broken with <![CDATA[..]]>.\n" if ($broken_cdata);
81    
82  sub data2xml {  sub data2xml {
83    
84          use xmlify;          use xmlify;
# Line 109  sub data2xml { Line 116  sub data2xml {
116                  $cache->{tags_by_order} = \@sorted_tags;                  $cache->{tags_by_order} = \@sorted_tags;
117          }          }
118    
119            if (! @sorted_tags) {
120                    print STDERR "WARNING: no tags for this type found in import_xml file!\n";
121            }
122    
123          # lookup key          # lookup key
124          my $lookup_key;          my $lookup_key;
125    
# Line 116  sub data2xml { Line 127  sub data2xml {
127          delete $cache->{display_data};          delete $cache->{display_data};
128          delete $cache->{swish_data};          delete $cache->{swish_data};
129          delete $cache->{swish_exact_data};          delete $cache->{swish_exact_data};
130            delete $cache->{index_data};
131            delete $cache->{index_delimiter};
132            delete $cache->{distinct};
133          my @page_fields;        # names of fields          my @page_fields;        # names of fields
134    
135    
# Line 135  sub data2xml { Line 149  sub data2xml {
149                  } else {                  } else {
150                          print STDERR "WARNING: field '$field' doesn't have 'name' attribute!";                          print STDERR "WARNING: field '$field' doesn't have 'name' attribute!";
151                  }                  }
152    
153                  if ($field_name) {                  if ($field_name) {
154                          return x($field_name);                          $field_name = x($field_name);
155                            if (! $last_field_name) {
156                                    $last_field_name = $field_name;
157                                    return $last_field_name;
158                            } elsif ($field_name ne $last_field_name) {
159                                    $last_field_name = $field_name;
160                                    return $last_field_name;
161                            }
162                    }
163            }
164    
165    
166            # init variables for different types
167            sub init_visible_type($) {
168                    my $type = shift;
169    
170                    # swish, swish_exact, display, index, index_lookup
171                    # swish and display defaults
172                    my ($s,$se,$d,$i,$il) = (1,0,1,0,0);
173                    if (lc($type) eq "display") {
174                            $s = 0;
175                    } elsif (lc($type) eq "swish") {
176                            $d = 0;
177                    } elsif (lc($type) eq "index") {
178                            ($s,$se,$d,$i) = (0,1,0,1);
179                    } elsif (lc($type) eq "swish_exact") {
180                            ($s,$se,$d,$i) = (0,1,0,0);
181                    } elsif (lc($type) =~ /^lookup/) {
182                            ($s,$se,$d,$i,$il) = (0,1,0,0,1);
183                    } elsif ($type) {
184                            print STDERR "WARNING: unknown type: $type\n";
185                  }                  }
186                    return ($s,$se,$d,$i,$il);
187          }          }
188    
189    
190            # convert
191            #
192            # <tag>
193            #  <delimiter>, </delimiter>
194            #  <value>200a</value>
195            # </tag>
196            #
197            # to
198            #
199            # <tag delimiter=", ">200a</tag>
200            #
201            # but without loosing spaces in delimiter (becasue
202            # new XML::Simple strips spaces in attribute values
203            # as defined in XML specification)
204            #
205            sub unroll_x($) {
206                    my $x = shift;
207    
208                    if (defined $x->{value}) {
209                            my ($v,$d) = ($x->{value}->{content}, $x->{delimiter}->{content});
210                            delete $x->{value};
211                            delete $x->{delimiter};
212                            $x->{content} = $v;
213                            $d =~ s#>$## if ($d && $broken_cdata);
214                            $x->{delimiter} = $d;
215                    }
216                    return $x;
217            }
218    
219          # begin real work: go field by field          # begin real work: go field by field
220          foreach my $field (@sorted_tags) {          foreach my $field (@sorted_tags) {
221    
# Line 150  sub data2xml { Line 225  sub data2xml {
225                  my $swish_data = "";                  my $swish_data = "";
226                  my $swish_exact_data = "";                  my $swish_exact_data = "";
227                  my $display_data = "";                  my $display_data = "";
228                    my @index_data;
229                  my $line_delimiter;                  my $line_delimiter;
230    
231                  my ($swish,$display);                  my ($swish,$display);
232    
233                  my $tag = $type2tag{$type} || die "can't find which tag to use for type $type";                  my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type} || die "can't find which tag to use for type $type";
234    
235                  # is this field page-by-page?                  # is this field page-by-page?
236                  my $iterate_by_page = $config->{indexer}->{$field}->{iterate_by_page};                  my $iterate_by_page = $config->{indexer}->{$field}->{iterate_by_page};
# Line 162  sub data2xml { Line 238  sub data2xml {
238                  my %page_max = ();                  my %page_max = ();
239                  # default line_delimiter if using                  # default line_delimiter if using
240                  my $page_line_delimiter = $config->{indexer}->{$field}->{page_line_delimiter} || '<br/>';                  my $page_line_delimiter = $config->{indexer}->{$field}->{page_line_delimiter} || '<br/>';
241                    $cache->{index_delimiter}->{$field} = $config->{indexer}->{$field}->{index_delimiter};
242                    my $distinct = $config->{indexer}->{$field}->{distinct};
243                    if ($distinct && !$iterate_by_page) {
244                            warn "WARNING: distinct is currently not supported without iterate_by_page!\n";
245                            $distinct = 0;
246                    }
247    
248                    my $format_name = $config->{indexer}->{$field}->{format_name};
249                    my $format_delimiter = $config->{indexer}->{$field}->{format_delimiter};
250                    if ($format_name && $format_delimiter) {
251                            $cache->{format}->{$field}->{format_name} = $format_name;
252                            $cache->{format}->{$field}->{format_delimiter} = $format_delimiter;
253                    }
254    
255                  foreach my $x (@{$config->{indexer}->{$field}->{$tag}}) {                  foreach my $x (@{$config->{indexer}->{$field}->{$tag}}) {
256    
257                            $x = unroll_x($x);
258    
259                          my $format = x($x->{content});                          my $format = x($x->{content});
260                          my $delimiter = x($x->{delimiter}) || ' ';                          my $delimiter = x($x->{delimiter}) || ' ';
261    
262                          my $repeat_off = 0;     # init repeatable offset                          my $repeat_off = 0;     # init repeatable offset
263    
264                          # swish, swish_exact, display, index, index_lookup                          my ($s,$se,$d,$i,$il) = init_visible_type($x->{type});
                         # swish and display defaults  
                         my ($s,$se,$d,$i,$il) = (1,0,1,0,0);  
                         $s = 0 if (lc($x->{type}) eq "display");  
                         $d = 0 if (lc($x->{type}) eq "swish");  
                         $se = 1 if (lc($x->{type}) eq "swish_exact");  
                         ($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index");  
                         $il = 1 if (lc($x->{type}) =~ /^lookup/);  
   
265    
266                          # what will separate last line from this one?                          # what will separate last line from this one?
267                          if ($display_data && $x->{append} && $x->{append} eq "1") {                          if ($display_data && $x->{append}) {
268                                  $line_delimiter = ' ';                                  $line_delimiter = $delimiter;
269                          } elsif ($display_data) {                          } elsif ($display_data) {
270                                  $line_delimiter = '<br/>';                                  $line_delimiter = '<br/>';
271                          }                          }
# Line 190  sub data2xml { Line 273  sub data2xml {
273                          # init vars so that we go into while...                          # init vars so that we go into while...
274                          ($swish,$display) = (1,1);                          ($swish,$display) = (1,1);
275    
276                          # placeholder for all repeatable entries for index                          sub mkformat($$) {
                         my @index_data;  
   
                         sub mkformat {  
277                                  my $x = shift || die "mkformat needs tag reference";                                  my $x = shift || die "mkformat needs tag reference";
278                                  my $data = shift || return;                                  my $data = shift || return;
279                                  my $format_name = x($x->{format_name}) || return $data;                                  my $format_name = x($x->{format_name}) || return $data;
# Line 211  sub data2xml { Line 291  sub data2xml {
291                                          if (($#data+1) == $nr) {                                          if (($#data+1) == $nr) {
292                                                  return sprintf($fmt,@data);                                                  return sprintf($fmt,@data);
293                                          } else {                                          } else {
294                                                  print STDERR "mkformat: [$data] can't be split on [$format_delimiter] to $nr fields!\n";                                                  #print STDERR "mkformat: [$data] can't be split on [$format_delimiter] to $nr fields!\n";
295                                                  return $data;                                                  return $data;
296                                          }                                          }
297                                  } else {                                  } else {
# Line 240  sub data2xml { Line 320  sub data2xml {
320                                                                  $display = $new_display;                                                                  $display = $new_display;
321                                                                  $cache->{lhash}->{$display} = $new_display;                                                                  $cache->{lhash}->{$display} = $new_display;
322                                                          } else {                                                          } else {
323                                                                  print STDERR "WARNING: lookup for '$display' didn't find anything.\n";  #                                                               print STDERR "WARNING: lookup for '$display' didn't find anything.\n";
324                                                                  $display = "";                                                                  $display = "";
325                                                                  $cache->{lhash}->{$display} = $null;                                                                  $cache->{lhash}->{$display} = $null;
326                                                          }                                                          }
# Line 261  sub data2xml { Line 341  sub data2xml {
341                                  }                                  }
342                                  # type="swish" ; field for swish                                  # type="swish" ; field for swish
343                                  if ($swish) {                                  if ($swish) {
344                                            my $tmp = $swish;
345                                          if ($filter && ($s || $se)) {                                          if ($filter && ($s || $se)) {
346                                                  no strict 'refs';                                                  no strict 'refs';
347                                                  my $tmp = join(" ",&$filter($swish)) if ($s || $se);                                                  $tmp = join(" ",&$filter($tmp)) if ($s || $se);
                                                 $swish_data .= $tmp if ($s);  
                                                 $swish_exact_data .= $tmp if ($se);  
   
                                         } else {  
                                                 $swish_data .= $swish if ($s);  
                                                 $swish_exact_data .= $swish if ($se);  
348                                          }                                          }
349    
350                                            $swish_data .= $tmp if ($s && $tmp);
351                                            $swish_exact_data .= "xxbxx $tmp xxexx " if ($tmp && $tmp ne "" && $se);
352                                  }                                  }
353    
354                                  # type="display" ; field for display                                  # type="display" ; field for display
355                                  if ($d && $display) {                                  if ($d && $display) {
356                                            my $ldel = $delimiter;
357                                          if ($line_delimiter && $display_data) {                                          if ($line_delimiter && $display_data) {
358                                                  $display_data .= $line_delimiter;                                                  $ldel = $line_delimiter;
359                                          }                                          }
360                                          if ($filter) {                                          if ($filter) {
361                                                  no strict 'refs';                                                  no strict 'refs';
362                                                  if ($display_data) {                                                  my @arr;
363                                                          $display_data .= $delimiter.join($delimiter,mkformat($x,&$filter($display)));                                                  foreach my $tmp (&$filter($display)) {
364                                                  } else {                                                          my $tmp2 = mkformat($x,$tmp);
365                                                          $display_data = join($delimiter,mkformat($x,&$filter($display)));                                                          push @arr,$tmp2 if ($tmp2);
366                                                  }                                                  }
367                                                    $display_data .= $ldel if ($display_data && @arr);
368                                                    $display_data .= join($delimiter,@arr);
369                                          } else {                                          } else {
370                                                  if ($display_data) {                                                  $display_data .= $ldel if ($display_data);
371                                                          $display_data .= $delimiter.mkformat($x,$display);                                                  my $tmp = mkformat($x,$display);
372                                                  } else {                                                  $display_data .= $tmp if ($tmp);
                                                         $display_data = mkformat($x,$display);  
                                                 }  
373                                          }                                          }
374                                  }                                  }
375                                                                                                    
376                                  # type="index" ; insert into index                                  # type="index" ; insert into index
377                                    my $idisplay;
378                                  if ($i && $display) {                                  if ($i && $display) {
379                                            $idisplay = $display;
380                                          if ($filter) {                                          if ($filter) {
381                                                  no strict 'refs';                                                  no strict 'refs';
382                                                  $display = &$filter($display);                                                  $idisplay = &$filter($idisplay);
                                         }  
                                         if ($x->{append} && @index_data) {  
                                                 $index_data[$#index_data].=$display;  
                                         } else {  
                                                 push @index_data, $display;  
383                                          }                                          }
384                                            push @index_data, $idisplay if ($idisplay && !$iterate_by_page);
385                                  }                                  }
386    
387                                  # store fields in lookup                                  # store fields in lookup
# Line 313  sub data2xml { Line 390  sub data2xml {
390                                                  if ($lookup_key) {                                                  if ($lookup_key) {
391                                                          print STDERR "WARNING: try to redefine lookup_key (keys shouldn't be repeatable fields!)";                                                          print STDERR "WARNING: try to redefine lookup_key (keys shouldn't be repeatable fields!)";
392                                                  } else {                                                  } else {
393                                                          $lookup_key = $display;                                                          if ($filter) {
394                                                                    no strict 'refs';
395                                                                    $lookup_key = &$filter($display);
396                                                            } else {
397                                                                    $lookup_key = $display;
398                                                            }
399                                                  }                                                  }
400                                          } elsif (lc($x->{type}) eq "lookup_val") {                                          } elsif (lc($x->{type}) eq "lookup_val") {
401                                                  if ($lookup_key) {                                                  if ($lookup_key) {
402                                                          $lhash{$lookup_key} = $display;                                                          if ($filter) {
403                                                                    no strict 'refs';
404                                                                    $lhash{$lookup_key} = &$filter($display);
405                                                            } else {
406                                                                    $lhash{$lookup_key} = $display;
407                                                            }
408                                                  } else {                                                  } else {
409                                                          print STDERR "WARNING: no lookup_key defined for  '$display'?";                                                          print STDERR "WARNING: no lookup_key defined for  '$display'?";
410                                                  }                                                  }
# Line 330  sub data2xml { Line 417  sub data2xml {
417                                          sub iterate_fld($$$$$$) {                                          sub iterate_fld($$$$$$) {
418                                                  my ($cache,$what,$field,$page,$data,$append) = @_;                                                  my ($cache,$what,$field,$page,$data,$append) = @_;
419                                                  return if (!$data);                                                  return if (!$data);
420                                                  my $line_delimiter = $page_line_delimiter;  
421                                                  $line_delimiter = " " if ($append);                                                  my $ldel = $page_line_delimiter;
422                                                    $ldel = " " if ($append);
423    #print STDERR "line delimiter: ",Dumper($ldel) if ($ldel);
424                                                  if (! $cache->{$what}->{$field}->[$page]) {                                                  if (! $cache->{$what}->{$field}->[$page]) {
425                                                          $cache->{$what}->{$field}->[$page] = $data;                                                          push @{$cache->{$what}->{$field}->[$page]}, {
426                                                  } else {                                                                  data => $data,
427                                                          $cache->{$what}->{$field}->[$page] .= $line_delimiter.$data;                                                                  delimiter => $ldel,
428                                                            };
429                                                  }                                                  }
430                                          }                                          }
431    
432                                          if ($display_data) {                                          if ($display_data) {
 print STDERR "line delimiter: ",Dumper($line_delimiter) if ($line_delimiter);  
433                                                  iterate_fld($cache,'display_data',$field,$page,$display_data,$x->{append});                                                  iterate_fld($cache,'display_data',$field,$page,$display_data,$x->{append});
434                                          }                                          }
435                                                  $display_data = "";                                                  $display_data = "";
# Line 352  print STDERR "line delimiter: ",Dumper($ Line 441  print STDERR "line delimiter: ",Dumper($
441                                                  iterate_fld($cache,'swish_exact_data',$field,$page,$swish_exact_data,$x->{append});                                                  iterate_fld($cache,'swish_exact_data',$field,$page,$swish_exact_data,$x->{append});
442                                                  $swish_exact_data = "";                                                  $swish_exact_data = "";
443                                          }                                          }
444    
445                                            if ($idisplay) {
446                                                    my $ldel=$page_line_delimiter;
447                                                    my @index_data;
448                                                    if ($cache->{index_data}->{$field}->[$page]) {
449    
450                                                            @index_data = @{$cache->{index_data}->{$field}->[$page]};
451                                                    }
452                                                    if ($x->{append}) {
453                                                            if (@index_data) {
454                                                                    $index_data[$#index_data] .= $idisplay;
455                                                            } else {
456                                                                    push @index_data, $idisplay;
457                                                            }
458                                                    } else {
459                                                            push @index_data, $idisplay;
460                                                    }
461                                                    $idisplay = "";
462                                                    @{$cache->{index_data}->{$field}->[$page]} = @index_data;
463                                            }
464                                  }                                  }
465                          }                          }
466    
467                          # fill data in index                          if (! $iterate_by_page) {
468                          foreach my $d (@index_data) {                                  my $idel = $x->{index_delimiter};
469                                  $index->insert($field, $d, $path);                                  # fill data in index
470                                    foreach my $tmp (@index_data) {
471                                            my $i = $d = $tmp;
472                                            if ($idel && $tmp =~ m/$idel/) {
473                                                    ($i,$d) = split(/$idel/,$tmp);
474                                            }
475                                            $index->insert($field, $i, $d, $path);
476                                    }
477                                    @index_data = ();
478                          }                          }
479                  }                  }
480    
481                  # now try to parse variables from configuration file                  # now try to parse variables from configuration file
482                  foreach my $x (@{$config->{indexer}->{$field}->{'config'}}) {                  foreach my $x (@{$config->{indexer}->{$field}->{'config'}}) {
483    
484                            $x = unroll_x($x);
485    
486                          my $delimiter = x($x->{delimiter}) || ' ';                          my $delimiter = x($x->{delimiter}) || ' ';
487                          my $val = $cfg->val($database, x($x->{content}));                          my $val = $cfg->val($database, x($x->{content}));
488    
489                          my ($s,$d,$i) = (1,1,0);        # swish, display default                          # FIXME index_lookup is not supported!
490                          $s = 0 if (lc($x->{type}) eq "display");                          my ($s,$se,$d,$i,$il) = init_visible_type($x->{type});
                         $d = 0 if (lc($x->{type}) eq "swish");  
                         # no support for swish exact in config.  
                         # IMHO, it's useless  
                         ($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index");  
491    
492                          if ($val) {                          if ($val) {
493                                  $display_data .= $delimiter.$val if ($d);                                  $display_data .= $delimiter.$val if ($d);
494                                  $swish_data .= $val if ($s);                                  $swish_data .= " ".$val if ($s);
495                                  $index->insert($field, $val, $path) if ($i);                                  $index->insert($field, $val, $val, $path) if ($i);
496                          }                          }
497    
498                          if ($iterate_by_page) {                          if ($iterate_by_page) {
# Line 385  print STDERR "line delimiter: ",Dumper($ Line 500  print STDERR "line delimiter: ",Dumper($
500                                  # on first page!!!                                  # on first page!!!
501                                  my $page = 0;                                  my $page = 0;
502                                  if ($display_data) {                                  if ($display_data) {
503                                          $cache->{display_data}->{$field}->[$page] = $display_data;                                          push @{$cache->{display_data}->{$field}->[$page]}, { data => $display_data };
504                                          $display_data = "";                                          $display_data = "";
505                                  }                                  }
506                                  if ($swish_data) {                                  if ($swish_data) {
507                                          $cache->{swish_data}->{$field}->[$page] = $swish_data;                                          push @{$cache->{swish_data}->{$field}->[$page]}, { data => $swish_data };
508                                          $swish_data = "";                                          $swish_data = "";
509                                  }                                  }
510                                  if ($swish_exact_data) {                                  if ($swish_exact_data) {
511                                          $cache->{swish_exact_data}->{$field}->[$page] = $swish_exact_data;                                          push @{$cache->{swish_exact_data}->{$field}->[$page]}, { data => $swish_exact_data };
512                                          $swish_exact_data = "";                                          $swish_exact_data = "";
513                                  }                                  }
514                          }                          }
# Line 404  print STDERR "line delimiter: ",Dumper($ Line 519  print STDERR "line delimiter: ",Dumper($
519                          my $nr_pages = $page_max{$field} || next;                          my $nr_pages = $page_max{$field} || next;
520  #print STDERR "field '$field' iterate over ",($nr_pages || 0)," pages...\n";  #print STDERR "field '$field' iterate over ",($nr_pages || 0)," pages...\n";
521  #print STDERR Dumper($cache->{display_data});  #print STDERR Dumper($cache->{display_data});
522                            my $seen;       # used for distinct
523                          for (my $page=0; $page <= $nr_pages; $page++) {                          for (my $page=0; $page <= $nr_pages; $page++) {
524                                    my $display_data;
525                                    my $delimiter = '';
526                                    foreach my $element (@{ $cache->{display_data}->{$field}->[$page] }) {
527                                            my $data = $element->{data};
528                                            die "BUG! no data in element?" unless ($data);
529    
530                                            if ($distinct) {
531                                                    next if ($cache->{distinct}->{$field}->{ $data });
532                                                    $cache->{distinct}->{$field}->{ $data } = 1;
533                                            }
534    
535                                            if ($cache->{format}->{$field}) {
536                                                    my $tmp = mkformat($cache->{format}->{$field},$data);
537                                                    $display_data .= $delimiter . $tmp if ($tmp);
538                                            } else {
539                                                    $display_data .= $delimiter . $data;
540                                            }
541                                            $delimiter = $element->{delimiter} if ($element->{delimiter});
542                                    }
543    
                                 my $display_data = $cache->{display_data}->{$field}->[$page];  
544                                  if ($display_data) { # default                                  if ($display_data) { # default
545                                          if ($field eq "headline") {                                          if ($field eq "headline") {
546                                                  $xml .= xmlify("headline", $display_data);                                                  $xml .= xmlify("headline", $display_data);
# Line 418  print STDERR "line delimiter: ",Dumper($ Line 552  print STDERR "line delimiter: ",Dumper($
552                                          }                                          }
553                                  }                                  }
554                                                                    
555                                  my $swish_data = $cache->{swish_data}->{$field}->[$page];                                  my $swish_data = join(" ",map { $_->{data} } @{ $cache->{swish_data}->{$field}->[$page] });
556                                  if ($swish_data) {                                  if ($swish_data) {
557                                          # remove extra spaces                                          # remove extra spaces
558                                          $swish_data =~ s/ +/ /g;                                          $swish_data =~ s/ +/ /g;
559                                          $swish_data =~ s/ +$//g;                                          $swish_data =~ s/ +$//g;
560    
561                                          $xml .= xmlify($field."_swish", unac_string($codepage,$swish_data));                                          $xml .= xmlify($field."_swish", my_unac_string($codepage,$swish_data));
562                                  }                                  }
563    
564                                  my $swish_exact_data = $cache->{swish_exact_data}->{$field}->[$page];                                  my $swish_exact_data = join(" ", map { $_->{data} } @{ $cache->{swish_exact_data}->{$field}->[$page] });
565                                  if ($swish_exact_data) {                                  if ($swish_exact_data) {
566                                          $swish_exact_data =~ s/ +/ /g;                                          $swish_exact_data =~ s/ +/ /g;
567                                          $swish_exact_data =~ s/ +$//g;                                          $swish_exact_data =~ s/ +$//g;
568    
569                                          # add delimiters before and after word.                                          # add delimiters before and after word.
570                                          # That is required to produce exact match                                          # That is required to produce exact match
571                                          $xml .= xmlify($field."_swish_exact", unac_string($codepage,'xxbxx '.$swish_exact_data.' xxexx'));                                          $xml .= xmlify($field."_swish_exact", my_unac_string($codepage,$swish_exact_data));
572                                    }
573                                    
574                                    my $idel = $cache->{index_delimiter}->{$field};
575                                    foreach my $tmp (@{$cache->{index_data}->{$field}->[$page]}) {
576                                            my $i = $tmp;
577                                            my $d = $tmp;
578                                            if ($idel && $tmp =~ m/$idel/) {
579                                                    ($i,$d) = split(/$idel/,$tmp);
580                                            }
581                                            $index->insert($field, $i, $d, $path);
582    #print STDERR "index [$idel] $field: $i --> $d [$path]\n";
583                                  }                                  }
584                          }                          }
585                    
# Line 456  print STDERR "line delimiter: ",Dumper($ Line 601  print STDERR "line delimiter: ",Dumper($
601                                  $swish_data =~ s/ +/ /g;                                  $swish_data =~ s/ +/ /g;
602                                  $swish_data =~ s/ +$//g;                                  $swish_data =~ s/ +$//g;
603    
604                                  $xml .= xmlify($field."_swish", unac_string($codepage,$swish_data));                                  $xml .= xmlify($field."_swish", my_unac_string($codepage,$swish_data));
605                          }                          }
606    
607                          if ($swish_exact_data) {                          if ($swish_exact_data) {
# Line 465  print STDERR "line delimiter: ",Dumper($ Line 610  print STDERR "line delimiter: ",Dumper($
610    
611                                  # add delimiters before and after word.                                  # add delimiters before and after word.
612                                  # That is required to produce exact match                                  # That is required to produce exact match
613                                  $xml .= xmlify($field."_swish_exact", unac_string($codepage,'xxbxx '.$swish_exact_data.' xxexx'));                                  $xml .= xmlify($field."_swish_exact", my_unac_string($codepage,$swish_exact_data));
614                          }                          }
615                  }                  }
616          }          }
# Line 502  $index = new index_DBI( Line 647  $index = new index_DBI(
647    
648  my $show_progress = $cfg_global->val('global', 'show_progress');  my $show_progress = $cfg_global->val('global', 'show_progress');
649    
650  my $unac_filter = $cfg_global->val('global', 'unac_filter');  my $my_unac_filter = $cfg_global->val('global', 'my_unac_filter');
651  if ($unac_filter) {  if ($my_unac_filter) {
652          require $unac_filter;          print STDERR "using $my_unac_filter to filter characters for search\n";
653            require $my_unac_filter;
654    } else {
655            print STDERR "### fallback to default my_unac_string!\n";
656            eval q{
657            sub main::my_unac_string($$) {
658                    my ($charset, $string) = (@_);
659                    return $string;
660            }
661            };
662  }  }
663    
664  foreach my $database ($cfg->Sections) {  foreach my $database ($cfg->Sections) {
665    
666            # save database name in global variable path for later
667            # (need for index filter creation)
668            $path = $database;
669    
670          my $type = lc($cfg -> val($database, 'type')) || die "$database doesn't have 'type' defined";          my $type = lc($cfg -> val($database, 'type')) || die "$database doesn't have 'type' defined";
671          my $add_xml = $cfg -> val($database, 'xml');    # optional          my $add_xml = $cfg -> val($database, 'xml');    # optional
672    
# Line 516  foreach my $database ($cfg->Sections) { Line 674  foreach my $database ($cfg->Sections) {
674          my $lookup_file = $cfg -> val($database, 'lookup_newfile'); # optional          my $lookup_file = $cfg -> val($database, 'lookup_newfile'); # optional
675          if ($lookup_file) {          if ($lookup_file) {
676                  #tie %lhash, 'GDBM_File', $lookup_file, &GDBM_NEWDB, 0644;                  #tie %lhash, 'GDBM_File', $lookup_file, &GDBM_NEWDB, 0644;
677                    if (! -e $lookup_file) {
678                            open(LOOKUP, "> $lookup_file") || die "can't create $lookup_file': $!";
679                            close(LOOKUP);
680                    }
681                  tie %lhash, 'TDB_File', $lookup_file, TDB_CLEAR_IF_FIRST, O_RDWR, 0644;                  tie %lhash, 'TDB_File', $lookup_file, TDB_CLEAR_IF_FIRST, O_RDWR, 0644;
682                  print STDERR "creating lookup file '$lookup_file'\n";                  print STDERR "creating lookup file '$lookup_file'\n";
683                    # delete memory cache for lookup file
684                    delete $cache->{lhash};
685          }          }
686    
687          # open existing lookup file          # open existing lookup file
# Line 528  foreach my $database ($cfg->Sections) { Line 692  foreach my $database ($cfg->Sections) {
692                  print STDERR "opening lookup file '$lookup_file'\n";                  print STDERR "opening lookup file '$lookup_file'\n";
693          }          }
694    
695  print STDERR "reading ./import_xml/$type.xml\n";          my $import_xml_type = $cfg->val($database, 'import_xml_file') || $type;
696            my $import_xml_file = "./import_xml/$import_xml_type.xml";
697    
698            if (! -r $import_xml_file) {
699                    print STDERR "ERROR: file $import_xml_file not readable skipping!\n";
700                    next;
701            }
702    
703            print STDERR "reading $import_xml_file\n";
704    
705          # extract just type basic          # extract just type basic
706          my $type_base = $type;          my $type_base = $type;
707          $type_base =~ s/_.+$//g;          $type_base =~ s/_.+$//g;
708    
709          $config=XMLin("./import_xml/$type.xml", forcearray => [ $type2tag{$type_base}, 'config', 'format' ], forcecontent => 1);          my $tag = $cfg->val($database, 'import_xml_tag') || $type2tag{$type_base} || die "can't find which tag to use for type $type";
710            $config=XMLin($import_xml_file, ForceArray => [ $tag, 'config', 'format' ], ForceContent => 1 );
711    
712            # check for broken XML::Simple
713            if ( $broken_cdata ) {
714                    map {
715                            $config->{format}->{$_}->{content} =~ s#>$##;
716                    } keys %{ $config->{format} };
717            }
718    
719            # helper for progress bar
720            sub fmt_time {
721                    my $t = shift || 0;
722                    my $out = "";
723    
724                    my ($ss,$mm,$hh) = gmtime($t);
725                    $out .= "${hh}h" if ($hh);
726                    $out .= sprintf("%02d:%02d", $mm,$ss);
727                    $out .= "  " if ($hh == 0);
728                    return $out;
729            }
730    
731          # output current progress indicator          # output current progress indicator
732          my $last_p = 0;          my $last_p = 0;
733            my $start_t = time();
734          sub progress {          sub progress {
735                  return if (! $show_progress);                  return if (! $show_progress);
736                  my $current = shift;                  my $current = shift;
737                  my $total = shift || 1;                  my $total = shift || 1;
738                  my $p = int($current * 100 / $total);                  my $p = int($current * 100 / $total);
739                  if ($p != $last_p) {                  if ($p < $last_p || $current == 1) {
740                          printf STDERR ("%5d / %5d [%-51s] %-2d %% \r",$current,$total,"=" x ($p/2).">", $p );                          $start_t = time();
741                            $last_p = 0;
742                    } elsif ($p != $last_p) {
743                            my $rate = ($current / (time() - $start_t || 1));
744                            my $eta = ($total-$current) / ($rate || 1);
745                            printf STDERR ("%5d [%-38s] %-5d %0.1f/s %s\r",$current,"=" x ($p/3)."$p%>", $total, $rate, fmt_time($eta));
746                          $last_p = $p;                          $last_p = $p;
747                  }                  }
748          }          }
749    
750          my $fake_dir = 1;          my $fake_dir = 1;
751            my $fake_pos = 0;
752            my $last_fake_t = time();
753          sub fakeprogress {          sub fakeprogress {
754                  return if (! $show_progress);                  return if (! $show_progress);
755                  my $current = shift @_;                  my $current = shift @_;
756    
757                  my @ind = ('-','\\','|','/','-','\\','|','/', '-');                  my @ind = ('-','\\','|','/','-','\\','|','/');
758    
759                  $last_p += $fake_dir;                  if ($current < $fake_pos) {
760                  $fake_dir = -$fake_dir if ($last_p > 1000 || $last_p < 0);                          $start_t = time();
761                  if ($last_p % 10 == 0) {                          $last_fake_t = 0;
762                          printf STDERR ("%5d / %5s [%-51s]\r",$current,"?"," " x ($last_p/20).$ind[($last_p/20) % $#ind]);                          $fake_dir = 1;
763                            $fake_pos = 0;
764                    }
765    
766                    if (time()-$last_fake_t >= 1) {
767                            $last_fake_t = time();
768                            $fake_pos += $fake_dir;
769                            $fake_dir = -$fake_dir if ($fake_pos > 38);
770                    }
771    
772                    if ($current % 10 == 0) {
773                            my $rate = ($current / (time() - $start_t || 1));
774                            printf STDERR ("%5d [%-38s] %0.1f/s\r",$current, " " x $fake_pos .$ind[($current / 10) % 8], $rate);
775                  }                  }
776          }          }
777    
778          # now read database          # now read database
 print STDERR "using: $type...\n";  
779    
780          # erase cache for tags by order in this database          # erase cache for tags by order in this database
781          delete $cache->{tags_by_order};          delete $cache->{tags_by_order};
# Line 574  print STDERR "using: $type...\n"; Line 785  print STDERR "using: $type...\n";
785                  my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!";                  my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!";
786    
787                  $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage);
788                  my $db = OpenIsis::open( $isis_db );                  my $db = new Biblio::Isis( isisdb => $isis_db );
   
                 # check if .txt database for OpenIsis is zero length,  
                 # if so, erase it and re-open database  
                 sub check_txt_db {  
                         my $isis_db = shift || die "need isis database name";  
                         my $reopen = 0;  
   
                         if (-e $isis_db.".TXT") {  
                                 print STDERR "WARNING: removing $isis_db.TXT OpenIsis database...\n";  
                                 unlink $isis_db.".TXT" || warn "FATAL: unlink error on '$isis_db.TXT': $!";  
                                 $reopen++;  
                         }  
                         if (-e $isis_db.".PTR") {  
                                 print STDERR "WARNING: removing $isis_db.PTR OpenIsis database...\n";  
                                 unlink $isis_db.".PTR" || warn "FATAL: unlink error on '$isis_db.PTR': $!";  
                                 $reopen++;  
                         }  
                         return OpenIsis::open( $isis_db ) if ($reopen);  
                 }  
   
                 # EOF error  
                 if ($db == -1) {  
                         $db = check_txt_db($isis_db);  
                         if ($db == -1) {  
                                 print STDERR "FATAL: OpenIsis can't open zero size file $isis_db\n";  
                                 next;  
                         }  
                 }  
789    
790                  # OpenIsis::ERR_BADF                  if (! $db) {
791                  if ($db == -4) {                          print STDERR "FATAL: can't read ISIS database: $isis_db, skipping...\n";
                         print STDERR "FATAL: OpenIsis can't find file $isis_db\n";  
                         next;  
                 # OpenIsis::ERR_IO  
                 } elsif ($db == -5) {  
                         print STDERR "FATAL: OpenIsis can't access file $isis_db\n";  
                         next;  
                 } elsif ($db < 0) {  
                         print STDERR "FATAL: OpenIsis unknown error $db with file $isis_db\n";  
792                          next;                          next;
793                  }                  }
794    
795                  my $max_rowid = OpenIsis::maxRowid( $db );                  my $max_rowid = $db->count if ($db);
   
                 # if 0 records, try to rease isis .txt database  
                 if ($max_rowid == 0) {  
                         # force removal of database  
                         $db = check_txt_db($isis_db);  
                         $max_rowid = OpenIsis::maxRowid( $db );  
                 }  
796    
797                  print STDERR "Reading database: $isis_db [$max_rowid rows]\n";                  print STDERR "Reading database: $isis_db [$max_rowid rows]\n";
798    
                 my $path = $database;  
   
799                  for (my $row_id = 1; $row_id <= $max_rowid; $row_id++ ) {                  for (my $row_id = 1; $row_id <= $max_rowid; $row_id++ ) {
800                          my $row = OpenIsis::read( $db, $row_id );                          my $row = $db->to_hash( $row_id );
801                          if ($row && $row->{mfn}) {                          if ($row) {
802            
803                                    $row->{mfn} = $row_id;
804                                    $row->{record} = $db->{record};
805    
806                                  progress($row->{mfn}, $max_rowid);                                  progress($row->{mfn}, $max_rowid);
807    
808                                  my $swishpath = $path."#".int($row->{mfn});                                  my $swishpath = $path."#".int($row->{mfn});
# Line 647  print STDERR "using: $type...\n"; Line 816  print STDERR "using: $type...\n";
816                                  }                                  }
817                          }                          }
818                  }                  }
                 # for this to work with current version of OpenIsis (0.9.0)  
                 # you might need my patch from  
                 # http://www.rot13.org/~dpavlin/projects/openisis-0.9.0-perl_close.diff  
                 OpenIsis::close($db);  
819                  print STDERR "\n";                  print STDERR "\n";
820    
821          } elsif ($type_base eq "excel") {          } elsif ($type_base eq "excel") {
822                  use Spreadsheet::ParseExcel;                  require Spreadsheet::ParseExcel;
823                  use Spreadsheet::ParseExcel::Utility qw(int2col);                  require Spreadsheet::ParseExcel::Utility;
824                    import Spreadsheet::ParseExcel::Utility qw(int2col);
825                                    
826                  $import2cp = Text::Iconv->new($config->{excel_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{excel_codepage},$codepage);
827                  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!";
828    
829                  my $sheet = x($config->{sheet}) || die "no sheet in $type.xml";                  my $sheet = x($config->{sheet}) || die "no sheet in $type.xml";
830                  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";
831                    $start_row--;
832    
833                  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'";
834    
# Line 683  print STDERR "using: $type...\n"; Line 850  print STDERR "using: $type...\n";
850                          for(my $iC = $oWorksheet->{MinCol} ; defined $oWorksheet->{MaxCol} && $iC <= $oWorksheet->{MaxCol} ; $iC++) {                          for(my $iC = $oWorksheet->{MinCol} ; defined $oWorksheet->{MaxCol} && $iC <= $oWorksheet->{MaxCol} ; $iC++) {
851                                  my $cell = $oWorksheet->{Cells}[$iR][$iC];                                  my $cell = $oWorksheet->{Cells}[$iR][$iC];
852                                  if ($cell) {                                  if ($cell) {
853                                          $row->{int2col($iC)} = $cell->Value;                                          # this conversion is a cludge.
854                                            # Files from Excell could have
855                                            # characters which don't fit into
856                                            # destination encoding.
857                                            $row->{int2col($iC)} = $utf2cp->convert($cell->Value) || $cell->Value;
858                                  }                                  }
859                          }                          }
860    
# Line 707  print STDERR "using: $type...\n"; Line 878  print STDERR "using: $type...\n";
878                                  print "Document-Type: XML\n\n$xml\n";                                  print "Document-Type: XML\n\n$xml\n";
879                          }                          }
880                  }                  }
881    
882                    print STDERR "\n";
883    
884          } elsif ($type_base eq "marc") {          } elsif ($type_base eq "marc") {
885    
886                  use MARC;                  require MARC::File::USMARC;
887                                    
888                  $import2cp = Text::Iconv->new($config->{marc_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{marc_codepage},$codepage);
889                  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!";
890    
891                  # optional argument is format                  # optional argument is format
892                  my $format = x($config->{format}) || 'usmarc';                  warn "marc_format is no longer used!" if ($config->{marc_format});
   
893                  print STDERR "Reading MARC file '$marc_file'\n";                  print STDERR "Reading MARC file '$marc_file'\n";
894    
895                  my $marc = new MARC;                  my $marc = MARC::File::USMARC->in( $marc_file );
                 my $nr = $marc->openmarc({  
                                 file=>$marc_file, format=>$format  
                         }) || die "Can't open MARC file '$marc_file'";  
896    
897                  my $i=0;        # record nr.                  if (! $marc) {
898                            print STDERR "FATAL: can't read MARC file: $marc_file, skipping...\n";
899                            next;
900                    }
901    
902                  my $rec;                  # count records in MARC file
903                    sub marc_count {
904                            my $filename = shift || die;
905                            my $file = MARC::File::USMARC->in($filename) || return;
906                            my $count = 0;
907                            while ($file->skip()) {
908                                    $count++;
909                            }
910                            return $count;
911                    }
912    
913                  while ($marc->nextmarc(1)) {                  my $count = marc_count($marc_file) || warn "no records in '$marc_file'?";
914    
915                          # XXX                  my $i = 1;
916                          fakeprogress($i++);  
917                    while( my $rec = $marc->next() ) {
918    
919                            progress($i,$count);
920    
921                          my $swishpath = $database."#".$i;                          my $swishpath = $database."#".$i;
922    
923                          if (my $xml = data2xml($type_base,$marc,$add_xml,$cfg,$database)) {                          if (my $xml = data2xml($type_base,$rec,$add_xml,$cfg,$database)) {
924                                  $xml = $cp2utf->convert($xml);                                  $xml = $cp2utf->convert($xml);
925                                  use bytes;      # as opposed to chars                                  use bytes;      # as opposed to chars
926                                  print "Path-Name: $swishpath\n";                                  print "Path-Name: $swishpath\n";
927                                  print "Content-Length: ".(length($xml)+1)."\n";                                  print "Content-Length: ".(length($xml)+1)."\n";
928                                  print "Document-Type: XML\n\n$xml\n";                                  print "Document-Type: XML\n\n$xml\n";
929                          }                          }
930    
931                            $i++;
932                  }                  }
933    
934                    print STDERR "\n";
935    
936          } elsif ($type_base eq "feed") {          } elsif ($type_base eq "feed") {
937    
938                  $import2cp = Text::Iconv->new($config->{feed_codepage},$codepage);                  $import2cp = Text::Iconv->new($config->{feed_codepage},$codepage);
# Line 783  print STDERR "using: $type...\n"; Line 973  print STDERR "using: $type...\n";
973                  }                  }
974                  # close lookup                  # close lookup
975                  untie %lhash if (%lhash);                  untie %lhash if (%lhash);
976    
977            } elsif ($type_base eq "dbf") {
978    
979                    my $dbf_file = $cfg -> val($database, 'dbf_file') || die "$database doesn't have 'dbf_file' defined!";
980                    my $dbf_codepage = $cfg -> val($database, 'dbf_codepage') || die "$database doesn't have 'dbf_codepage' defined!";
981                    my $dbf_mapping = $cfg -> val($database, 'dbf_mapping') || die "$database doesn't have 'dbf_mapping' defined!";
982    
983                    $import2cp = Text::Iconv->new($dbf_codepage,$codepage);
984                    require XBase;
985                    my $db = new XBase $dbf_file;
986    
987                    if (! $db) {
988                            print STDERR "ERROR: can't read DBF database: $dbf_file, skipping...\n";
989                            next;
990                    }
991    
992                    my $max_rowid = $db->last_record;
993    
994                    print STDERR "Reading database: $dbf_file [$max_rowid rows]\n";
995    
996                    my %dbf2iso;
997                    foreach my $m (split(/[\n\r]+/,$dbf_mapping)) {
998                            my ($col,$fld) = split(/\s+/,$m,2);
999                            $dbf2iso{$col} = $fld;
1000                    }
1001    
1002    #print STDERR "## dbf2iso: ",Dumper(\%dbf2iso),"\n## /dbf2iso\n";
1003    
1004                    # bad, bad...
1005                    require "to_hash.pm";
1006    
1007                    foreach my $row_id (0 .. $max_rowid) {
1008                            my $dbf_row = $db->get_record_as_hash($row_id);
1009                            if ($dbf_row) {
1010    
1011    #print STDERR "## dbf_row: ",Dumper($dbf_row),"\n## /dbf_row\n";
1012                                    # apply mapping from config file
1013                                    # all unspecified records will get _ in
1014                                    # front of them - _DELETE will be __DELETE
1015                                    my $rec;
1016                                    map {
1017                                            my $new_fld = $dbf2iso{$_} || '_'.$_;
1018                                            my $data = $dbf_row->{$_};
1019                                            push @{ $rec->{$new_fld} }, $data if ($data && $data !~ /^(?:\s+|\$a\.|)$/);
1020                                    } keys %{$dbf_row};
1021    #print STDERR "## rec: ",Dumper($rec),"\n## /rec\n";
1022                                    my $row = to_hash($row_id+1, $rec);
1023    
1024                                    $row->{mfn} = $row_id+1;
1025                                    $row->{record} = $rec;
1026    
1027    #print STDERR "## row: ",Dumper($row),"\n## /row\n";
1028                                    progress($row->{mfn}, $max_rowid);
1029    
1030                                    my $swishpath = $path."#".int($row->{mfn});
1031    
1032                                    if (my $xml = data2xml($type_base,$row,$add_xml,$cfg,$database)) {
1033                                            $xml = $cp2utf->convert($xml);
1034                                            use bytes;      # as opposed to chars
1035                                            print "Path-Name: $swishpath\n";
1036                                            print "Content-Length: ".(length($xml)+1)."\n";
1037                                            print "Document-Type: XML\n\n$xml\n";
1038                                    }
1039                            }
1040                    }
1041                    print STDERR "\n";
1042          }          }
1043  }  }
1044    
# Line 797  __END__ Line 1053  __END__
1053    
1054  all2xml.pl - read various file formats and dump XML for SWISH-E  all2xml.pl - read various file formats and dump XML for SWISH-E
1055    
1056    =head1 SYNOPSYS
1057    
1058     $ all2xml.pl [test.conf]
1059    
1060  =head1 DESCRIPTION  =head1 DESCRIPTION
1061    
1062  This command will read ISIS data file using OpenIsis perl module, MARC  This command will read ISIS data file using Biblio::Isis perl module, MARC
1063  records using MARC module and optionally Micro$oft Excel files to  records using MARC::File module and optionally Micro$oft Excel files to
1064  create one XML file for usage with I<SWISH-E> indexer. Dispite it's name,  create one XML file for usage with I<SWISH-E> indexer. Dispite it's name,
1065  this script B<isn't general xml generator> from isis files (isis allready  this script B<isn't general xml generator> from isis files (isis allready
1066  has something like that). Output of this script is tailor-made for SWISH-E.  has something like that). Output of this script is tailor-made for SWISH-E.
1067    
1068    If no configuration file is specified, it will use default one called
1069    C<all2xml.conf>.
1070    
1071  =head1 BUGS  =head1 BUGS
1072    
1073  Documentation is really lacking. However, in true Open Source spirit, source  Documentation is really lacking. However, in true Open Source spirit, source

Legend:
Removed from v.180  
changed lines
  Added in v.747

  ViewVC Help
Powered by ViewVC 1.1.26