version 1.313, 2004/03/23 00:47:48
|
version 1.315, 2004/03/31 05:24:00
|
Line 59
|
Line 59
|
|
|
package Apache::lonxml; |
package Apache::lonxml; |
use vars |
use vars |
qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $prevent_entity_encode $errorcount $warningcount); |
qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $errorcount $warningcount); |
use strict; |
use strict; |
use HTML::LCParser(); |
use HTML::LCParser(); |
use HTML::TreeBuilder(); |
use HTML::TreeBuilder(); |
Line 141 $evaluate = 1;
|
Line 141 $evaluate = 1;
|
# stores the list of active tag namespaces |
# stores the list of active tag namespaces |
@namespace=(); |
@namespace=(); |
|
|
# if 0 all high ASCII characters will be encoded into HTML Entities |
|
$prevent_entity_encode=0; |
|
|
|
# has the dynamic menu been updated to know about this resource |
# has the dynamic menu been updated to know about this resource |
$Apache::lonxml::registered=0; |
$Apache::lonxml::registered=0; |
|
|
Line 517 sub inner_xmlparse {
|
Line 514 sub inner_xmlparse {
|
} |
} |
} |
} |
|
|
# Encode any high ASCII characters |
|
# if (!$Apache::lonxml::prevent_entity_encode) { |
|
# $result=&HTML::Entities::encode($result,"\200-\377"); |
|
# } |
|
if ($Apache::lonxml::redirection) { |
if ($Apache::lonxml::redirection) { |
$Apache::lonxml::outputstack['-1'] .= $result; |
$Apache::lonxml::outputstack['-1'] .= $result; |
} else { |
} else { |
Line 967 sub get_all_text {
|
Line 960 sub get_all_text {
|
#never found the end tag ran out of text, throw error send back blank |
#never found the end tag ran out of text, throw error send back blank |
&error('Never found end tag for <'.$tag. |
&error('Never found end tag for <'.$tag. |
'> current string <pre>'. |
'> current string <pre>'. |
&HTML::Entities::encode($result). |
&HTML::Entities::encode($result,'<>&"'). |
'</pre>'); |
'</pre>'); |
if ($gotfullstack) { |
if ($gotfullstack) { |
my $newstring='</'.$tag.'>'.$result; |
my $newstring='</'.$tag.'>'.$result; |
Line 1144 SIMPLECONTENT
|
Line 1137 SIMPLECONTENT
|
|
|
sub inserteditinfo { |
sub inserteditinfo { |
my ($result,$filecontents,$filetype)=@_; |
my ($result,$filecontents,$filetype)=@_; |
$filecontents = &HTML::Entities::encode($filecontents); |
$filecontents = &HTML::Entities::encode($filecontents,'<>&"'); |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
# my $editheader='<a href="#editsection">Edit below</a><hr />'; |
my $xml_help = ''; |
my $xml_help = ''; |
if ($filetype eq 'html') { |
if ($filetype eq 'html') { |
Line 1329 sub debug {
|
Line 1322 sub debug {
|
$|=1; |
$|=1; |
my $request=$Apache::lonxml::request; |
my $request=$Apache::lonxml::request; |
if (!$request) { $request=Apache->request; } |
if (!$request) { $request=Apache->request; } |
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n"); |
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."</pre></font>\n"); |
} |
} |
} |
} |
|
|