version 1.83, 2001/05/31 22:38:36
|
version 1.84, 2001/06/02 03:59:59
|
Line 203 sub xmlparse {
|
Line 203 sub xmlparse {
|
$safeeval,\%style_for_target,@parstack); |
$safeeval,\%style_for_target,@parstack); |
} |
} |
} else { |
} else { |
$result = &callsub("start_$token->[1]", $target, $token,\@parstack, |
$result = &callsub("start_$token->[1]", $target, $token, \@stack, |
\@pars, $safeeval, \%style_for_target); |
\@parstack, \@pars, $safeeval, \%style_for_target); |
} |
} |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
#clear out any tags that didn't end |
#clear out any tags that didn't end |
Line 225 sub xmlparse {
|
Line 225 sub xmlparse {
|
} |
} |
|
|
} else { |
} else { |
$result = &callsub("end_$token->[1]", $target, $token, \@parstack, |
$result = &callsub("end_$token->[1]", $target, $token, \@stack, |
\@pars,$safeeval, \%style_for_target); |
\@parstack, \@pars,$safeeval, \%style_for_target); |
} |
} |
} else { |
} else { |
&Apache::lonxml::error("Unknown token event :$token->[0]:$token->[1]:"); |
&Apache::lonxml::error("Unknown token event :$token->[0]:$token->[1]:"); |
Line 287 sub recurse {
|
Line 287 sub recurse {
|
push (@innerstack,$tokenpat->[1]); |
push (@innerstack,$tokenpat->[1]); |
push (@innerparstack,&parstring($tokenpat)); |
push (@innerparstack,&parstring($tokenpat)); |
&increasedepth($tokenpat); |
&increasedepth($tokenpat); |
$partstring = &callsub("start_$tokenpat->[1]", |
$partstring = &callsub("start_$tokenpat->[1]", $target, $tokenpat, |
$target, $tokenpat, \@innerparstack, |
\@innerstack, \@innerparstack, \@pat, |
\@pat, $safeeval, $style_for_target); |
$safeeval, $style_for_target); |
} elsif ($tokenpat->[0] eq 'E') { |
} elsif ($tokenpat->[0] eq 'E') { |
#clear out any tags that didn't end |
#clear out any tags that didn't end |
while ($tokenpat->[1] ne $innerstack[$#innerstack] |
while ($tokenpat->[1] ne $innerstack[$#innerstack] |
Line 297 sub recurse {
|
Line 297 sub recurse {
|
&Apache::lonxml::warning("Unbalanced tags in resource $innerstack['-1']"); |
&Apache::lonxml::warning("Unbalanced tags in resource $innerstack['-1']"); |
pop @innerstack;pop @innerparstack;&decreasedepth($tokenpat); |
pop @innerstack;pop @innerparstack;&decreasedepth($tokenpat); |
} |
} |
$partstring = &callsub("end_$tokenpat->[1]", |
$partstring = &callsub("end_$tokenpat->[1]", $target, $tokenpat, |
$target, $tokenpat, \@innerparstack, |
\@innerstack, \@innerparstack, \@pat, |
\@pat, $safeeval, $style_for_target); |
$safeeval, $style_for_target); |
} else { |
} else { |
&Apache::lonxml::error("Unknown token event :$tokenpat->[0]:$tokenpat->[1]:"); |
&Apache::lonxml::error("Unknown token event :$tokenpat->[0]:$tokenpat->[1]:"); |
} |
} |
Line 332 sub recurse {
|
Line 332 sub recurse {
|
} |
} |
|
|
sub callsub { |
sub callsub { |
my ($sub,$target,$token,$parstack,$parser,$safeeval,$style)=@_; |
my ($sub,$target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $currentstring=''; |
my $currentstring=''; |
my $nodefault; |
my $nodefault; |
{ |
{ |
my $sub1; |
my $sub1; |
no strict 'refs'; |
no strict 'refs'; |
if ($target eq 'edit' && $token->[0] eq 'S') { |
if ($target eq 'edit' && $token->[0] eq 'S') { |
$currentstring = &Apache::edit::tag_start($target,$token,$parstack,$parser, |
$currentstring = &Apache::edit::tag_start($target,$token,$tagstack, |
|
$parstack,$parser, |
$safeeval,$style); |
$safeeval,$style); |
} |
} |
my $tag=$token->[1]; |
my $tag=$token->[1]; |
Line 353 sub callsub {
|
Line 354 sub callsub {
|
#&Apache::lonxml::debug("Calling sub $sub in $space $metamode<br />\n"); |
#&Apache::lonxml::debug("Calling sub $sub in $space $metamode<br />\n"); |
$sub1="$space\:\:$sub"; |
$sub1="$space\:\:$sub"; |
$Apache::lonxml::curdepth=join('_',@Apache::lonxml::depthcounter); |
$Apache::lonxml::curdepth=join('_',@Apache::lonxml::depthcounter); |
($currentstring,$nodefault) = &$sub1($target,$token,$parstack,$parser, |
($currentstring,$nodefault) = &$sub1($target,$token,$tagstack, |
$safeeval,$style); |
$parstack,$parser,$safeeval, |
|
$style); |
} else { |
} else { |
#&Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode<br />\n"); |
#&Apache::lonxml::debug("NOT Calling sub $sub in $space $metamode<br />\n"); |
if ($metamode <1) { |
if ($metamode <1) { |