[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 15 Nov 2005 16:38:12 -0000


albertel		Tue Nov 15 11:38:12 2005 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - inner_xmlparse is renetrant need to preserve the state of Apache::lonxml::redirection 
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.388 loncom/xml/lonxml.pm:1.389
--- loncom/xml/lonxml.pm:1.388	Thu Nov 10 16:38:27 2005
+++ loncom/xml/lonxml.pm	Tue Nov 15 11:38:12 2005
@@ -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 @@
   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 @@
   # }
 
   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')) {