/[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 6 by dpavlin, Sat Jan 11 06:14:48 2003 UTC revision 7 by dpavlin, Sat Jan 11 16:44:03 2003 UTC
# Line 12  my $config=XMLin(undef, forcearray => [ Line 12  my $config=XMLin(undef, forcearray => [
12    
13  my %opts;  my %opts;
14    
15  getopts('d:m:q', \%opts);  # usage:
16    #       -d directory name
17    #       -m multiple directories
18    #       -q quiet
19    #       -s run swish
20    
21    getopts('d:m:qs', \%opts);
22    
23  my $db_dir = $opts{d} || "ps";  # FIX  my $db_dir = $opts{d} || "ps";  # FIX
24    
# Line 29  sub isis2xml { Line 35  sub isis2xml {
35          my $row = shift @_;          my $row = shift @_;
36    
37          my $xml;          my $xml;
38            $xml->{db_dir} = [ $db_dir ];   # FIX remove?
39    
40          sub isis_sf {          sub isis_sf {
41                  my $row = shift @_;                  my $row = shift @_;
# Line 95  sub isis2xml { Line 102  sub isis2xml {
102    
103                  }                  }
104  #print "--display:$display_data\n--index:$index_data\n";  #print "--display:$display_data\n--index:$index_data\n";
105                  $xml->{$field}->{display} .= $isis_map->tou($display_data)->utf8 if ($display_data);                  #$xml->{$field."_display"} = $isis_map->tou($display_data)->utf8 if ($display_data);
106                  $xml->{$field}->{index} .= unac_string($config->{isis_codepage},$index_data) if ($index_data);                  #$xml->{$field."_index"} = unac_string($config->{isis_codepage},$index_data) if ($index_data);
107                    $xml->{$field."_display" } = [ $isis_map->tou($display_data)->utf8 ] if ($display_data);
108                    $xml->{$field."_index"} = [ unac_string($config->{isis_codepage},$index_data)." jabuka" ] if ($index_data);
109                    
110          }          }
111          if ($xml) {          if ($xml) {
112                  return XMLout($xml, rootname => 'xml', noattr => 1 );                  return XMLout($xml, rootname => 'xml', keeproot => 0, noattr => 0 );
113          } else {          } else {
114                  return;                  return;
115          }          }
# Line 168  foreach my $isis_db (@isis_dbs) { Line 177  foreach my $isis_db (@isis_dbs) {
177                          }                          }
178    
179                          if (my $xml = isis2xml($row)) {                          if (my $xml = isis2xml($row)) {
180                                  print "Path-Name: $isis_db#".$row->{mfn}."\n";                                  my $path = $isis_db;
181                                  print "Content-Length: ".(length($xml)+1)."\n";                                  $path =~ s#$config->{isis_data}/*##g;
182                                  print "Document-Type: XML\n\n$xml\n";                                  my $out = "Path-Name: $path#".$row->{mfn}."\n";
183                                    $out .= "Content-Length: ".(length($xml)+1)."\n";
184                                    $out .= "Document-Type: XML\n\n$xml\n";
185                                    print $out;
186                          }                          }
187                  }                  }
188          }          }

Legend:
Removed from v.6  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26