--- loncom/xml/lonxml.pm 2000/08/16 18:32:58 1.19
+++ loncom/xml/lonxml.pm 2001/05/04 17:33:35 1.70
@@ -2,13 +2,78 @@
# XML Parser Module
#
# last modified 06/26/00 by Alexander Sakharuk
+# 11/6 Gerd Kortemeyer
+# 6/1/1 Gerd Kortemeyer
+# 2/21,3/13 Guy
+# 3/29,5/4 Gerd Kortemeyer
package Apache::lonxml;
-
+use vars
+qw(@pwd @outputstack $redirection $import @extlinks $metamode);
use strict;
use HTML::TokeParser;
use Safe;
+use Safe::Hole;
use Opcode;
+use Apache::Constants qw(:common);
+
+
+sub xmlbegin {
+ my $output='';
+ if ($ENV{'browser.mathml'}) {
+ $output=''
+ .''
+ .']>'
+ .'';
+ } else {
+ $output='';
+ }
+ return $output;
+}
+
+sub xmlend {
+ return '';
+}
+
+sub fontsettings() {
+ my $headerstring='';
+ if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) {
+ $headerstring.=
+ '';
+ }
+ return $headerstring;
+}
+
+sub registerurl {
+ return (<
+ function LONCAPAreg() {
+ if (window.location.pathname!="/res/adm/pages/menu.html") {
+ menu=window.open("","LONCAPAmenu");
+ menu.currentURL=window.location.pathname;
+ menu.currentStale=0;
+ }
+ }
+
+ function LONCAPAstale() {
+ if (window.location.pathname!="/res/adm/pages/menu.html") {
+ menu=window.open("","LONCAPAmenu");
+ menu.currentStale=1;
+ }
+ }
+
+ENDSCRIPT
+}
+
+sub loadevents() {
+ return 'LONCAPAreg();';
+}
+
+sub unloadevents() {
+ return 'LONCAPAstale();';
+}
sub register {
my $space;
@@ -19,30 +84,66 @@ sub register {
$Apache::lonxml::alltags{$temptag}=$space;
}
}
-
+
+sub printalltags {
+ my $temp;
+ foreach $temp (sort keys %Apache::lonxml::alltags) {
+ &Apache::lonxml::debug("$temp -- $Apache::lonxml::alltags{$temp}");
+ }
+}
use Apache::style;
-use Apache::lontexconvert;
use Apache::run;
use Apache::londefdef;
use Apache::scripttag;
+use Apache::edit;
#================================================== Main subroutine: xmlparse
+@pwd=();
+@outputstack = ();
+$redirection = 0;
+$import = 1;
+@extlinks=();
+$metamode = 0;
sub xmlparse {
my ($target,$content_file_string,$safeinit,%style_for_target) = @_;
+ if ($target eq 'meta') {
+ # meta mode is a bit weird only some output is to be turned off
+ #