--- loncom/xml/londefdef.pm 2001/07/03 20:58:27 1.31 +++ loncom/xml/londefdef.pm 2001/08/06 20:41:22 1.32 @@ -264,8 +264,25 @@ sub end_output { if (!$Apache::lonxml::registered) { $currentstring.=''.&Apache::lonxml::registerurl().''; } - $token->[2]->{'onLoad'}.=&Apache::lonxml::loadevents(); - $token->[2]->{'onUnload'}.=&Apache::lonxml::unloadevents(); + my $onLoad=''; + foreach my $key (keys(%{$token->[2]})) { + &Apache::lonxml::debug("testing $key"); + if ($key =~ /^onload$/i) { + &Apache::lonxml::debug("I like $key"); + $onLoad.=$token->[2]->{$key}.';'; + delete($token->[2]->{$key}); + } + } + $token->[2]->{'onLoad'}=$onLoad.&Apache::lonxml::loadevents(); + my $onUnload=''; + foreach my $key (keys(%{$token->[2]})) { + if ($key =~ /^onunload$/i) { + $onUnload.=$token->[2]->{$key}.';'; + delete($token->[2]->{$key}); + } + } + $token->[2]->{'onUnload'}=$onUnload. + &Apache::lonxml::unloadevents(); $currentstring .= '<'.$token->[1]; map {