--- loncom/xml/lonxml.pm 2002/04/10 14:46:30 1.166 +++ 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.166 2002/04/10 14:46:30 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 { @@ -1249,7 +1244,7 @@ sub debug { sub error { if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) { # If printing in construction space, put the error inside

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