--- loncom/xml/lonxml.pm 2002/04/04 17:35:57 1.165 +++ loncom/xml/lonxml.pm 2002/05/01 21:40:25 1.168 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.165 2002/04/04 17:35:57 matthew Exp $ +# $Id: lonxml.pm,v 1.168 2002/05/01 21:40:25 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -62,7 +62,7 @@ package Apache::lonxml; use vars qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace); use strict; -use HTML::TokeParser(); +use HTML::LCParser(); use HTML::TreeBuilder(); use HTML::Entities(); use Safe(); @@ -336,26 +336,20 @@ sub registerurl { if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; } if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { my $hwkadd=''; - if ($ENV{'REQUEST_URI'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { + if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { $hwkadd.=(<new($contentref)); + push (@$parser,HTML::LCParser->new($contentref)); $$parser['-1']->xml_mode('1'); -# $$parser['-1']->attr_encoded('1'); if ( $dir eq '' ) { push (@Apache::lonxml::pwd, $Apache::lonxml::pwd[$#Apache::lonxml::pwd]); } else { @@ -1248,7 +1243,8 @@ sub debug { sub error { if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) { - print "ERROR:".join('
',@_)."
\n"; + # If printing in construction space, put the error inside

+    print "ERROR:".join("\n",@_)."\n";
   } else {
     print "An Error occured while processing this resource. The instructor has been notified. 
"; #notify author