--- loncom/xml/lonxml.pm 2002/10/17 17:13:44 1.204 +++ loncom/xml/lonxml.pm 2002/10/20 18:42:53 1.205 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.204 2002/10/17 17:13:44 albertel Exp $ +# $Id: lonxml.pm,v 1.205 2002/10/20 18:42:53 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,7 +60,7 @@ package Apache::lonxml; use vars -qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $prevent_entity_encode); +qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $prevent_entity_encode $errorcount $warningcount); use strict; use HTML::LCParser(); use HTML::TreeBuilder(); @@ -852,6 +852,8 @@ sub setup_globals { my ($request,$target)=@_; $Apache::lonxml::request=$request; $Apache::lonxml::registered = 0; + $errorcount=0; + $warningcount=0; &init_counter(); @Apache::lonxml::pwd=(); @Apache::lonxml::extlinks=(); @@ -1352,6 +1354,7 @@ sub debug { } sub error { + $errorcount++; if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) { # If printing in construction space, put the error inside

     print "ERROR:".join("\n",@_)."\n";
@@ -1377,6 +1380,7 @@ sub error {
 }
 
 sub warning {
+  $warningcount++;
   if ($ENV{'request.state'} eq 'construct') {
     print "WARNING:".join('
',@_)."
\n"; }