--- loncom/xml/lonxml.pm 2002/05/21 02:26:53 1.171 +++ loncom/xml/lonxml.pm 2002/05/23 21:12:44 1.172 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.171 2002/05/21 02:26:53 albertel Exp $ +# $Id: lonxml.pm,v 1.172 2002/05/23 21:12:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -135,6 +135,9 @@ $prevent_entity_encode=0; # has the dynamic menu been updated to know about this resource $Apache::lonxml::registered=0; +# a pointer the the Apache request object +$Apache::lonxml::request=''; + sub xmlbegin { my $output=''; if ($ENV{'browser.mathml'}) { @@ -511,9 +514,9 @@ sub printalltags { } sub xmlparse { - my ($target,$content_file_string,$safeinit,%style_for_target) = @_; + my ($request,$target,$content_file_string,$safeinit,%style_for_target) = @_; - &setup_globals($target); + &setup_globals($request,$target); #&printalltags(); my @pars = (); my $pwd=$ENV{'request.filename'}; @@ -798,7 +801,8 @@ sub callsub { } sub setup_globals { - my ($target)=@_; + my ($request,$target)=@_; + $Apache::lonxml::request=$request; $Apache::lonxml::registered = 0; @Apache::lonxml::pwd=(); @Apache::lonxml::extlinks=(); @@ -1219,7 +1223,8 @@ ENDNOTFOUND } } if (!$ENV{'form.editmode'} || $ENV{'form.viewmode'}) { - $result = &Apache::lonxml::xmlparse($target,$filecontents,'',%mystyle); + $result = &Apache::lonxml::xmlparse($request,$target,$filecontents, + '',%mystyle); } }