/[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 40 by dpavlin, Sat Mar 15 21:33:36 2003 UTC revision 44 by dpavlin, Sat Mar 22 22:51:48 2003 UTC
# Line 32  my %opts; Line 32  my %opts;
32    
33  getopts('d:m:qs', \%opts);  getopts('d:m:qs', \%opts);
34    
35  my $db_dir;  my $path;       # this is name of database
36    
37  Text::Iconv->raise_error(1);     # Conversion errors raise exceptions  Text::Iconv->raise_error(1);     # Conversion errors raise exceptions
38    
# Line 153  sub isis2xml { Line 153  sub isis2xml {
153                                          if ($filter) {                                          if ($filter) {
154                                                  no strict 'refs';                                                  no strict 'refs';
155                                                  foreach my $d (&$filter($index_data)) {                                                  foreach my $d (&$filter($index_data)) {
156                                                          $index->insert($field, $d, $db_dir);                                                          $index->insert($field, $d, $path);
157                                                  }                                                  }
158                                          } else {                                          } else {
159                                                  $index->insert($field, $index_data, $db_dir);                                                  $index->insert($field, $index_data, $path);
160                                          }                                          }
161                                  }                                  }
162                          }                          }
# Line 252  foreach my $database ($cfg->Sections) { Line 252  foreach my $database ($cfg->Sections) {
252                                  $last_p = $p;                                  $last_p = $p;
253                          }                          }
254    
255                          if (my $xml = $cp2utf->convert(isis2xml($row,$add_xml))) {                          my $swishpath = $path."#".int($row->{mfn});
256    
257                            if (my $xml = isis2xml($row,$add_xml)) {
258                                    $xml = $cp2utf->convert($xml);
259                                  use bytes;      # as opposed to chars                                  use bytes;      # as opposed to chars
260                                  print "Path-Name: $path#".int($row->{mfn})."\n";                                  print "Path-Name: $swishpath\n";
261                                  print "Content-Length: ".(length($xml)+1)."\n";                                  print "Content-Length: ".(length($xml)+1)."\n";
262                                  print "Document-Type: XML\n\n$xml\n";                                  print "Document-Type: XML\n\n$xml\n";
263                          }                          }

Legend:
Removed from v.40  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26