--- trunk/all2xml.pl 2003/02/23 08:06:07 34 +++ trunk/all2xml.pl 2003/02/23 15:47:40 35 @@ -78,7 +78,7 @@ my $swish_data = ""; my $display_data = ""; - my $line_delimiter = ""; + my $line_delimiter; my ($swish,$display); @@ -103,13 +103,13 @@ ($s,$d,$i) = (0,0,1) if (lc($x->{type}) eq "index"); #print STDERR "## s: $s d: $d i: $i ## $format ##\n"; - if ($x->{append}) { + # what will separate last line from this one? + if ($display_data && $x->{append} && $x->{append} eq "1") { $line_delimiter = ' '; - } else { + } elsif ($display_data) { $line_delimiter = '
'; } - $display_data .= $line_delimiter if ($display_data && $display); # init vars so that we go into while... ($swish,$display) = (1,1); @@ -138,6 +138,10 @@ # type="display" ; field for display if ($d && $display) { + if ($line_delimiter && $display_data) { + $display_data .= $line_delimiter; + undef $line_delimiter; + } if ($filter) { no strict 'refs'; $display_data .= join($delimiter,&$filter($display)); @@ -169,10 +173,7 @@ #print STDERR "s_d: $swish_data\nd_d: $display_data\n" if ($swish_data); if ($display_data) { - # remove last
- $display_data =~ s/$line_delimiter$//; - - $display_data = $isis_codepage->convert($display_data) || die "Can't convert '$display_data' !"; +# $display_data = $isis_codepage->convert($display_data) || die "Can't convert '$display_data' !"; # FIX: this is removed and replaced by html tag. #$xml .= xmlify($field."_display", $display_data); @@ -193,7 +194,6 @@ } if ($field_name) { $html .= $xml_codepage->convert($field_name); -# $html .= "-->".$field_name."<--"; } $html .= $display_data."###\n"; } @@ -274,6 +274,7 @@ if (my $xml = isis2xml($row,$add_xml)) { #print STDERR "--ret-->$xml\n"; + use bytes; # as opposed to chars print "Path-Name: $path#".int($row->{mfn})."\n"; print "Content-Length: ".(length($xml)+1)."\n"; print "Document-Type: XML\n\n$xml\n";