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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 10 Jun 2003 14:33:32 -0000


albertel		Tue Jun 10 10:33:32 2003 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - throw processing instructions away in tex mode
  - throw directives awway in tex mode
  - don't emit warning when in tex mode
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.260 loncom/xml/lonxml.pm:1.261
--- loncom/xml/lonxml.pm:1.260	Thu May 29 14:42:22 2003
+++ loncom/xml/lonxml.pm	Tue Jun 10 10:33:32 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.260 2003/05/29 18:42:22 albertel Exp $
+# $Id: lonxml.pm,v 1.261 2003/06/10 14:33:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -501,7 +501,7 @@
   my $dontpop=0;
   while ( $#$pars > -1 ) {
     while ($token = $$pars['-1']->get_token) {
-      if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) {
+      if (($token->[0] eq 'T') || ($token->[0] eq 'C') ) {
 	if ($metamode<1) {
 	    my $text=$token->[1];
 	    if ($token->[0] eq 'C' && $target eq 'tex') {
@@ -510,8 +510,13 @@
 	    }
 	    $result.=$text;
 	}
+      } elsif (($token->[0] eq 'D')) {
+	if ($metamode<1 && $target eq 'web') {
+	    my $text=$token->[1];
+	    $result.=$text;
+	}
       } elsif ($token->[0] eq 'PI') {
-	if ($metamode<1) {
+	if ($metamode<1 && $target eq 'web') {
 	  $result=$token->[2];
 	}
       } elsif ($token->[0] eq 'S') {
@@ -1320,8 +1325,11 @@
 
 sub warning {
   $warningcount++;
-  if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) {
-    print "<b>W</b>ARNING<b>:</b>".join('<br />',@_)."<br />\n";
+  
+  if ($ENV{'form.grade_target'} ne 'tex') {
+      if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) {
+        print "<b>W</b>ARNING<b>:</b>".join('<br />',@_)."<br />\n";
+      }
   }
 }