/[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 29 by dpavlin, Sun Feb 23 07:08:54 2003 UTC revision 34 by dpavlin, Sun Feb 23 08:06:07 2003 UTC
# Line 63  sub isis2xml { Line 63  sub isis2xml {
63    
64          my %field_usage;        # counter for usage of each field          my %field_usage;        # counter for usage of each field
65    
66            # sort subrouting using order="" attribute
67            sub by_order {
68                    return 0 if (! $config->{indexer}->{$a}->{order});
69                    return 0 if (! $config->{indexer}->{$b}->{order});
70    
71                    return $config->{indexer}->{$a}->{order} <=>
72                            $config->{indexer}->{$b}->{order} ;
73            }
74    
75          foreach my $field (keys %{$config->{indexer}}) {          foreach my $field (sort by_order keys %{$config->{indexer}}) {
76    
77                  $field_usage{$field}++;                  $field_usage{$field}++;
78    
# Line 72  sub isis2xml { Line 80  sub isis2xml {
80                  my $display_data = "";                  my $display_data = "";
81                  my $line_delimiter = "";                  my $line_delimiter = "";
82    
83                    my ($swish,$display);
84    
85                  foreach my $x (@{$config->{indexer}->{$field}->{isis}}) {                  foreach my $x (@{$config->{indexer}->{$field}->{isis}}) {
86    
87                          my $format = $x->{content};                          my $format = $x->{content};
# Line 93  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                          $display_data .= $line_delimiter if ($display_data && $display_data !~ /$line_delimiter$/);                          if ($x->{append}) {
107                                    $line_delimiter = ' ';
108                            } else {
109                                    $line_delimiter = '<br/>';
110                            }
111    
112                          my ($swish,$display) = (1,1);                          $display_data .= $line_delimiter if ($display_data && $display);
113                            # init vars so that we go into while...
114                            ($swish,$display) = (1,1);
115    
116                          while ($swish || $display) {                          while ($swish || $display) {
117                                  ($swish,$display) = parse_format($format,$row,$isis_i++);                                  ($swish,$display) = parse_format($format,$row,$isis_i++);
# Line 112  sub isis2xml { Line 128  sub isis2xml {
128                                  # type="swish" ; field for swish                                  # type="swish" ; field for swish
129                                  if ($s && $swish) {                                  if ($s && $swish) {
130                                          if ($filter) {                                          if ($filter) {
131  print STDERR "using filter '$filter'\n";  #print STDERR "using filter '$filter'\n";
132                                                  no strict 'refs';                                                  no strict 'refs';
133                                                  $swish_data .= join(" ",&$filter($swish));                                                  $swish_data .= join(" ",&$filter($swish));
134                                          } else {                                          } else {
# Line 147  print STDERR "using filter '$filter'\n"; Line 163  print STDERR "using filter '$filter'\n";
163                                          }                                          }
164                                  }                                  }
165                          }                          }
                         if ($x->{append}) {  
                                 $line_delimiter = ' ';  
                         } else {  
                                 $line_delimiter = '<br/>';  
                         }  
166                  }                  }
167    
168    

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

  ViewVC Help
Powered by ViewVC 1.1.26