/[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 34 by dpavlin, Sun Feb 23 08:06:07 2003 UTC revision 35 by dpavlin, Sun Feb 23 15:47:40 2003 UTC
# Line 78  sub isis2xml { Line 78  sub isis2xml {
78    
79                  my $swish_data = "";                  my $swish_data = "";
80                  my $display_data = "";                  my $display_data = "";
81                  my $line_delimiter = "";                  my $line_delimiter;
82    
83                  my ($swish,$display);                  my ($swish,$display);
84    
# Line 103  sub isis2xml { Line 103  sub isis2xml {
103                          ($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index");                          ($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index");
104  #print STDERR "## s: $s d: $d i: $i ## $format ##\n";    #print STDERR "## s: $s d: $d i: $i ## $format ##\n";  
105    
106                          if ($x->{append}) {                          # what will separate last line from this one?
107                            if ($display_data && $x->{append} && $x->{append} eq "1") {
108                                  $line_delimiter = ' ';                                  $line_delimiter = ' ';
109                          } else {                          } elsif ($display_data) {
110                                  $line_delimiter = '<br/>';                                  $line_delimiter = '<br/>';
111                          }                          }
112    
                         $display_data .= $line_delimiter if ($display_data && $display);  
113                          # init vars so that we go into while...                          # init vars so that we go into while...
114                          ($swish,$display) = (1,1);                          ($swish,$display) = (1,1);
115    
# Line 138  sub isis2xml { Line 138  sub isis2xml {
138    
139                                  # type="display" ; field for display                                  # type="display" ; field for display
140                                  if ($d && $display) {                                  if ($d && $display) {
141                                            if ($line_delimiter && $display_data) {
142                                                    $display_data .= $line_delimiter;
143                                                    undef $line_delimiter;
144                                            }
145                                          if ($filter) {                                          if ($filter) {
146                                                  no strict 'refs';                                                  no strict 'refs';
147                                                  $display_data .= join($delimiter,&$filter($display));                                                  $display_data .= join($delimiter,&$filter($display));
# Line 169  sub isis2xml { Line 173  sub isis2xml {
173  #print STDERR "s_d: $swish_data\nd_d: $display_data\n" if ($swish_data);  #print STDERR "s_d: $swish_data\nd_d: $display_data\n" if ($swish_data);
174                  if ($display_data) {                  if ($display_data) {
175    
176                          # remove last <br>  #                       $display_data = $isis_codepage->convert($display_data) || die "Can't convert '$display_data' !";
                         $display_data =~ s/$line_delimiter$//;  
   
                         $display_data = $isis_codepage->convert($display_data) || die "Can't convert '$display_data' !";  
177                          # FIX: this is removed and replaced by html tag.                          # FIX: this is removed and replaced by html tag.
178                          #$xml .= xmlify($field."_display", $display_data);                          #$xml .= xmlify($field."_display", $display_data);
179    
# Line 193  sub isis2xml { Line 194  sub isis2xml {
194                                  }                                  }
195                                  if ($field_name) {                                  if ($field_name) {
196                                          $html .= $xml_codepage->convert($field_name);                                          $html .= $xml_codepage->convert($field_name);
 #                                       $html .= "-->".$field_name."<--";  
197                                  }                                  }
198                                  $html .= $display_data."###\n";                                  $html .= $display_data."###\n";
199                          }                          }
# Line 274  foreach my $database ($cfg->Sections) { Line 274  foreach my $database ($cfg->Sections) {
274    
275                          if (my $xml = isis2xml($row,$add_xml)) {                          if (my $xml = isis2xml($row,$add_xml)) {
276  #print STDERR "--ret-->$xml\n";  #print STDERR "--ret-->$xml\n";
277                                    use bytes;      # as opposed to chars
278                                  print "Path-Name: $path#".int($row->{mfn})."\n";                                  print "Path-Name: $path#".int($row->{mfn})."\n";
279                                  print "Content-Length: ".(length($xml)+1)."\n";                                  print "Content-Length: ".(length($xml)+1)."\n";
280                                  print "Document-Type: XML\n\n$xml\n";                                  print "Document-Type: XML\n\n$xml\n";

Legend:
Removed from v.34  
changed lines
  Added in v.35

  ViewVC Help
Powered by ViewVC 1.1.26