[XML-SIG] HtmlBuilder

Fred L. Drake Fred L. Drake, Jr." <fdrake@acm.org
Fri, 5 Mar 1999 18:06:25 -0500 (EST)


Jeff.Johnson@icn.siemens.com writes:
 > it.  I did however add two lines of code to HtmlBuilder that will allow
 > these bogus end tags to be ignored.  I hope that the new code can be added

Jeff,
  I think this would be fine.  Perhaps a parameter to the constructor, 
or just an instance variable, could be used to determine whether an
exception is raised or the problem silently ignored.

 >         def unknown_endtag(self, tag):
 >                 tag = string.upper(tag)
 >                 #print 'ending', tag
 > 
 >                 while self.stack:
 >                         if tag not in self.stack:
 >                                 #print "ignoring end tag with no start",
 > tag
 >                                 break
			   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  The whole bit that you added could be moved before the while loop;
that would avoid the extra overhead without loss of functionality.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives
1895 Preston White Dr.	    Reston, VA  20191