--- loncom/xml/lonxml.pm 2002/04/04 17:35:57 1.165
+++ 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.165 2002/04/04 17:35:57 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 {
@@ -1248,7 +1249,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