Hi, I have an XML file which contains entries of the form: <idlist> <myID>1</myID> <myID>2</myID> .... <myID>10000</myID> </idlist>
Currently, I have written a SAX based handler that will read in all the <myID></myID> entries and return a list of the contents of these entries. However this is not scalable and for my purposes it would be better if I could iterate over the list of <myID> nodes. Some thing like: for myid in getMyIDList(document): print myid I realize that I can do this with generators, but I can't see how I can incorporate generators into my handler class (which is a subclass of xml.sax.ContentHandler). Any pointers would be appreciated Thanks, Rajarshi -- http://mail.python.org/mailman/listinfo/python-list