RE: sax.handler.Contenthandler.__init__

2013-08-30 Thread Prasad, Ramit
Neil Cerutti wrote: > This code is from The Python Cookbook, 2nd edition, 12.2 Counting > Tags in a Document: > > from xml.sax.handler import ContentHandler > import xml.sax > class countHandler(ContentHandler): > def __init__(self): > self.tags={} > def startElement(self, name, at

sax.handler.Contenthandler.__init__

2013-08-30 Thread Neil Cerutti
This code is from The Python Cookbook, 2nd edition, 12.2 Counting Tags in a Document: from xml.sax.handler import ContentHandler import xml.sax class countHandler(ContentHandler): def __init__(self): self.tags={} def startElement(self, name, attr): self.tags[name] = 1 + sel