/[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 42 by dpavlin, Sat Mar 15 21:48:48 2003 UTC revision 43 by dpavlin, Sat Mar 22 22:43:05 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 124  sub isis2xml { Line 124  sub isis2xml {
124                                          if ($filter) {                                          if ($filter) {
125                                                  no strict 'refs';                                                  no strict 'refs';
126                                                  $swish_data .= join(" ",&$filter($swish));                                                  $swish_data .= join(" ",&$filter($swish));
 print STDERR "#### $swish_data\n";  
127                                          } else {                                          } else {
128                                                  $swish_data .= $swish;                                                  $swish_data .= $swish;
129                                          }                                          }
# Line 154  print STDERR "#### $swish_data\n"; Line 153  print STDERR "#### $swish_data\n";
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 253  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 = $cp2utf->convert(isis2xml($row,$add_xml."<path>$swishpath</path>"))) {
258                                  use bytes;      # as opposed to chars                                  use bytes;      # as opposed to chars
259                                  print "Path-Name: $path#".int($row->{mfn})."\n";                                  print "Path-Name: $swishpath\n";
260                                  print "Content-Length: ".(length($xml)+1)."\n";                                  print "Content-Length: ".(length($xml)+1)."\n";
261                                  print "Document-Type: XML\n\n$xml\n";                                  print "Document-Type: XML\n\n$xml\n";
262                          }                          }

Legend:
Removed from v.42  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.26