version 1.354, 2005/01/30 12:56:45
|
version 1.357, 2005/02/26 05:37:23
|
Line 149 $Apache::lonxml::post_evaluate=1;
|
Line 149 $Apache::lonxml::post_evaluate=1;
|
$Apache::lonxml::warnings_error_header=''; |
$Apache::lonxml::warnings_error_header=''; |
|
|
sub xmlbegin { |
sub xmlbegin { |
my $output=''; |
my ($style)=@_; |
@htmlareafields=(); |
my $output=''; |
if ($ENV{'browser.mathml'}) { |
@htmlareafields=(); |
$output='<?xml version="1.0"?>' |
if ($ENV{'browser.mathml'}) { |
.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>' |
$output='<?xml version="1.0"?>' |
.'<!DOCTYPE html SYSTEM "/adm/MathML/mathml.dtd" ' |
#.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n" |
.'[<!ENTITY mathns "http://www.w3.org/1998/Math/MathML">]>' |
# .'<!DOCTYPE html SYSTEM "/adm/MathML/mathml.dtd" ' |
|
|
|
# .'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [<!ENTITY mathns "http://www.w3.org/1998/Math/MathML">] >' |
|
.'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">' |
.'<html xmlns:math="http://www.w3.org/1998/Math/MathML" ' |
.'<html xmlns:math="http://www.w3.org/1998/Math/MathML" ' |
.'xmlns="http://www.w3.org/TR/REC-html40">'; |
.'xmlns="http://www.w3.org/1999/xhtml">'; |
} else { |
} else { |
$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>'; |
<html>'; |
} |
} |
if ($style eq 'encode') { |
return $output; |
$output=&HTML::Entities::encode($output,'<>&"'); |
|
} |
|
return $output; |
} |
} |
|
|
sub xmlend { |
sub xmlend { |
Line 284 sub printtokenheader {
|
Line 289 sub printtokenheader {
|
} |
} |
} |
} |
|
|
sub fontsettings() { |
sub fontsettings { |
my $headerstring=''; |
my $headerstring=''; |
if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) { |
if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) { |
$headerstring.= |
$headerstring.= |
Line 384 sub htmlclean {
|
Line 389 sub htmlclean {
|
# Make standard tags lowercase |
# Make standard tags lowercase |
foreach ('html','body','head','meta','h1','h2','h3','h4','b','i','m', |
foreach ('html','body','head','meta','h1','h2','h3','h4','b','i','m', |
'table','tr','td','th','p','br','hr','img','embed','font', |
'table','tr','td','th','p','br','hr','img','embed','font', |
'a','strong','center','title','basefont') { |
'a','strong','center','title','basefont','li','ol','ul', |
|
'input','select','form','option','script','pre') { |
$raw=~s/\<$_\s*\>/\<$_\>/gis; |
$raw=~s/\<$_\s*\>/\<$_\>/gis; |
$raw=~s/\<\/$_\s*\>/<\/$_\>/gis; |
$raw=~s/\<\/$_\s*\>/<\/$_\>/gis; |
$raw=~s/\<$_\s([^\>]*)\>/<$_ $1\>/gis; |
$raw=~s/\<$_\s([^\>]*)\>/<$_ $1\>/gis; |