def e_text_h(self, tag, attrs):
        """ Headings end
            Side-effect: If there is no title in the metadata, then it is taken
            from the first heading of any level.
        """
        self.writedata()
        level = int(attrs[(TEXTNS,'outline-level')])
        if level > 6: level = 6 # Heading levels go only to 6 in XHTML
        if level < 1: level = 1
        lev = self.headinglevels[1:level+1]
        outline = '.'.join(map(str,lev) )
        heading = ''.join(self.data)
        if self.title == '': self.title = heading
        anchor = self.get_anchor("%s.%s" % ( outline, heading))
        self.opentag('a', {'id': anchor} )
        self.closetag('a', False)
        self.closetag('h%s' % level)
        self.purgedata()
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/odf2xhtml.py/ODF2XHTML.e_text_h/original