--- loncom/xml/lonxml.pm 2000/10/11 13:07:49 1.25 +++ loncom/xml/lonxml.pm 2000/10/12 19:43:25 1.28 @@ -50,6 +50,7 @@ sub xmlparse { #need to inspect this class of ops # $safeeval->deny(":base_orig"); $safeinit .= ';$external::target='.$target.';'; + $safeinit .= ';$external::randomseed='.&Apache::lonnet::rndseed().';'; &Apache::run::run($safeinit,$safeeval); #-------------------- Redefinition of the target in the case of compound target @@ -201,17 +202,11 @@ sub callsub { my $sub1; no strict 'refs'; if (my $space=$Apache::lonxml::alltags{$token->[1]}) { -# &Apache::lonxml::debug("Calling sub $sub in $space
\n"); -# if ( $sub eq "start_parserlib" ) { -# print "me:".%$style.":\n"; -# } + #&Apache::lonxml::debug("Calling sub $sub in $space
\n"); $sub1="$space\:\:$sub"; $Apache::lonxml::curdepth=join('_',@Apache::lonxml::depthcounter); $currentstring = &$sub1($target,$token,$parstack,$parser, $safeeval,$style); -# if ( $sub eq "start_parserlib" ) { -# print "me2:".%$style.":"; -# } } else { #&Apache::lonxml::debug("NOT Calling sub $sub in $space
\n"); if (defined($token->[4])) { @@ -296,47 +291,33 @@ sub parstring { } @{$token->[3]}; return $temp; } -#<<<<<<< lonxml.pm sub handler { my $request=shift; my $target='web'; $Apache::lonxml::debug=1; - $request->content_type('text/html'); -# $request->send_http_header; if ($ENV{'browser.mathml'}) { - $request->print( '' - .'' - .']>' - .'' - .''."\n"); - } else { - my $headerstring=''; - if ($ENV{'browser.os'} eq 'mac') { - $headerstring.="\n" - .'' - ."\n\n"; - } - $request->print($headerstring.''."\n"); + $request->content_type('text/xml'); + } else { + $request->content_type('text/html'); } -# $request->print(< -# -#Just test -# -# -#ENDHEADER -# &Apache::lonhomework::send_header($request); + $request->send_http_header; + + return 'OK' if $request->header_only; + + $request->print(&Apache::lontexconvert::header()); + + $request->print(''."\n"); + my $file = "/home/httpd/html".$request->uri; my %mystyle; my $result = ''; $result = Apache::lonxml::xmlparse($target, &Apache::lonnet::getfile($file),'',%mystyle); -# $request->print("Result follows:"); $request->print($result); -# $request->print(":Result ends"); + $request->print(''); + $request->print(&Apache::lontexconvert::footer()); + return 'OK'; } $Apache::lonxml::debug=0;