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