--- loncom/xml/lonxml.pm 2002/04/10 14:46:30 1.166 +++ loncom/xml/lonxml.pm 2002/04/10 15:19:59 1.167 @@ -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.167 2002/04/10 15:19:59 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(); @@ -654,6 +654,8 @@ sub inner_xmlparse { # $finaloutput.=&endredirection; # } + # Encode any high ASCII characters + $finaloutput=&HTML::Entities::encode($finaloutput,"\200-\377"); if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) { $finaloutput=&afterburn($finaloutput); } @@ -1003,9 +1005,8 @@ sub get_all_text { sub newparser { my ($parser,$contentref,$dir) = @_; - push (@$parser,HTML::TokeParser->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 +1250,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