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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 10 Nov 2006 19:41:35 -0000


albertel		Fri Nov 10 14:41:35 2006 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - BUG#5076 warn when tags don't get closed.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.424 loncom/xml/lonxml.pm:1.425
--- loncom/xml/lonxml.pm:1.424	Wed Nov  1 18:24:51 2006
+++ loncom/xml/lonxml.pm	Fri Nov 10 14:41:34 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.424 2006/11/01 23:24:51 albertel Exp $
+# $Id: lonxml.pm,v 1.425 2006/11/10 19:41:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -342,6 +342,11 @@
  my $finaloutput = &inner_xmlparse($target,\@stack,\@parstack,\@pars,
 				   $safeeval,\%style_for_target,1);
 
+ if (@stack) {
+     &warning("At end of file some tags were still left unclosed, ".
+	      '<tt>&lt;'.join('&gt;</tt>, <tt>&lt;',reverse(@stack)).
+	      '&gt;</tt>');
+ }
  if ($env{'request.uri'}) {
     &writeallows($env{'request.uri'});
  }