ps python wrote: > Kent and Dany, > Thanks for your replies. > > Here fromstring() assuming that the input is in a kind > of text format.
Right, that is for the sake of a simple example. > > what should be the case when I am reading files > directly. > > I am using the following : > > from elementtree.ElementTree import ElementTree > mydata = ElementTree(file='00001.xml') > iter = root.getiterator() > > Here the whole XML document is loaded as element tree > and how should this iter into a format where I can > apply findall() method. Call findall() directly on mydata, e.g. for process in mydata.findall('//biological_process'): print process.text The path //biological_process means find any biological_process element at any depth from the root element. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor