$on = 0;
$cnt=1;
while(<>) {
	if(/<xgraph>/) {
		print "<applet width=650 height=650 code=\"JavaGraph.class\">\n";
		$on = 1;
		next;
	} elsif(/<\/xgraph>/) {
		print "</applet>\n";
		$on = 0;
		$cnt = 1;
	} elsif($on == 1) {
		chop;
		s/\s*$//;
		s/^\s*//;
		s/\s+/ /g;
		s/\"/\'/g;
		print "<param name=\"RawData",$cnt,"\" value=\"",$_,"\">\n";
		$cnt++;
	} else {
		print $_;
	}
}
print ">\n";
print "</applet>\n";
