--- loncom/xml/lonxml.pm 2001/11/29 21:38:17 1.140 +++ loncom/xml/lonxml.pm 2001/12/14 22:59:34 1.141 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.140 2001/11/29 21:38:17 albertel Exp $ +# $Id: lonxml.pm,v 1.141 2001/12/14 22:59:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -66,15 +66,24 @@ use Math::Random qw(:all); use Opcode; sub register { - my $space; - my @taglist; - my $temptag; - ($space,@taglist) = @_; - foreach $temptag (@taglist) { - $Apache::lonxml::alltags{$temptag}=$space; + my ($space,@taglist) = @_; + foreach my $temptag (@taglist) { + push(@{ $Apache::lonxml::alltags{$temptag} },$space); } } +sub deregister { + my ($space,@taglist) = @_; + &printalltags(); + foreach my $temptag (@taglist) { + my $tempspace = $Apache::lonxml::alltags{$temptag}[-1]; + if ($tempspace eq $space) { + pop(@{ $Apache::lonxml::alltags{$temptag} }); + } + } + &printalltags(); +} + use Apache::Constants qw(:common); use Apache::lontexconvert; use Apache::style; @@ -425,7 +434,8 @@ sub unloadevents() { sub printalltags { my $temp; foreach $temp (sort keys %Apache::lonxml::alltags) { - &Apache::lonxml::debug("$temp -- $Apache::lonxml::alltags{$temp}"); + &Apache::lonxml::debug("$temp -- ". + join(',',@{ $Apache::lonxml::alltags{$temp} })); } } @@ -644,11 +654,11 @@ sub callsub { my $sub1; no strict 'refs'; my $tag=$token->[1]; - my $space=$Apache::lonxml::alltags{$tag}; + my $space=$Apache::lonxml::alltags{$tag}[-1]; if (!$space) { - $tag=~tr/A-Z/a-z/; + $tag=~tr/A-Z/a-z/; $sub=~tr/A-Z/a-z/; - $space=$Apache::lonxml::alltags{$tag} + $space=$Apache::lonxml::alltags{$tag}[-1] } my $deleted=0; @@ -1044,9 +1054,9 @@ sub handler { } else { $request->content_type('text/html'); } - &Apache::loncommon::no_cache($request); + &Apache::loncommon::no_cache($request); $request->send_http_header; - + return OK if $request->header_only;