Use python to process XML file

Bruce epost2 at
Fri Mar 10 19:07:22 CET 2006

you can use function parse from xml.sax
It takes your xml as the first argument and an
xml.sax.handler.ContentHandler instance as the second.
from xml.sax import parse
from xml.sax.handler import ContentHandler

class LogHandler(ContentHandler):
     def startElement(self,name):
          if name=='a':


More information about the Python-list mailing list