--- loncom/xml/lonxml.pm 2001/03/26 17:32:14 1.62 +++ loncom/xml/lonxml.pm 2001/03/27 17:47:43 1.64 @@ -249,13 +249,13 @@ sub callsub { $safeeval,$style); } if (my $space=$Apache::lonxml::alltags{$token->[1]}) { - &Apache::lonxml::debug("Calling sub $sub in $space $metamode
\n"); +# &Apache::lonxml::debug("Calling sub $sub in $space $metamode
\n"); $sub1="$space\:\:$sub"; $Apache::lonxml::curdepth=join('_',@Apache::lonxml::depthcounter); $currentstring .= &$sub1($target,$token,$parstack,$parser, $safeeval,$style); } else { - &Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode
\n"); +# &Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode
\n"); if ($metamode <1) { if (defined($token->[4]) && ($metamode < 1)) { $currentstring .= $token->[4]; @@ -411,13 +411,13 @@ sub handler { my $request=shift; my $target='web'; - $Apache::lonxml::debug=0; + $Apache::lonxml::debug=1; if ($ENV{'browser.mathml'}) { $request->content_type('text/xml'); } else { $request->content_type('text/html'); } - + # $request->print(< # @@ -427,12 +427,13 @@ sub handler { #ENDHEADER # &Apache::lonhomework::send_header($request); $request->send_http_header; - + return OK if $request->header_only; - $request->print(&Apache::lontexconvert::header()); - - $request->print(''."\n"); + if ($target eq 'web') { + $request->print(&Apache::lontexconvert::header()); + $request->print(''."\n"); + } my $file=&Apache::lonnet::filelocation("",$request->uri); my %mystyle; @@ -447,8 +448,13 @@ sub handler { $request->print($result); - $request->print(''); - $request->print(&Apache::lontexconvert::footer()); + if ($target eq 'tex') { +# $request->print('\end{document}'."\n"); + } elsif ($target eq 'web') { + $request->print(''); + $request->print(&Apache::lontexconvert::footer()); + } + writeallows($request->uri); return OK; }