--- loncom/xml/lonxml.pm 2005/01/30 23:31:12 1.355 +++ loncom/xml/lonxml.pm 2005/02/17 08:34:56 1.356 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.355 2005/01/30 23:31:12 www Exp $ +# $Id: lonxml.pm,v 1.356 2005/02/17 08:34:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -149,20 +149,23 @@ $Apache::lonxml::post_evaluate=1; $Apache::lonxml::warnings_error_header=''; sub xmlbegin { - my $output=''; - @htmlareafields=(); - if ($ENV{'browser.mathml'}) { - $output='<?xml version="1.0"?>' + my ($style)=@_; + my $output=''; + @htmlareafields=(); + if ($ENV{'browser.mathml'}) { + $output='<?xml version="1.0"?>' .'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>' .'<!DOCTYPE html SYSTEM "/adm/MathML/mathml.dtd" ' .'[<!ENTITY mathns "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">'; - } else { - $output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html>'; - } - return $output; + .'xmlns="http://www.w3.org/TR/REC-html40">'; + } else { + $output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>'; + } + if ($style eq 'encode') { + $output=&HTML::Entities::encode($output,'<>&"'); + } + return $output; } sub xmlend { @@ -284,7 +287,7 @@ sub printtokenheader { } } -sub fontsettings() { +sub fontsettings { my $headerstring=''; if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) { $headerstring.=