Diff for /loncom/xml/lonxml.pm between versions 1.35 and 1.36

version 1.35, 2000/11/06 18:42:38 version 1.36, 2000/11/07 23:39:07
Line 101  sub xmlparse { Line 101  sub xmlparse {
 # if ($target eq 'meta') {$Apache::lonxml::textredirection = 0;}  # if ($target eq 'meta') {$Apache::lonxml::textredirection = 0;}
        #clear out any tags that didn't end         #clear out any tags that didn't end
        while ($token->[1] ne $stack[$#stack]          while ($token->[1] ne $stack[$#stack] 
       && ($#stack > -1)) {pop @stack;pop @parstack;&decreasedepth($token);}        && ($#stack > -1)) {pop @stack;pop @parstack;&decreasedepth($token);&Apache::lonxml::debug("Clearing out stack");}
                 
        if (exists $style_for_target{'/'."$token->[1]"}) {         if (exists $style_for_target{'/'."$token->[1]"}) {
   
Line 239  sub initdepth { Line 239  sub initdepth {
   
 sub increasedepth {  sub increasedepth {
   my ($token) = @_;    my ($token) = @_;
   if ($Apache::lonxml::depth<$Apache::lonxml::olddepth-1) {  
     $#Apache::lonxml::depthcounter--;  
     $Apache::lonxml::olddepth=$Apache::lonxml::depth;  
   }  
   $Apache::lonxml::depth++;    $Apache::lonxml::depth++;
 #  print "<br>s $Apache::lonxml::depth : $Apache::lonxml::olddepth : $token->[1]<br>\n";  
   $Apache::lonxml::depthcounter[$Apache::lonxml::depth]++;    $Apache::lonxml::depthcounter[$Apache::lonxml::depth]++;
   if ($Apache::lonxml::depthcounter[$Apache::lonxml::depth]==1) {    if ($Apache::lonxml::depthcounter[$Apache::lonxml::depth]==1) {
     $Apache::lonxml::olddepth=$Apache::lonxml::depth;      $Apache::lonxml::olddepth=$Apache::lonxml::depth;
   }    }
   #  my $curdepth=join('_',@Apache::lonxml::depthcounter);
   #  print "<br>s $Apache::lonxml::depth : $Apache::lonxml::olddepth : $curdepth : $token->[1]<br>\n";
 }  }
   
 sub decreasedepth {  sub decreasedepth {
   my ($token) = @_;    my ($token) = @_;
   $Apache::lonxml::depth--;    $Apache::lonxml::depth--;
 #  print "<br>e $Apache::lonxml::depth : $Apache::lonxml::olddepth : $token->[1]<br>\n";    if ($Apache::lonxml::depth<$Apache::lonxml::olddepth-1) {
       $#Apache::lonxml::depthcounter--;
       $Apache::lonxml::olddepth=$Apache::lonxml::depth+1;
     }
   #  my $curdepth=join('_',@Apache::lonxml::depthcounter);
   #  print "<br>e $Apache::lonxml::depth : $Apache::lonxml::olddepth : $token->[1] : $curdepth <br>\n";
 }  }
   
 sub get_all_text {  sub get_all_text {
Line 274  sub get_all_text { Line 276  sub get_all_text {
    } elsif ($token->[0] eq 'E')  {     } elsif ($token->[0] eq 'E')  {
      if ( $token->[1] eq $tag) { $depth--; }       if ( $token->[1] eq $tag) { $depth--; }
      #skip sending back the last end tag       #skip sending back the last end tag
      if ($depth > -1) { $result.=$token->[2]; }       if ($depth > -1) { $result.=$token->[2]; } else {
          $pars->unget_token($token);
        }
    }     }
  }   }
  return $result   return $result

Removed from v.1.35  
changed lines
  Added in v.1.36


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>