From: Claudio Sacerdoti Coen Date: Fri, 2 Feb 2001 16:12:06 +0000 (+0000) Subject: getxslt added X-Git-Tag: v0_1_2~145 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=334e20b9e4e3976c2c95928f5b2b4a5fc5db81da;p=helm.git getxslt added --- diff --git a/helm/http_getter/http_getter.pl.in b/helm/http_getter/http_getter.pl.in index 43c7ff079..cd474f17b 100755 --- a/helm/http_getter/http_getter.pl.in +++ b/helm/http_getter/http_getter.pl.in @@ -34,6 +34,8 @@ if (defined ($HELM_LIB_DIR)) { $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl"; } +$styles_dir = $ENV{"HELM_STYLE_DIR"} if (defined ($ENV{"HELM_STYLE_DIR"})); + # : TODO temporary, move this setting to configuration file # set the cache mode, may be "gzipped" or "normal" my $cachemode = $ENV{'HTTP_GETTER_CACHE_MODE'} || 'gzipped'; @@ -227,6 +229,20 @@ EOT } else { die "Could not find DTD!"; } + } elsif ($http_method eq 'GET' and $http_path eq "/getxslt") { + my $filename = $inputuri; + $filename = $styles_dir."/".$filename; + print "XSLT: $inputuri ==> ($filename)\n"; + if (stat($filename)) { + print "Using local copy\n"; + open(FD, $filename) or die "Cannot open $filename\n"; + $cont = ""; + while() { $cont .= $_; } + close(FD); + answer($c,$cont); + } else { + die "Could not find XSLT!"; + } } elsif ($http_method eq 'GET' and $http_path eq "/conf") { my $quoted_html_link = $html_link; $quoted_html_link =~ s/&/&/g;