version 1.35, 2000/11/06 18:42:38
|
version 1.38, 2000/11/14 22:24:38
|
Line 60 sub xmlparse {
|
Line 60 sub xmlparse {
|
# $safeeval->deny(":base_orig"); |
# $safeeval->deny(":base_orig"); |
$safeinit .= ';$external::target='.$target.';'; |
$safeinit .= ';$external::target='.$target.';'; |
$safeinit .= ';$external::randomseed='.&Apache::lonnet::rndseed().';'; |
$safeinit .= ';$external::randomseed='.&Apache::lonnet::rndseed().';'; |
|
$safeinit .= &Apache::lonnet::getfile('/home/httpd/html/res/adm/includes/default_xml.lcpm'); |
&Apache::run::run($safeinit,$safeeval); |
&Apache::run::run($safeinit,$safeeval); |
#-------------------- Redefinition of the target in the case of compound target |
#-------------------- Redefinition of the target in the case of compound target |
|
|
Line 239 sub initdepth {
|
Line 240 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 277 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 |