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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 09 Jan 2003 22:45:50 -0000


albertel		Thu Jan  9 17:45:50 2003 EDT

  Modified files:              (Branch: version_0_6)
    /loncom/xml	lonxml.pm 
  Log:
  - backport of 1.223 cahnges
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.221 loncom/xml/lonxml.pm:1.221.2.1
--- loncom/xml/lonxml.pm:1.221	Fri Dec 13 16:39:19 2002
+++ loncom/xml/lonxml.pm	Thu Jan  9 17:45:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.221 2002/12/13 21:39:19 albertel Exp $
+# $Id: lonxml.pm,v 1.221.2.1 2003/01/09 22:45:50 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1122,7 +1122,8 @@
  if ( $tag =~ m:^/: ) { 
    my $tag=substr($tag,1); 
    #&Apache::lonxml::debug("have:$tag:");
-   while (($depth >=0) && ($#$pars > -1)) {
+   my $top_empty=0;
+   while (($depth >=0) && ($#$pars > -1) && (!$top_empty)) {
      while (($depth >=0) && ($token = $$pars[-1]->get_token)) {
        #&Apache::lonxml::debug("e token:$token->[0]:$depth:$token->[1]:".$#$pars.":".$#Apache::lonxml::pwd);
        if (($token->[0] eq 'T')||($token->[0] eq 'C')||($token->[0] eq 'D')) {
@@ -1144,6 +1145,7 @@
        pop(@$pars);
        pop(@Apache::lonxml::pwd);
      }
+     if (($depth >=0) && ($#$pars == 0) ) { $top_empty=1; }
    }
  } else {
      while ($#$pars > -1) {