[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 18 Apr 2006 20:55:26 -0000


albertel		Tue Apr 18 16:55:26 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/xml	lonxml.pm 
  Log:
  - move xmlbegin to loncommon
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.340 loncom/interface/loncommon.pm:1.341
--- loncom/interface/loncommon.pm:1.340	Tue Apr 18 16:50:30 2006
+++ loncom/interface/loncommon.pm	Tue Apr 18 16:55:14 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.340 2006/04/18 20:50:30 albertel Exp $
+# $Id: loncommon.pm,v 1.341 2006/04/18 20:55:14 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3126,6 +3126,38 @@
     return $headerstring;
 }
 
+=pod
+
+=over 4
+
+=item * &xml_begin()
+
+Returns the needed doctype and <html>
+
+Inputs: none
+
+=back
+
+=cut
+
+sub xml_begin {
+    my $output='';
+
+    @Apache::lonxml::htmlareafields=();
+    if ($env{'browser.mathml'}) {
+	$output='<?xml version="1.0"?>'
+            #.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n"
+#            .'<!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" ' 
+	    .'xmlns="http://www.w3.org/1999/xhtml">';
+    } 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;
+}
 
 =pod
 
@@ -3219,7 +3251,7 @@
     my $result;
     if (! exists($args->{'skip_phases'}{'head'}) ) {
 	$result.=
-	    &Apache::lonxml::xmlbegin().
+	    &xml_begin().
 	    &headtag($title,$head_extra,\%head_args).&endheadtag();
     }
     
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.408 loncom/xml/lonxml.pm:1.409
--- loncom/xml/lonxml.pm:1.408	Tue Apr 18 16:50:45 2006
+++ loncom/xml/lonxml.pm	Tue Apr 18 16:55:26 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.408 2006/04/18 20:50:45 albertel Exp $
+# $Id: lonxml.pm,v 1.409 2006/04/18 20:55:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -162,28 +162,6 @@
     $Apache::lonxml::substitute_LaTeX_symbols = 0;
 }
 
-sub xmlbegin {
-    my ($style)=@_;
-    my $output='';
-    @htmlareafields=();
-    if ($env{'browser.mathml'}) {
-	$output='<?xml version="1.0"?>'
-            #.'<?xml-stylesheet type="text/css" href="/adm/MathML/mathml.css"?>'."\n"
-#            .'<!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" ' 
-	    .'xmlns="http://www.w3.org/1999/xhtml">';
-    } 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 {
     my ($target,$parser)=@_;
     my $mode='xml';