3 my $HELM_CONFIGURATION_PREFIX = $ENV{"HELM_CONFIGURATION_PREFIX"};
4 my $HELM_CONFIGURATION_PATH =
5 $HELM_CONFIGURATION_PREFIX."/local/lib/helm/configuration.pl";
6 # next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm
7 require $HELM_CONFIGURATION_PATH;
10 require LWP::UserAgent;
13 $url = $ENV{"REQUEST_URI"};
14 $url =~ s/.*mmlurl=(.*)/$1/;
18 $ua = LWP::UserAgent->new;
19 $request = HTTP::Request->new(GET => "$url");
20 $response = $ua->request($request, \&callback);
23 $content =~ s/\n/ /sg;
24 $content =~ s/<!DOCTYPE[^>]*>//sg;
25 $content =~ s/<\?xml[^?]*\?>//sg;
27 $content =~ s/&/&/g;
28 $content =~ s/<m:/</g;
29 $content =~ s/<\/m:/<\//g;
30 $content =~ s/<math[^>]*>/<math>/sg;
31 $content =~ s/(<\/?semantics[^>]*>)/<!-- $1 -->/sg;
32 $content =~ s/(<annotation-xml)/<!-- $1/sg;
33 $content =~ s/(<\/annotation-xml>)/$1 -->/sg;
34 $content =~ s/<mo helm:xref='[^']*' xlink:href='([^']*)'>([^<]*)<\/mo>/<maction actiontype='href' other='$use_webeqp_url?uri=$1'><mo>$2<\/mo><\/maction>/sg;
35 $content =~ s/<mi helm:xref='[^']*' xlink:href='([^']*)'>([^<]*)<\/mi>/<maction actiontype='href' other='$use_webeqp_url?uri=$1'><mi>$2<\/mi><\/maction>/sg;
36 $content =~ s/helm:xref='[^']*'//sg;
37 $content =~ s/xmlns:helm='[^']*'//sg;
38 $content =~ s/xlink:href='[^']*'//sg;
39 $content =~ s/xmlns:xlink='[^']*'//sg;
40 $content =~ s/<mchar name='([^']*)' \/>/&$1;/sg;
43 Content-type: text/html
45 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
46 "http://www.w3.org/TR/REC-html40/loose.dtd">
49 <title>Generato in automatico a partire da $url</title>
51 <body bgcolor="#ffffff" text="#000000">
52 <applet codebase="http://www.webeq.com/WebEQ/2.2/classes" code="webeq.Main"
53 +width=600 height=2000 align=middle>
54 <param name=eq value="$content">
55 <param name=color value="#cccccc">
56 <param name=parser value="mathml">
57 <param name=size value="14">
63 #=========================