Next / Previous / Contents / TCC Help System / NM Tech homepage

4.11. ArticleHandler.endElement(): Observe an end tag

Again, the name of this method is mandated by the SAX interface as the one it calls when it sees an end tag. If it's a </programlisting> end tag, we clear the values of self.outFileName and self.outFile to signify that we're no longer in a code fragment. Other end tags are ignored.

litsource
# - - -   A r t i c l e H a n d l e r . e n d E l e m e n t   - - -

    def endElement ( self, name ):
        """Handle the end of an element.

          [ name is an element name ->
              if name==PROG_ELT ->
                self.outFile      :=  None
                self.outFileName  :=  None
              else -> I ]
        """
        if  name == PROG_ELT:
            self.outFile  =  self.outFileName  =  None