- if attrs[0][1] == 'DocPublicationName' :
- self.headercount = 0
- self.currentattr = 'DocPublicationName'
- elif attrs[0][1] == 'DocHeader' :
- self.headercount += 1
- self.currentattr = 'DocHeader'
- elif attrs[0][1] == 'TitreArticleVisu' :
- self.outfile.write('\n\n')
- self.meta.append('\n')
- self.outfile.write(' '.join(self.meta).encode('utf8', errors='replace'))
- self.meta = [u'****']
- self.nb += 1
- self.currentattr = 'TitreArticleVisu'
+ if len(attrs) > 0 :
+ if attrs[0][1] == 'DocPublicationName' :
+ #print 'DocPublicationName'
+ self.headercount = 0
+ self.currentattr = 'DocPublicationName'
+ elif attrs[0][1] == 'DocHeader' :
+ self.headercount += 1
+ self.currentattr = 'DocHeader'
+ elif attrs[0][1] in ['TitreArticleVisu', 'titreArticleVisu'] :
+ self.outfile.write('\n\n')
+ self.meta.append('\n')
+ self.outfile.write(' '.join(self.meta).encode('utf8', errors='replace'))
+ self.meta = [u'****']
+ self.nb += 1
+ self.currentattr = 'TitreArticleVisu'
+ elif attrs[0][1] == 'PubliC_lblNodoc' :
+ self.currentattr = 'PubliC_lblNodoc'