--- loncom/xml/lonxml.pm 2001/03/26 15:42:05 1.61 +++ loncom/xml/lonxml.pm 2001/03/27 17:47:43 1.64 @@ -249,17 +249,19 @@ sub callsub { $safeeval,$style); } if (my $space=$Apache::lonxml::alltags{$token->[1]}) { - #&Apache::lonxml::debug("Calling sub $sub in $space
\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
\n"); - if (defined($token->[4]) && ($metamode < '1')) { - $currentstring .= $token->[4]; - } else { - $currentstring .= $token->[2]; +# &Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode
\n"); + if ($metamode <1) { + if (defined($token->[4]) && ($metamode < 1)) { + $currentstring .= $token->[4]; + } else { + $currentstring .= $token->[2]; + } } } if ($target eq 'edit' && $token->[0] eq 'E') { @@ -409,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(< # @@ -425,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; @@ -445,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; }