--- loncom/xml/lonxml.pm 2002/12/06 19:29:02 1.219 +++ loncom/xml/lonxml.pm 2003/01/09 22:45:50 1.221.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.219 2002/12/06 19:29:02 matthew Exp $ +# $Id: lonxml.pm,v 1.221.2.1 2003/01/09 22:45:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -352,7 +352,7 @@ sub printtokenheader { if ($target eq 'web') { my %idhash=&Apache::lonnet::idrget($tudom,($tuname)); return - ''. + ''. 'Checked out for '.$plainname. '
User: '.$tuname.' at '.$tudom. '
ID: '.$idhash{$tuname}. @@ -813,13 +813,13 @@ sub callsub { } if (!$deleted) { if ($space) { - &Apache::lonxml::debug("Calling sub $sub in $space $metamode"); + #&Apache::lonxml::debug("Calling sub $sub in $space $metamode"); $sub1="$space\:\:$sub"; ($currentstring,$nodefault) = &$sub1($target,$token,$tagstack, $parstack,$parser,$safeeval, $style); } else { - &Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode"); + #&Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode"); if ($metamode <1) { if (defined($token->[4]) && ($metamode < 1)) { $currentstring = $token->[4]; @@ -831,7 +831,7 @@ sub callsub { # &Apache::lonxml::debug("nodefalt:$nodefault:"); if ($currentstring eq '' && $nodefault eq '') { if ($target eq 'edit') { - &Apache::lonxml::debug("doing default edit for $token->[1]"); + #&Apache::lonxml::debug("doing default edit for $token->[1]"); if ($token->[0] eq 'S') { $currentstring = &Apache::edit::tag_start($target,$token); } elsif ($token->[0] eq 'E') { @@ -1122,7 +1122,8 @@ sub get_all_text { 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 @@ sub get_all_text { pop(@$pars); pop(@Apache::lonxml::pwd); } + if (($depth >=0) && ($#$pars == 0) ) { $top_empty=1; } } } else { while ($#$pars > -1) {