Ignore:
Timestamp:
2000-10-03T15:25:51+13:00 (24 years ago)
Author:
paynter
Message:

Uses wv version 0.6.0-gs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/gsConvert.pl

    r1567 r1578  
    230230    ($input_filename, $output_filestem) = @_;
    231231
    232     # print "Processing...\n";
    233 
    234232    # formulate the command
    235     my $wv_home = &util::filename_cat($ENV{'GSDLHOME'},"packages","wv-0.5.44-gs");
    236     my $wvHtml = &util::filename_cat($wv_home, "bin", "wvHtml");
    237     return 0 unless (-e "$wvHtml");
    238     $cmd = "$wvHtml --charset utf-8 \"$input_filename\" >\"$output_filestem.html\" 2>\"$output_filestem.err\"";
     233    my $wv_home = &util::filename_cat($ENV{'GSDLHOME'}, "packages", "unix", "wv");
     234    my $wv_conf = &util::filename_cat($wv_home, "lib", "wv", "wvHtml.xml");
     235    my $wvWare = &util::filename_cat($wv_home, "bin", "wvWare");
     236    return 0 unless (-e "$wvWare");
     237    $cmd = "$wvWare --charset utf-8 --config $wv_conf";
     238    $cmd .= " \"$input_filename\" > \"$output_filestem.html\" 2>\"$output_filestem.err\"";
    239239   
    240240    # execute the command
    241241    if (system($cmd)>0)
    242242    {
    243     print STDERR "Error executing $cmd: $!. Continuing...\n";
    244     }
    245    
     243    print STDERR "Error executing wv converter: $!. Continuing...\n";
     244    }
     245
    246246    # Was the conversion successful?
    247247    if (-e "$output_filestem.html") {
     
    249249    $line = <TMP>;
    250250    close(TMP);
    251     if ($line =~ /DOCTYPE HTML/) {
     251    if ($line && $line =~ /DOCTYPE HTML/) {
    252252        &util::rm("$output_filestem.err");
    253253        return 1;
     
    340340    print HTML '<html><head>
    341341<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
    342 <META NAME="GENERATOR" CONTENT="Greenstone any-to-html">
     342<META NAME="GENERATOR" CONTENT="Greenstone any_to_html">
    343343</head><body>\n\n';
    344344    while (<TEXT>) {
     
    364364    while (<IN>) {
    365365    $line = $_;
    366 
     366   
    367367    # delete anything that isn't a printable character
    368368    $line =~ s/[^\040-\176]+/\n/sg;
    369369
    370370    # delete any string less than 10 characters long
     371    $line =~ s/^[^\n]{0,9}$/\n/mg;
    371372    while ($line =~ /^[^\n]{1,9}$/m) {
    372373        $line =~ s/^[^\n]{0,9}$/\n/mg;
     
    377378    $line =~ s/\n+/\n/gs;
    378379    $line =~ s/^\n//gs;
    379    
     380
    380381    # output whatever is left
    381     if ($line =~ /[^\n]/) {
     382    if ($line =~ /[^\n ]/) {
    382383        print OUT $line;
    383384    }
Note: See TracChangeset for help on using the changeset viewer.