--- loncom/xml/lonxml.pm 2005/11/10 21:38:27 1.388 +++ loncom/xml/lonxml.pm 2005/11/15 16:38:12 1.389 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.388 2005/11/10 21:38:27 albertel Exp $ +# $Id: lonxml.pm,v 1.389 2005/11/15 16:38:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -418,6 +418,7 @@ sub inner_xmlparse { my $result; my $token; my $dontpop=0; + my $startredirection = $Apache::lonxml::redirection; while ( $#$pars > -1 ) { while ($token = $$pars['-1']->get_token) { if (($token->[0] eq 'T') || ($token->[0] eq 'C') ) { @@ -528,10 +529,9 @@ sub inner_xmlparse { # } if ($target eq 'grade') { &endredirection(); } - if ( $Apache::lonxml::redirection ) { - &error("Unclean exit of parser, text still being redirected. This is likely due to there being missing end tags."); - while ($Apache::lonxml::redirection) { - $finaloutput.=&endredirection(); + if ( $Apache::lonxml::redirection > $startredirection) { + while ($Apache::lonxml::redirection > $startredirection) { + $finaloutput .= &endredirection(); } } if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) {