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 +
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, attr):