version 1.221, 2002/12/13 21:39:19
|
version 1.221.2.2, 2003/01/13 22:20:35
|
Line 771 sub inner_xmlparse {
|
Line 771 sub inner_xmlparse {
|
if ($token->[0] eq 'E') { |
if ($token->[0] eq 'E') { |
&end_tag($stack,$parstack,$token); |
&end_tag($stack,$parstack,$token); |
} |
} |
} |
} |
if ($#$pars > -1) { |
if ($#$pars > -1) { |
pop @$pars; |
pop @$pars; |
pop @Apache::lonxml::pwd; |
pop @Apache::lonxml::pwd; |
Line 1113 sub store_counter {
|
Line 1113 sub store_counter {
|
sub get_all_text { |
sub get_all_text { |
my($tag,$pars)= @_; |
my($tag,$pars)= @_; |
&Apache::lonxml::debug("Got a ".ref($pars)); |
&Apache::lonxml::debug("Got a ".ref($pars)); |
|
my $gotfullstack=1; |
if (ref($pars) ne 'ARRAY') { |
if (ref($pars) ne 'ARRAY') { |
|
$gotfullstack=0; |
$pars=[$pars]; |
$pars=[$pars]; |
} |
} |
my $depth=0; |
my $depth=0; |
Line 1122 sub get_all_text {
|
Line 1124 sub get_all_text {
|
if ( $tag =~ m:^/: ) { |
if ( $tag =~ m:^/: ) { |
my $tag=substr($tag,1); |
my $tag=substr($tag,1); |
#&Apache::lonxml::debug("have:$tag:"); |
#&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)) { |
while (($depth >=0) && ($token = $$pars[-1]->get_token)) { |
#&Apache::lonxml::debug("e token:$token->[0]:$depth:$token->[1]:".$#$pars.":".$#Apache::lonxml::pwd); |
#&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')) { |
if (($token->[0] eq 'T')||($token->[0] eq 'C')||($token->[0] eq 'D')) { |
Line 1144 sub get_all_text {
|
Line 1147 sub get_all_text {
|
pop(@$pars); |
pop(@$pars); |
pop(@Apache::lonxml::pwd); |
pop(@Apache::lonxml::pwd); |
} |
} |
|
if (($depth >=0) && ($#$pars == 0) ) { &debug("here4");$top_empty=1; } |
|
} |
|
if ($top_empty && $depth >= 0) { |
|
#never found the end tag ran out of text, throw error send back blank |
|
&error('Never found end tag for <'.$tag.'>'); |
|
if ($gotfullstack) { |
|
my $newstring='</'.$tag.'>'.$result; |
|
&Apache::lonxml::newparser($pars,\$newstring); |
|
} |
|
$result=''; |
} |
} |
} else { |
} else { |
while ($#$pars > -1) { |
while ($#$pars > -1) { |