File:  [LON-CAPA] / loncom / xml / londefdef.pm
Revision 1.40: download - view: text, annotated - select for diffs
Thu Jan 17 17:42:34 2002 UTC (22 years, 4 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- generate the edit button in the <body> tag.

    1: # The LearningOnline Network with CAPA
    2: # Tags Default Definition Module 
    3: #
    4: # $Id: londefdef.pm,v 1.40 2002/01/17 17:42:34 albertel Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: # Copyright for TtHfunc and TtMfunc by Ian Hutchinson. 
   29: # TtHfunc and TtMfunc (the "Code") may be compiled and linked into 
   30: # binary executable programs or libraries distributed by the 
   31: # Michigan State University (the "Licensee"), but any binaries so 
   32: # distributed are hereby licensed only for use in the context
   33: # of a program or computational system for which the Licensee is the 
   34: # primary author or distributor, and which performs substantial 
   35: # additional tasks beyond the translation of (La)TeX into HTML.
   36: # The C source of the Code may not be distributed by the Licensee
   37: # to any other parties under any circumstances.
   38: #
   39: #
   40: # last modified 06/26/00 by Alexander Sakharuk
   41: # 11/6,11/30,02/01/01,5/4 Gerd Kortemeyer
   42: 
   43: package Apache::londefdef; 
   44: 
   45: use strict;
   46: use Apache::lonxml;
   47: 
   48: BEGIN {
   49: 
   50:     &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset'));
   51: 
   52: }
   53: 
   54: #======================= TAG SUBROUTINES =====================
   55: #-- <output>
   56: sub start_output {
   57:   my ($target) = @_;
   58:   if ($target eq 'meta') { $Apache::lonxml::metamode--; }
   59:   return '';
   60: }
   61: sub end_output {
   62:   my ($target) = @_;
   63:   if ($target eq 'meta') { $Apache::lonxml::metamode++; }
   64:   return '';
   65: }
   66: #-- <m> tag
   67: sub start_m {
   68:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
   69:   my $currentstring = '';
   70:   if ($target eq 'web') {
   71:     my $inside = &Apache::lonxml::get_all_text("/m",$$parser[-1]);
   72:     $inside ='\\documentstyle{article}'.$inside;
   73:     &Apache::lonxml::debug("M is starting with:$inside:");
   74:     my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
   75:     if ($eval eq 'on') {
   76:       $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
   77:       #&Apache::lonxml::debug("M is evaulated to:$inside:");
   78:     }
   79:     $currentstring = &Apache::lontexconvert::converted(\$inside);
   80:     if ($Apache::lontexconvert::errorstring) {
   81:       &Apache::lonxml::warning("tth error: ".
   82: 			       $Apache::lontexconvert::errorstring);
   83:       $Apache::lontexconvert::errorstring='';
   84:     }
   85:     #&Apache::lonxml::debug("M is ends with:$currentstring:");
   86:   } elsif ($target eq 'tex') {
   87:     $currentstring = "";
   88:   }
   89:   return $currentstring;
   90: }
   91: sub end_m {
   92:   my ($target,$token) = @_;
   93:   my $currentstring = '';
   94:   if ($target eq 'web') {
   95:   } elsif ($target eq 'tex') {
   96:     $currentstring = "";
   97:   } elsif ($target eq 'meta') {
   98:   }
   99:   return $currentstring;
  100: }
  101: #-- <html> tag    
  102:       sub start_html {
  103: 	    my ($target,$token) = @_;
  104:             my $currentstring = ''; 
  105: 	    if ($ENV{'browser.mathml'}) {
  106: 	      &tth::ttminit();
  107: 	    } else {
  108: 	      &tth::tthinit();
  109: 	    }
  110:             if ($target eq 'web') {
  111:               $currentstring = &Apache::lonxml::xmlbegin().
  112:                                &Apache::lonxml::fontsettings();     
  113: 	    } elsif ($target eq 'tex') {
  114: 	      $currentstring .= '\documentclass[letterpaper]{article}
  115:                                  \setlength{\oddsidemargin}{-40pt}
  116:                                  \setlength{\evensidemargin}{-60pt}
  117:                                  \setlength{\topmargin}{200pt}
  118:                                  \setlength{\textwidth}{4.4in}
  119:                                  \setlength{\textheight}{6.8in}
  120:                                  \setlength{\parindent}{20pt}
  121:                                  \setlength{\marginparwidth}{90pt}
  122:                                  \setlength{\textfloatsep}{8pt plus 2.0pt minus 4.0pt}
  123:                                  \newcommand{\keephidden}[1]{}';
  124: 	    }
  125: 	   return $currentstring;
  126: 	}
  127:         sub end_html {
  128: 	    my ($target,$token) = @_;
  129:             my $currentstring = '';
  130:             if ($target eq 'web') {
  131: 		$currentstring = &Apache::lonxml::xmlend();
  132: 	    }
  133: 	   return $currentstring;
  134: 	}
  135: #-- <head> tag
  136:       sub start_head {
  137: 	    my ($target,$token) = @_;
  138:             my $currentstring = '';
  139:             if ($target eq 'web') {
  140:               $currentstring = $token->[4];     
  141: 	    } 
  142: 	   return $currentstring;
  143: 	}
  144:         sub end_head {
  145: 	    my ($target,$token) = @_;
  146:             my $currentstring = '';
  147:             if ($target eq 'web') {
  148:               $currentstring = &Apache::lonxml::registerurl().
  149:                                $token->[2];    
  150:             } 
  151: 	   return $currentstring;
  152: 	}
  153: #-- <map> tag
  154:       sub start_map {
  155: 	    my ($target,$token) = @_;
  156:             my $currentstring = '';
  157:             if ($target eq 'web') {
  158:               $currentstring = $token->[4];     
  159: 	    } 
  160: 	   return $currentstring;
  161: 	}
  162:         sub end_map {
  163: 	    my ($target,$token) = @_;
  164:             my $currentstring = '';
  165:             if ($target eq 'web') {
  166:               $currentstring = $token->[2];    
  167:             } 
  168: 	   return $currentstring;
  169: 	}
  170: #-- <select> tag
  171:       sub start_select {
  172: 	    my ($target,$token) = @_;
  173:             my $currentstring = '';
  174:             if ($target eq 'web') {
  175:               $currentstring = $token->[4];     
  176: 	    } 
  177: 	   return $currentstring;
  178: 	}
  179:         sub end_select {
  180: 	    my ($target,$token) = @_;
  181:             my $currentstring = '';
  182:             if ($target eq 'web') {
  183:               $currentstring = $token->[2];    
  184:             } 
  185: 	   return $currentstring;
  186: 	}
  187: #-- <option> tag
  188:       sub start_option {
  189: 	    my ($target,$token) = @_;
  190:             my $currentstring = '';
  191:             if ($target eq 'web') {
  192:               $currentstring = $token->[4];     
  193: 	    } 
  194: 	   return $currentstring;
  195: 	}
  196:         sub end_option {
  197: 	    my ($target,$token) = @_;
  198:             my $currentstring = '';
  199:             if ($target eq 'web') {
  200:               $currentstring = $token->[2];    
  201:             } 
  202: 	   return $currentstring;
  203: 	}
  204: #-- <input> tag
  205:       sub start_input {
  206: 	    my ($target,$token) = @_;
  207:             my $currentstring = '';
  208:             if ($target eq 'web') {
  209:               $currentstring = $token->[4];     
  210: 	    } 
  211: 	   return $currentstring;
  212: 	}
  213:         sub end_input {
  214: 	    my ($target,$token) = @_;
  215:             my $currentstring = '';
  216:             if ($target eq 'web') {
  217:               $currentstring = $token->[2];    
  218:             } 
  219: 	   return $currentstring;
  220: 	}
  221: #-- <textarea> tag
  222:       sub start_textarea {
  223: 	    my ($target,$token) = @_;
  224:             my $currentstring = '';
  225:             if ($target eq 'web') {
  226:               $currentstring = $token->[4];     
  227: 	    } 
  228: 	   return $currentstring;
  229: 	}
  230:         sub end_textarea {
  231: 	    my ($target,$token) = @_;
  232:             my $currentstring = '';
  233:             if ($target eq 'web') {
  234:               $currentstring = $token->[2];    
  235:             } 
  236: 	   return $currentstring;
  237: 	}
  238: #-- <form> tag
  239:       sub start_form {
  240: 	    my ($target,$token) = @_;
  241:             my $currentstring = '';
  242:             if ($target eq 'web') {
  243:               $currentstring = $token->[4];     
  244: 	    } 
  245: 	   return $currentstring;
  246: 	}
  247:         sub end_form {
  248: 	    my ($target,$token) = @_;
  249:             my $currentstring = '';
  250:             if ($target eq 'web') {
  251:               $currentstring = $token->[2];    
  252:             } 
  253: 	   return $currentstring;
  254: 	}
  255: #-- <title> tag
  256:       sub start_title {
  257: 	    my ($target,$token) = @_;
  258:             my $currentstring = '';
  259:             if ($target eq 'web') {
  260:               $currentstring = $token->[4];     
  261: 	    } elsif ($target eq 'tex') {
  262:               $currentstring .= '\keephidden{' 
  263: 	    }
  264:             if ($target eq 'meta') {
  265: 		$currentstring='<title>';
  266:                 &start_output();
  267:             }
  268: 	   return $currentstring;
  269: 	}
  270:         sub end_title {
  271: 	    my ($target,$token) = @_;
  272:             my $currentstring = '';
  273:             if ($target eq 'web') {
  274:               $currentstring = $token->[2];    
  275:             } elsif ($target eq 'tex') {
  276:               $currentstring .= '}';
  277: 	    }  
  278:             if ($target eq 'meta') {
  279:                &end_output();
  280:                $currentstring='</title>';
  281:             } 
  282: 	   return $currentstring;
  283: 	}
  284: #-- <meta> tag
  285:       sub start_meta {
  286: 	    my ($target,$token,$tagstack,$parstack,$parser) = @_;
  287:             my $currentstring = '';
  288:             if ($target eq 'web') {
  289: 	      my $args='';
  290: 	      if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
  291: 	      if ($args eq '') {
  292: 		&Apache::lonxml::get_all_text("/meta",$$parser[$#$parser]);
  293: 	      } else {
  294: 		$currentstring = $token->[4];
  295: 	      }
  296: 	    }
  297:             if ($target eq 'meta') {
  298: 		unless ($token->[2]->{'http-equiv'}) {
  299: 		    my $name=$token->[2]->{'name'};
  300:                     $name=~tr/A-Z/a-z/;
  301:                     $name=~s/\s/\_/g;
  302:                     if ($name) {
  303:                        $currentstring='<'.$name.'>'.
  304:                                          $token->[2]->{'content'}.
  305: 			              '</'.$name.'>';
  306: 		    }
  307:                 }
  308: 	    }
  309: 	   return $currentstring;
  310: 	}
  311:       sub end_meta {
  312: 	my ($target,$token,$tagstack,$parstack,$parser) = @_;
  313: 	my $currentstring = '';
  314: 	if ($target eq 'web') {
  315: 	  my $args='';
  316: 	  if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
  317: 	  if ($args ne '') {
  318: 	    $currentstring = $token->[4];
  319: 	  }
  320: 	} 
  321: 	return $currentstring;
  322:       }
  323: #-- <body> tag
  324:         sub start_body {
  325: 	    my ($target,$token) = @_;
  326:             my $currentstring = '';
  327:             if ($target eq 'web') {
  328: 	      if (!$Apache::lonxml::registered) {
  329: 		$currentstring.='<head>'.&Apache::lonxml::registerurl().'</head>';
  330: 	      }
  331: 	      my $onLoad='';
  332: 	      foreach my $key (keys(%{$token->[2]})) {
  333: 		if ($key =~ /^onload$/i) {
  334: 		  $onLoad.=$token->[2]->{$key}.';';
  335: 		  delete($token->[2]->{$key});
  336: 		}
  337: 	      }
  338: 	      $token->[2]->{'onLoad'}=$onLoad.&Apache::lonxml::loadevents();
  339: 	      my $onUnload='';
  340: 	      foreach my $key (keys(%{$token->[2]})) {
  341: 		if ($key =~ /^onunload$/i) {
  342: 		  $onUnload.=$token->[2]->{$key}.';';
  343: 		  delete($token->[2]->{$key});
  344: 		}
  345: 	      }
  346: 	      $token->[2]->{'onUnload'}=$onUnload.
  347: 		&Apache::lonxml::unloadevents();
  348: 
  349: 	      $currentstring .= '<'.$token->[1];
  350: 	      foreach (keys %{$token->[2]}) {
  351: 	      	$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"';
  352: 	      }
  353: 	      $currentstring.='>';
  354: 	      if ($ENV{'request.state'} ne 'published') {
  355: 		$currentstring.=(<<EDITBUTTON);
  356: 		<form method="post">
  357: 		<input type="submit" name="showmode" value="Edit" />
  358: 		</form>
  359: EDITBUTTON
  360: 	      }
  361:        	    } elsif ($target eq 'tex') {
  362:               $currentstring = '\begin{document}';  
  363: 	    } 
  364: 	   return $currentstring;
  365: 	}
  366:         sub end_body {
  367: 	    my ($target,$token) = @_;
  368:             my $currentstring = '';
  369:             if ($target eq 'web') {
  370:               $currentstring = $token->[2];     
  371: 	    } elsif ($target eq 'tex') {
  372:               $currentstring = '\end{document}';  
  373: 	    } 
  374: 	   return $currentstring;
  375: 	}
  376: #-- <center> tag
  377:         sub start_center {
  378: 	    my ($target,$token) = @_;
  379:             my $currentstring = '';
  380:             if ($target eq 'web') {
  381:               $currentstring = $token->[4];     
  382: 	    } elsif ($target eq 'tex') {
  383:               $currentstring = '\begin{center}';  
  384: 	    }  elsif ($target eq 'latexsource') {
  385:               $currentstring = '\begin{center}';  
  386: 	    } 
  387: 	   return $currentstring;
  388: 	}
  389:         sub end_center {
  390: 	    my ($target,$token) = @_;
  391:             my $currentstring = '';
  392:             if ($target eq 'web') {
  393:               $currentstring = $token->[2];     
  394: 	    } elsif ($target eq 'tex') {
  395:               $currentstring = '\end{center}';  
  396: 	    }  elsif ($target eq 'latexsource') {
  397:               $currentstring = '\end{center}';  
  398: 	    } 
  399: 	   return $currentstring;
  400: 	}
  401: #-- <b> tag
  402:         sub start_b {
  403: 	    my ($target,$token) = @_;
  404:             my $currentstring = '';
  405:             if ($target eq 'web') {
  406:               $currentstring = $token->[4];     
  407: 	    } elsif ($target eq 'tex') {
  408:               $currentstring = '\textbf{';  
  409: 	    }  elsif ($target eq 'latexsource') {
  410:               $currentstring = '\textbf{';  
  411: 	    } 
  412: 	   return $currentstring;
  413: 	}
  414:         sub end_b {
  415: 	    my ($target,$token) = @_;
  416:             my $currentstring = '';
  417:             if ($target eq 'web') {
  418:               $currentstring = $token->[2];     
  419: 	    } elsif ($target eq 'tex') {
  420:               $currentstring = '}';  
  421: 
  422: 	    } elsif ($target eq 'latexsource') {
  423:               $currentstring = '}';  
  424: 	    } 
  425: 	   return $currentstring;
  426: 	}
  427: #-- <strong> tag
  428:         sub start_strong {
  429: 	    my ($target,$token) = @_;
  430:             my $currentstring = '';
  431:             if ($target eq 'web') {
  432:               $currentstring = $token->[4];     
  433: 	    } elsif ($target eq 'tex') {
  434:               $currentstring = '\textbf{';  
  435: 	    } elsif ($target eq 'latexsource') {
  436:               $currentstring = '\textbf{';  
  437: 	    } 
  438: 	   return $currentstring;
  439: 	}
  440:         sub end_strong {
  441: 	    my ($target,$token) = @_;
  442:             my $currentstring = '';
  443:             if ($target eq 'web') {
  444: 
  445:               $currentstring = $token->[2];     
  446: 	    } elsif ($target eq 'tex') {
  447:               $currentstring = '}';  
  448: 	    }  elsif ($target eq 'latexsource') {
  449:               $currentstring = '}';  
  450: 	    } 
  451: 	   return $currentstring;
  452: 	}
  453: #-- <h1> tag
  454:         sub start_h1 {
  455: 	    my ($target,$token) = @_;
  456:             my $currentstring = '';
  457:             if ($target eq 'web') {
  458: 	       $currentstring .= $token->[4];
  459: 	    } elsif ($target eq 'tex') {
  460: 		$currentstring .= '\large{\textbf{';
  461: 	    } elsif ($target eq 'meta') {
  462: 		$currentstring='<subject>';
  463:                 &start_output();
  464:             }
  465:            return $currentstring;
  466: 	}
  467:         sub end_h1 {
  468: 	    my ($target,$token) = @_;
  469:             my $currentstring = '';
  470:             if ($target eq 'web') {
  471: 	       $currentstring .= $token->[2];
  472: 	    } elsif ($target eq 'tex') {
  473: 		$currentstring .= '}}';
  474: 	    } elsif ($target eq 'meta') {
  475:                 &end_output();
  476: 		$currentstring='</subject>';
  477:             } 
  478:            return $currentstring;
  479: 	}
  480: #-- <h2> tag
  481:         sub start_h2 {
  482: 	    my ($target,$token) = @_;
  483:             my $currentstring = '';
  484:             if ($target eq 'web') {
  485: 	       $currentstring .= $token->[4];
  486: 	    } elsif ($target eq 'tex') {
  487: 		$currentstring .= '\large{\textbf{';
  488: 	    } 
  489:            return $currentstring;
  490: 	}
  491:         sub end_h2 {
  492: 	    my ($target,$token) = @_;
  493:             my $currentstring = '';
  494:             if ($target eq 'web') {
  495: 	       $currentstring .= $token->[2];
  496: 	    } elsif ($target eq 'tex') {
  497: 		$currentstring .= '}}';
  498: 	    } 
  499:            return $currentstring;
  500: 	}
  501: #-- <h3> tag
  502:         sub start_h3 {
  503: 	    my ($target,$token) = @_;
  504:             my $currentstring = '';
  505:             if ($target eq 'web') {
  506: 	       $currentstring .= $token->[4];
  507: 	    } elsif ($target eq 'tex') {
  508: 		$currentstring .= '\large{\textbf{';
  509: 	    } 
  510:            return $currentstring;
  511: 	}
  512:         sub end_h3 {
  513: 	    my ($target,$token) = @_;
  514:             my $currentstring = '';
  515:             if ($target eq 'web') {
  516: 	       $currentstring .= $token->[2];
  517: 	    } elsif ($target eq 'tex') {
  518: 		$currentstring .= '}}';
  519: 	    } 
  520:            return $currentstring;
  521: 	}
  522: #-- <h4> tag
  523:         sub start_h4 {
  524: 	    my ($target,$token) = @_;
  525:             my $currentstring = '';
  526:             if ($target eq 'web') {
  527: 	       $currentstring .= $token->[4];
  528: 	    } elsif ($target eq 'tex') {
  529: 		$currentstring .= '\large{\textbf';
  530: 	    } 
  531:            return $currentstring;
  532: 	}
  533:         sub end_h4 {
  534: 	    my ($target,$token) = @_;
  535:             my $currentstring = '';
  536:             if ($target eq 'web') {
  537: 	       $currentstring .= $token->[2];
  538: 	    } elsif ($target eq 'tex') {
  539: 		$currentstring .= '}}';
  540: 	    } 
  541:            return $currentstring;
  542: 	}
  543: #-- <h5> tag
  544:         sub start_h5 {
  545: 	    my ($target,$token) = @_;
  546:             my $currentstring = '';
  547:             if ($target eq 'web') {
  548: 	       $currentstring .= $token->[4];
  549: 	    } elsif ($target eq 'tex') {
  550: 		$currentstring .= '\large{\textbf{';
  551: 	    } 
  552:            return $currentstring;
  553: 	}
  554:         sub end_h5 {
  555: 	    my ($target,$token) = @_;
  556:             my $currentstring = '';
  557:             if ($target eq 'web') {
  558: 	       $currentstring .= $token->[2];
  559: 	    } elsif ($target eq 'tex') {
  560: 		$currentstring .= '}}';
  561: 	    } 
  562:            return $currentstring;
  563: 	}
  564: #-- <h6> tag
  565:         sub start_h6 {
  566: 	    my ($target,$token) = @_;
  567:             my $currentstring = '';
  568:             if ($target eq 'web') {
  569: 	       $currentstring .= $token->[4];
  570: 	    } elsif ($target eq 'tex') {
  571: 		$currentstring .= '\large{\textbf{';
  572: 	    } 
  573:            return $currentstring;
  574: 	}
  575:         sub end_h6 {
  576: 	    my ($target,$token) = @_;
  577:             my $currentstring = '';
  578:             if ($target eq 'web') {
  579: 	       $currentstring .= $token->[2];
  580: 	    } elsif ($target eq 'tex') {
  581: 		$currentstring .= '}}';
  582: 	    } 
  583:            return $currentstring;
  584: 	}
  585: #--- <cite> tag
  586:         sub start_cite {
  587: 	    my ($target,$token) = @_;
  588:             my $currentstring = '';
  589:             if ($target eq 'web') {
  590: 	       $currentstring .= $token->[4];
  591: 	    } elsif ($target eq 'tex') {
  592: 		$currentstring .= "\\textit{";
  593: 	    }  elsif ($target eq 'latexsource') {
  594: 		$currentstring .= "\\textit{";
  595: 	    } 
  596:            return $currentstring;
  597: 	}
  598:         sub end_cite {
  599: 	    my ($target,$token) = @_;
  600:             my $currentstring = '';
  601:             if ($target eq 'web') {
  602: 	       $currentstring .= $token->[2];
  603: 	    } elsif ($target eq 'tex') {
  604: 		$currentstring .= "}";
  605: 	    }  elsif ($target eq 'latexsource') {
  606: 		$currentstring .= "}";
  607: 	    } 
  608:            return $currentstring;
  609: 	}
  610: #-- <i> tag
  611:         sub start_i {
  612: 	    my ($target,$token) = @_;
  613:             my $currentstring = '';
  614:             if ($target eq 'web') {
  615: 	       $currentstring .= $token->[4];
  616: 	    } elsif ($target eq 'tex') {
  617: 		$currentstring .= '\textit{';
  618: 	    }  elsif ($target eq 'latexsource') {
  619: 		$currentstring .= '\textit{';
  620: 	    } 
  621:            return $currentstring;
  622: 	}
  623:         sub end_i {
  624: 	    my ($target,$token) = @_;
  625:             my $currentstring = '';
  626:             if ($target eq 'web') {
  627: 	       $currentstring .= $token->[2];
  628: 	    } elsif ($target eq 'tex') {
  629: 		$currentstring .= '}';
  630: 	    } elsif ($target eq 'latexsource') {
  631: 		$currentstring .= '}';
  632: 	    } 
  633:            return $currentstring;
  634: 	}
  635: #-- <address> tag
  636:         sub start_address {
  637: 	    my ($target,$token) = @_;
  638:             my $currentstring = '';
  639:             if ($target eq 'web') {
  640: 	       $currentstring .= $token->[4];
  641: 	    } elsif ($target eq 'tex') {
  642: 		$currentstring .= "\\textit{";
  643: 	    } elsif ($target eq 'latexsource') {
  644: 		$currentstring .= "\\textit{";
  645: 	    } 
  646:            return $currentstring;
  647: 	}
  648:         sub end_address {
  649: 	    my ($target,$token) = @_;
  650:             my $currentstring = '';
  651:             if ($target eq 'web') {
  652: 	       $currentstring .= $token->[2];
  653: 	    } elsif ($target eq 'tex') {
  654: 		$currentstring .= "}";
  655: 	    } elsif ($target eq 'latexsource') {
  656: 		$currentstring .= "}";
  657: 	    }
  658:            return $currentstring;
  659: 	}
  660: #-- <dfn> tag
  661:         sub start_dfn {
  662: 	    my ($target,$token) = @_;
  663:             my $currentstring = '';
  664:             if ($target eq 'web') {
  665: 	       $currentstring .= $token->[4];
  666: 	    } elsif ($target eq 'tex') {
  667: 		$currentstring .= "\\textit{";
  668: 	    } elsif ($target eq 'latexsource') {
  669: 		$currentstring .= "\\textit{";
  670: 	    } 
  671:            return $currentstring;
  672: 	}
  673:         sub end_dfn {
  674: 	    my ($target,$token) = @_;
  675:             my $currentstring = '';
  676:             if ($target eq 'web') {
  677: 	       $currentstring .= $token->[2];
  678: 	    } elsif ($target eq 'tex') {
  679: 		$currentstring .= "}";
  680: 	    } elsif ($target eq 'latexsource') {
  681: 		$currentstring .= "}";
  682: 	    } 
  683:            return $currentstring;
  684: 	}
  685: #-- <tt> tag
  686:         sub start_tt {
  687: 	    my ($target,$token) = @_;
  688:             my $currentstring = '';
  689:             if ($target eq 'web') {
  690: 	       $currentstring .= $token->[4];
  691: 	    } elsif ($target eq 'tex') {
  692: 		$currentstring .= '\texttt{';
  693: 	    } elsif ($target eq 'latexsource') {
  694: 		$currentstring .= '\texttt{';
  695: 	    } 
  696:            return $currentstring;
  697: 	}
  698:         sub end_tt {
  699: 	    my ($target,$token) = @_;
  700:             my $currentstring = '';
  701:             if ($target eq 'web') {
  702: 	       $currentstring .= $token->[2];
  703: 	    } elsif ($target eq 'tex') {
  704: 		$currentstring .= '}';
  705: 	    } elsif ($target eq 'latexsource') {
  706: 		$currentstring .= '}';
  707: 	    }
  708:            return $currentstring;
  709: 	}
  710: #-- <kbd> tag
  711:         sub start_kbd {
  712: 	    my ($target,$token) = @_;
  713:             my $currentstring = '';
  714:             if ($target eq 'web') {
  715: 	       $currentstring .= $token->[4];
  716: 	    } elsif ($target eq 'tex') {
  717: 		$currentstring .= "\\texttt";
  718: 	    } elsif ($target eq 'latexsource') {
  719: 		$currentstring .= "\\texttt{";
  720: 	    } 
  721:            return $currentstring;
  722: 	}
  723:         sub end_kbd {
  724: 	    my ($target,$token) = @_;
  725:             my $currentstring = '';
  726:             if ($target eq 'web') {
  727: 	       $currentstring .= $token->[2];
  728: 	    } elsif ($target eq 'tex') {
  729: 		$currentstring .= "}";
  730: 	    } elsif ($target eq 'latexsource') {
  731: 		$currentstring .= "}";
  732: 	    } 
  733:            return $currentstring;
  734: 	}
  735: #-- <code> tag
  736:         sub start_code {
  737: 	    my ($target,$token) = @_;
  738:             my $currentstring = '';
  739:             if ($target eq 'web') {
  740: 	       $currentstring .= $token->[4];
  741: 	    } elsif ($target eq 'tex') {
  742: 		$currentstring .= '\texttt{';
  743: 	    } 
  744:            return $currentstring;
  745: 	}
  746:         sub end_code {
  747: 	    my ($target,$token) = @_;
  748:             my $currentstring = '';
  749:             if ($target eq 'web') {
  750: 	       $currentstring .= $token->[2];
  751: 	    } elsif ($target eq 'tex') {
  752: 		$currentstring .= '}';
  753: 	    } 
  754:            return $currentstring;
  755: 	}
  756: #-- <em> tag
  757:         sub start_em {
  758: 	    my ($target,$token) = @_;
  759:             my $currentstring = '';
  760:             if ($target eq 'web') {
  761: 	       $currentstring .= $token->[4];
  762: 	    } elsif ($target eq 'tex') {
  763: 		$currentstring .= '\emph{';
  764: 	    } elsif ($target eq 'latexsource') {
  765: 		$currentstring .= '\emph{';
  766: 	    } 
  767:            return $currentstring;
  768: 	}
  769:         sub end_em {
  770: 	    my ($target,$token) = @_;
  771:             my $currentstring = '';
  772:             if ($target eq 'web') {
  773: 	       $currentstring .= $token->[2];
  774: 	    } elsif ($target eq 'tex') {
  775: 		$currentstring .= '}';
  776: 	    } elsif ($target eq 'latexsource') {
  777: 		$currentstring .= '}';
  778: 	    }  
  779:            return $currentstring;
  780: 	}
  781: #-- <q> tag
  782:         sub start_q {
  783: 	    my ($target,$token) = @_;
  784:             my $currentstring = '';
  785:             if ($target eq 'web') {
  786: 	       $currentstring .= $token->[4];
  787: 	    } elsif ($target eq 'tex') {
  788: 		$currentstring .= "\\emph{";
  789: 	    }  elsif ($target eq 'latexsource') {
  790: 		$currentstring .= "\\emph{";
  791: 	    }
  792:            return $currentstring;
  793: 	}
  794:         sub end_q {
  795: 	    my ($target,$token) = @_;
  796:             my $currentstring = '';
  797:             if ($target eq 'web') {
  798: 	       $currentstring .= $token->[2];
  799: 	    } elsif ($target eq 'tex') {
  800: 		$currentstring .= "}";
  801: 	    } elsif ($target eq 'latexsource') {
  802: 		$currentstring .= "}";
  803: 	    }  
  804:            return $currentstring;
  805: 	}
  806: #-- <p> tag
  807:         sub start_p {
  808: 	    my ($target,$token) = @_;
  809:             my $currentstring = '';
  810:             if ($target eq 'web') {
  811: 	       $currentstring .= $token->[4];
  812: 	    } elsif ($target eq 'tex') {
  813: 		$currentstring .= '{\par ';
  814: 	    } elsif ($target eq 'latexsource') {
  815: 		$currentstring .= '{\par ';
  816: 	    } 
  817:            return $currentstring;
  818: 	}
  819:         sub end_p {
  820: 	    my ($target,$token) = @_;
  821:             my $currentstring = '';
  822:             if ($target eq 'web') {
  823: 	       $currentstring .= $token->[2];
  824: 	    } elsif ($target eq 'tex') {
  825: 	        $currentstring .= '}';
  826:             } elsif ($target eq 'latexsource') {
  827: 	        $currentstring .= '}';
  828:             }
  829:            return $currentstring;
  830: 	}
  831: #-- <br> tag
  832:         sub start_br {
  833: 	    my ($target,$token) = @_;
  834:             my $currentstring = '';
  835:             if ($target eq 'web') {
  836: 	       $currentstring .= $token->[4];
  837: 	    } elsif ($target eq 'tex') {
  838: 		$currentstring .= '\\';
  839: 	    } elsif ($target eq 'latexsource') {
  840: 		$currentstring .= '\\';
  841: 	    } 
  842:            return $currentstring;
  843: 	}
  844:         sub end_br {
  845: 	    my ($target,$token) = @_;
  846:             my $currentstring = '';
  847:             if ($target eq 'web') {
  848: 	       $currentstring .= $token->[2];
  849: 	    }
  850:            return $currentstring;
  851: 	}
  852: #-- <big> tag
  853:         sub start_big {
  854: 	    my ($target,$token) = @_;
  855:             my $currentstring = '';
  856:             if ($target eq 'web') {
  857: 	       $currentstring .= $token->[4];
  858: 	    } elsif ($target eq 'tex') {
  859: 		$currentstring .= '\large{';
  860: 	    } elsif ($target eq 'latexsource') {
  861: 		$currentstring .= '\large{';
  862: 	    }  
  863:            return $currentstring;
  864: 	}
  865:         sub end_big {
  866: 	    my ($target,$token) = @_;
  867:             my $currentstring = '';
  868:             if ($target eq 'web') {
  869: 	       $currentstring .= $token->[2];
  870: 	    } elsif ($target eq 'tex') {
  871: 	        $currentstring .= '}';
  872:             } elsif ($target eq 'latexsource') {
  873: 	        $currentstring .= '}';
  874:             }
  875:            return $currentstring;
  876: 	}
  877: #-- <small> tag
  878:         sub start_small {
  879: 	    my ($target,$token) = @_;
  880:             my $currentstring = '';
  881:             if ($target eq 'web') {
  882: 	       $currentstring .= $token->[4];
  883: 	    } elsif ($target eq 'tex') {
  884: 		$currentstring .= '\footnotesize{';
  885: 	    } elsif ($target eq 'latexsource') {
  886: 		$currentstring .= '\footnotesize{';
  887: 	    } 
  888:            return $currentstring;
  889: 	}
  890:         sub end_small {
  891: 	    my ($target,$token) = @_;
  892:             my $currentstring = '';
  893:             if ($target eq 'web') {
  894: 	       $currentstring .= $token->[2];
  895: 	    } elsif ($target eq 'tex') {
  896: 	        $currentstring .= '}';
  897:             } elsif ($target eq 'latexsource') {
  898: 	        $currentstring .= '}';
  899:             }
  900:            return $currentstring;
  901: 	}
  902: #-- <basefont> tag
  903:       sub start_basefont {
  904: 	my ($target,$token) = @_;
  905: 	my $currentstring = '';
  906: 	if ($target eq 'web') {
  907: 	  $currentstring = $token->[4];     
  908: 	} 
  909: 	return $currentstring;
  910:       }
  911:       sub end_basefont {
  912: 	my ($target,$token) = @_;
  913: 	my $currentstring = '';
  914: 	if ($target eq 'web') {
  915: 	  $currentstring = $token->[4];     
  916: 	} 
  917: 	return $currentstring;
  918:       }
  919: #-- <font> tag
  920:          sub start_font {
  921: 	    my ($target,$token) = @_;
  922:             my $currentstring = '';
  923:             if ($target eq 'web') {
  924:               $currentstring = $token->[4];     
  925: 	    } 
  926: 	   return $currentstring;
  927: 	}
  928:         sub end_font {
  929: 	    my ($target,$token) = @_;
  930:             my $currentstring = '';
  931:             if ($target eq 'web') {
  932:               $currentstring = $token->[2];    
  933:             } 
  934: 	   return $currentstring;
  935: 	} 
  936: #-- <strike> tag
  937:         sub start_strike {
  938: 	    my ($target,$token) = @_;
  939:             my $currentstring = '';
  940:             if ($target eq 'web') {
  941: 	       $currentstring .= $token->[4];
  942: 	    } elsif ($target eq 'tex') {
  943: 		$currentstring .= "{\\underline ";
  944: 	    } 
  945:            return $currentstring;
  946: 	}
  947:         sub end_strike {
  948: 	    my ($target,$token) = @_;
  949:             my $currentstring = '';
  950:             if ($target eq 'web') {
  951: 	       $currentstring .= $token->[2];
  952: 	    } elsif ($target eq 'tex') {
  953: 	        $currentstring .= " }";
  954:             }
  955:            return $currentstring;
  956: 	}
  957: #-- <s> tag
  958:         sub start_s {
  959: 	    my ($target,$token) = @_;
  960:             my $currentstring = '';
  961:             if ($target eq 'web') {
  962: 	       $currentstring .= $token->[4];
  963: 	    } elsif ($target eq 'tex') {
  964: 		$currentstring .= "{\\underline ";
  965: 	    } 
  966:            return $currentstring;
  967: 	}
  968:         sub end_s {
  969: 	    my ($target,$token) = @_;
  970:             my $currentstring = '';
  971:             if ($target eq 'web') {
  972: 	       $currentstring .= $token->[2];
  973: 	    } elsif ($target eq 'tex') {
  974: 	        $currentstring .= " }";
  975:             }
  976:            return $currentstring;
  977: 	}
  978: #-- <sub> tag
  979:         sub start_sub {
  980: 	    my ($target,$token) = @_;
  981:             my $currentstring = '';
  982:             if ($target eq 'web') {
  983: 	       $currentstring .= $token->[4];
  984: 	    } elsif ($target eq 'tex') {
  985: 		$currentstring .= "\$_{ ";
  986: 	    } 
  987:            return $currentstring;
  988: 	}
  989:         sub end_sub {
  990: 	    my ($target,$token) = @_;
  991:             my $currentstring = '';
  992:             if ($target eq 'web') {
  993: 	       $currentstring .= $token->[2];
  994: 	    } elsif ($target eq 'tex') {
  995: 	        $currentstring .= " }\$";
  996:             }
  997:            return $currentstring;
  998: 	}
  999: #-- <sup> tag
 1000:         sub start_sup {
 1001: 	    my ($target,$token) = @_;
 1002:             my $currentstring = '';
 1003:             if ($target eq 'web') {
 1004: 	       $currentstring .= $token->[4];
 1005: 	    } elsif ($target eq 'tex') {
 1006: 		$currentstring .= "\$^{ ";
 1007: 	    } 
 1008:            return $currentstring;
 1009: 	}
 1010:         sub end_sup {
 1011: 	    my ($target,$token) = @_;
 1012:             my $currentstring = '';
 1013:             if ($target eq 'web') {
 1014: 	       $currentstring .= $token->[2];
 1015: 	    } elsif ($target eq 'tex') {
 1016: 	        $currentstring .= " }\$";
 1017:             }
 1018:            return $currentstring;
 1019: 	}
 1020: #-- <hr> tag
 1021:         sub start_hr {
 1022: 	    my ($target,$token) = @_;
 1023:             my $currentstring = '';
 1024:             if ($target eq 'web') {
 1025: 	       $currentstring .= $token->[4];
 1026: 	    } elsif ($target eq 'tex') {
 1027: 		$currentstring .= "\\hline ";
 1028: 	    } 
 1029:            return $currentstring;
 1030: 	}
 1031:         sub end_hr {
 1032: 	    my ($target,$token) = @_;
 1033:             my $currentstring = '';
 1034:             if ($target eq 'web') {
 1035: 	       $currentstring .= $token->[2];
 1036: 	    } elsif ($target eq 'tex') {
 1037: 	    } 
 1038:            return $currentstring;
 1039: 	}
 1040: #-- <a> tag
 1041:         sub start_a {
 1042: 	    my ($target,$token) = @_;
 1043:             my $currentstring = '';
 1044:             if ($target eq 'web') {
 1045: 	       $currentstring .= $token->[4];
 1046: 	    } elsif ($target eq 'tex') {
 1047: 	    }
 1048:            return $currentstring;
 1049: 	}
 1050:         sub end_a {
 1051: 	    my ($target,$token,$tagstack,$stackref) = @_;
 1052:             my $currentstring = '';
 1053:             if ($target eq 'web') {
 1054: 	       $currentstring .= $token->[2];
 1055: 	    } elsif ($target eq 'tex') {
 1056:                 my  $tempor_var = $stackref->[$#$stackref];
 1057: 		if (index($tempor_var,'name') != -1 ) {
 1058: 		    $tempor_var =~ s/name=([^,]*),/$1/g;
 1059: #	        $currentstring .= " \\label{$tempor_var}";
 1060: 	        } elsif (index($tempor_var,'href') != -1 ) {
 1061: 		    $tempor_var =~ s/href=([^,]*),/$1/g;
 1062: 	        $currentstring .= " \\ref{$tempor_var}";
 1063: 	        }
 1064:             }
 1065:            return $currentstring;
 1066: 	}
 1067: #-- <li> tag
 1068:         sub start_li {
 1069: 	    my ($target,$token,$tagstack,$stackref) = @_;
 1070:             my $currentstring = '';
 1071:             if ($target eq 'web') {
 1072:               $currentstring = $token->[4];     
 1073: 	    } elsif ($target eq 'tex') {
 1074:                 my  $tempor_var = $stackref->[$#$stackref];
 1075:                 if (index($tempor_var,'circle') != -1 ) {
 1076: 	          $currentstring .= " \\item[o] ";
 1077: 	        } elsif (index($tempor_var,'square') != -1 ) {
 1078: 	               $currentstring .= " \\item[$\Box$] ";
 1079: 	        } elsif ($tempor_var ne '') { 
 1080: 		       $_ = $tempor_var;
 1081:                        m/my\s*([^=]*)=/;
 1082: 		       $currentstring .= " \\item[$1] ";
 1083: 		} else {
 1084: 		    $currentstring .= " \\item ";
 1085: 	        }  
 1086: 	    } 
 1087: 	   return $currentstring;
 1088: 	}
 1089:         sub end_li {
 1090: 	    my ($target,$token) = @_;
 1091:             my $currentstring = '';
 1092:             if ($target eq 'web') {
 1093:               $currentstring = $token->[2];     
 1094: 	    } 
 1095: 	   return $currentstring;
 1096: 	}
 1097: #-- <u> tag
 1098:         sub start_u {
 1099: 	    my ($target,$token) = @_;
 1100:             my $currentstring = '';
 1101:             if ($target eq 'web') {
 1102: 	       $currentstring .= $token->[4];
 1103: 	    } elsif ($target eq 'tex') {
 1104: 		$currentstring .= "{\\underline ";
 1105: 	    } 
 1106:            return $currentstring;
 1107: 	}
 1108:         sub end_u {
 1109: 	    my ($target,$token) = @_;
 1110:             my $currentstring = '';
 1111:             if ($target eq 'web') {
 1112: 	       $currentstring .= $token->[2];
 1113: 	    } elsif ($target eq 'tex') {
 1114: 	        $currentstring .= " }";
 1115:             }
 1116:            return $currentstring;
 1117: 	}
 1118: #-- <ul> tag
 1119:         sub start_ul {
 1120: 	    my ($target,$token) = @_;
 1121:             my $currentstring = '';
 1122:             if ($target eq 'web') {
 1123:               $currentstring = $token->[4];     
 1124: 	    } elsif ($target eq 'tex') {
 1125:               $currentstring = " \\begin{itemize} ";  
 1126: 	    } 
 1127: 	   return $currentstring;
 1128: 	}
 1129:         sub end_ul {
 1130: 	    my ($target,$token) = @_;
 1131:             my $currentstring = '';
 1132:             if ($target eq 'web') {
 1133:               $currentstring = $token->[2];     
 1134: 	    } elsif ($target eq 'tex') {
 1135:               $currentstring = " \\end{itemize}";  
 1136: 	    } 
 1137: 	   return $currentstring;
 1138: 	}
 1139: #-- <menu> tag
 1140:         sub start_menu {
 1141: 	    my ($target,$token) = @_;
 1142:             my $currentstring = '';
 1143:             if ($target eq 'web') {
 1144:               $currentstring = $token->[4];     
 1145: 	    } elsif ($target eq 'tex') {
 1146:               $currentstring = " \\begin{itemize} ";  
 1147: 	    } 
 1148: 	   return $currentstring;
 1149: 	}
 1150:         sub end_menu {
 1151: 	    my ($target,$token) = @_;
 1152:             my $currentstring = '';
 1153:             if ($target eq 'web') {
 1154:               $currentstring = $token->[2];     
 1155: 	    } elsif ($target eq 'tex') {
 1156:               $currentstring = " \\end{itemize}";  
 1157: 	    } 
 1158: 	   return $currentstring;
 1159: 	}
 1160: #-- <dir> tag
 1161:         sub start_dir {
 1162: 	    my ($target,$token) = @_;
 1163:             my $currentstring = '';
 1164:             if ($target eq 'web') {
 1165:               $currentstring = $token->[4];     
 1166: 	    } elsif ($target eq 'tex') {
 1167:               $currentstring = " \\begin{itemize} ";  
 1168: 	    } 
 1169: 	   return $currentstring;
 1170: 	}
 1171:         sub end_dir {
 1172: 	    my ($target,$token) = @_;
 1173:             my $currentstring = '';
 1174:             if ($target eq 'web') {
 1175:               $currentstring = $token->[2];     
 1176: 	    } elsif ($target eq 'tex') {
 1177:               $currentstring = " \\end{itemize}";  
 1178: 	    } 
 1179: 	   return $currentstring;
 1180: 	}
 1181: #-- <ol> tag
 1182:         sub start_ol {
 1183: 	    my ($target,$token) = @_;
 1184:             my $currentstring = '';
 1185:             if ($target eq 'web') {
 1186:               $currentstring = $token->[4];     
 1187: 	    } elsif ($target eq 'tex') {
 1188:               $currentstring = " \\begin{enumerate} ";  
 1189: 	    } 
 1190: 	   return $currentstring;
 1191: 	}
 1192:         sub end_ol {
 1193: 	    my ($target,$token) = @_;
 1194:             my $currentstring = '';
 1195:             if ($target eq 'web') {
 1196:               $currentstring = $token->[2];     
 1197: 	    } elsif ($target eq 'tex') {
 1198:               $currentstring = " \\end{enumerate}";  
 1199: 	    } 
 1200: 	   return $currentstring;
 1201: 	}
 1202: #-- <dl> tag
 1203:         sub start_dl {
 1204: 	    my ($target,$token) = @_;
 1205:             my $currentstring = '';
 1206:             if ($target eq 'web') {
 1207:               $currentstring = $token->[4];     
 1208: 	    } elsif ($target eq 'tex') {
 1209:               $currentstring = " \\begin{description} ";  
 1210: 	    } 
 1211: 	   return $currentstring;
 1212: 	}
 1213:         sub end_dl {
 1214: 	    my ($target,$token) = @_;
 1215:             my $currentstring = '';
 1216:             if ($target eq 'web') {
 1217:               $currentstring = $token->[2];     
 1218: 	    } elsif ($target eq 'tex') {
 1219:               $currentstring = " \\end{description}";  
 1220: 	    } 
 1221: 	   return $currentstring;
 1222: 	}
 1223: #-- <dt> tag
 1224:         sub start_dt {
 1225: 	    my ($target,$token) = @_;
 1226:             my $currentstring = '';
 1227:             if ($target eq 'web') {
 1228:               $currentstring = $token->[4];     
 1229: 	    } elsif ($target eq 'tex') {
 1230:               $currentstring = "\\item[ ";  
 1231: 	    } 
 1232: 	   return $currentstring;
 1233: 	}
 1234:         sub end_dt {
 1235: 	    my ($target,$token) = @_;
 1236:             my $currentstring = '';
 1237:             if ($target eq 'web') {
 1238:               $currentstring = $token->[2];    
 1239:             } elsif ($target eq 'tex') {
 1240:               $currentstring = "]";  
 1241: 	    } 
 1242: 	   return $currentstring;
 1243: 	}
 1244: #-- <dd> tag
 1245:         sub start_dd {
 1246: 	    my ($target,$token) = @_;
 1247:             my $currentstring = '';
 1248:             if ($target eq 'web') {
 1249:               $currentstring = $token->[4];     
 1250: 	    } 
 1251: 	   return $currentstring;
 1252: 	}
 1253:         sub end_dd {
 1254: 	    my ($target,$token) = @_;
 1255:             my $currentstring = '';
 1256:             if ($target eq 'web') {
 1257:               $currentstring = $token->[2];    
 1258:             } 
 1259: 	   return $currentstring;
 1260: 	}
 1261: #-- <table> tag
 1262:         sub start_table {
 1263: 	    my ($target,$token) = @_;
 1264:             my $currentstring = '';
 1265:             if ($target eq 'web') {
 1266:               $currentstring = $token->[4];     
 1267: 	    } elsif ($target eq 'tex') {
 1268:               $currentstring = "";  
 1269: 	    } 
 1270: 	   return $currentstring;
 1271: 	}
 1272:         sub end_table {
 1273: 	    my ($target,$token) = @_;
 1274:             my $currentstring = '';
 1275:             if ($target eq 'web') {
 1276:               $currentstring = $token->[2];     
 1277: 	    } elsif ($target eq 'tex') {
 1278:               $currentstring = "";  
 1279: 	    } 
 1280: 	   return $currentstring;
 1281: 	}
 1282: #-- <tr> tag
 1283:         sub start_tr {
 1284: 	    my ($target,$token) = @_;
 1285:             my $currentstring = '';
 1286:             if ($target eq 'web') {
 1287:               $currentstring = $token->[4];     
 1288: 	    } elsif ($target eq 'tex') {
 1289: 	      $currentstring = '';
 1290: 	    } 
 1291: 	   return $currentstring;
 1292: 	}
 1293:         sub end_tr {
 1294: 	    my ($target,$token) = @_;
 1295:             my $currentstring = '';
 1296:             if ($target eq 'web') {
 1297:               $currentstring = $token->[2];     
 1298: 	    } elsif ($target eq 'tex') {
 1299:               $currentstring = "";  
 1300: 	    } 
 1301: 	   return $currentstring;
 1302: 	}
 1303: #-- <td> tag
 1304:         sub start_td {
 1305: 	    my ($target,$token) = @_;
 1306:             my $currentstring = '';
 1307:             if ($target eq 'web') {
 1308:               $currentstring = $token->[4];     
 1309: 	    } elsif ($target eq 'tex') {
 1310: 	      $currentstring = '';
 1311: 	    } 
 1312: 	   return $currentstring;
 1313: 	}
 1314:         sub end_td {
 1315: 	    my ($target,$token) = @_;
 1316:             my $currentstring = '';
 1317:             if ($target eq 'web') {
 1318:               $currentstring = $token->[2];     
 1319: 	    } elsif ($target eq 'tex') {
 1320:               $currentstring = "";  
 1321: 	    } 
 1322: 	   return $currentstring;
 1323: 	}
 1324: #-- <img> tag
 1325: 
 1326:         sub start_img {
 1327: 	    my ($target,$token) = @_;
 1328:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1329:                                         $token->[2]->{'src'};
 1330:             my $currentstring = '';
 1331:             if ($target eq 'web') {
 1332:               $currentstring = $token->[4];     
 1333: 	    } elsif ($target eq 'tex') {
 1334:               $currentstring = " \\begin{figure} ";  
 1335: 	    } 
 1336: 	   return $currentstring;
 1337: 	}
 1338:         sub end_img {
 1339: 	    my ($target,$token) = @_;
 1340:             my $currentstring = '';
 1341:             if ($target eq 'web') {
 1342:               $currentstring = $token->[2];     
 1343: 	    } elsif ($target eq 'tex') {
 1344:               $currentstring = " \\end{figure}";  
 1345: 	    } 
 1346: 	   return $currentstring;
 1347: 	}
 1348: #-- <applet> tag
 1349: 
 1350:         sub start_applet {
 1351: 	    my ($target,$token) = @_;
 1352:               $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1353:                                         $token->[2]->{'code'};
 1354:               $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1355:                                         $token->[2]->{'archive'};
 1356:             my $currentstring = '';
 1357:             if ($target eq 'web') {
 1358:               $currentstring = $token->[4];     
 1359: 	    } elsif ($target eq 'tex') {
 1360:               $currentstring = " \\begin{figure} ";  
 1361: 	    } 
 1362: 	   return $currentstring;
 1363: 	}
 1364:         sub end_applet {
 1365: 	    my ($target,$token) = @_;
 1366:             my $currentstring = '';
 1367:             if ($target eq 'web') {
 1368:               $currentstring = $token->[2];     
 1369: 	    } elsif ($target eq 'tex') {
 1370:               $currentstring = " \\end{figure}";  
 1371: 	    } 
 1372: 	   return $currentstring;
 1373: 	}
 1374: 
 1375: #-- <embed> tag
 1376: 
 1377:         sub start_embed {
 1378: 	    my ($target,$token) = @_;
 1379:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1380:                                         $token->[2]->{'src'};
 1381:            my $currentstring = '';
 1382:             if ($target eq 'web') {
 1383:               $currentstring = $token->[4];     
 1384: 	    } elsif ($target eq 'tex') {
 1385:               $currentstring = " \\begin{figure} ";  
 1386: 	    } 
 1387: 	   return $currentstring;
 1388: 	}
 1389:         sub end_embed {
 1390: 	    my ($target,$token) = @_;
 1391:             my $currentstring = '';
 1392:             if ($target eq 'web') {
 1393:               $currentstring = $token->[2];     
 1394: 	    } elsif ($target eq 'tex') {
 1395:               $currentstring = " \\end{figure}";  
 1396: 	    } 
 1397: 	   return $currentstring;
 1398: 	}
 1399: 
 1400: #-- <param> tag
 1401: 
 1402:         sub start_param {
 1403: 	    my ($target,$token) = @_;
 1404: 	    if ($token->[2]->{'name'} eq 'cabbase') {
 1405:                       $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
 1406: 					     $token->[2]->{'value'};
 1407:             }   
 1408:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1409:                                         $token->[2]->{'src'};
 1410:             my $currentstring = '';
 1411:             if ($target eq 'web') {
 1412:               $currentstring = $token->[4];     
 1413: 	    } elsif ($target eq 'tex') {
 1414:               $currentstring = " \\begin{figure} ";  
 1415: 	    } 
 1416: 	   return $currentstring;
 1417: 	}
 1418:         sub end_param {
 1419: 	    my ($target,$token) = @_;
 1420:             my $currentstring = '';
 1421:             if ($target eq 'web') {
 1422:               $currentstring = $token->[2];     
 1423: 	    } elsif ($target eq 'tex') {
 1424:               $currentstring = " \\end{figure}";  
 1425: 	    } 
 1426: 	   return $currentstring;
 1427: 	}
 1428: 
 1429: #-- <allow> tag
 1430: 
 1431:         sub start_allow {
 1432: 	    my ($target,$token) = @_;
 1433: 
 1434:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1435:                                         $token->[2]->{'src'};
 1436: 
 1437: 	   return '';
 1438: 	}
 1439:         sub end_allow {
 1440: 	   return '';
 1441: 	}
 1442: #-- Frames
 1443: 	sub start_frameset {
 1444: 	  my ($target,$token) = @_;
 1445: 	  my $currentstring = '';
 1446: 	  if ($target eq 'web') { 
 1447: 	    if (!$Apache::lonxml::registered) {
 1448: 	      $currentstring.='<head>'.&Apache::lonxml::registerurl().'</head>';
 1449: 	    }
 1450: 	    $currentstring .= $token->[4];
 1451: 	  }
 1452: 	  return $currentstring;
 1453: 	}
 1454:         sub end_frameset {
 1455: 	  my ($target,$token) = @_;
 1456: 	  my $currentstring = '';
 1457: 	  if ($target eq 'web') {
 1458: 	    $currentstring = $token->[2];
 1459: 	  }
 1460: 	  return $currentstring;
 1461: 	}
 1462: 1;
 1463: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>