import sys from xml.sax import saxutils from xml.sax import make_parser from xml.sax import handler
class SimpleHandler(saxutils.DefaultHandler): def startElementNS(self,name,qname,attrs): print 'startElementNS: ', name,qname for n in attrs.getNames(): print " attribute :", n, attrs.getValue(n)