Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-21 Thread Kent Johnson
Danny Yoo wrote: > > On Wed, 21 Dec 2005, ps python wrote: > > >>Dear drs. Yoo and johnson, Thank you very much for your help. I >>successully parsed my GO annotation from all 16,000 files. thanks again >>for your kind help > > > I'm glad to hear that it's working for you now. Just as a clar

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-21 Thread Danny Yoo
On Wed, 21 Dec 2005, ps python wrote: > Dear drs. Yoo and johnson, Thank you very much for your help. I > successully parsed my GO annotation from all 16,000 files. thanks again > for your kind help I'm glad to hear that it's working for you now. Just as a clarification: I'm not a doctor. *g

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-20 Thread ps python
Dear drs. Yoo and johnson, Thank you very much for your help. I successully parsed my GO annotation from all 16,000 files. thanks again for your kind help --- Danny Yoo <[EMAIL PROTECTED]> wrote: > > > >>> for m in mydata.findall('//functions'): > > print m.get('molecular_class').text >

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-20 Thread Danny Yoo
> >>> for m in mydata.findall('//functions'): > print m.get('molecular_class').text > > >>> for m in mydata.findall('//functions'): > print m.find('molecular_class').text.strip() > > >>> for process in > mydata.findall('//biological_process'): > print process.get('title').text

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-20 Thread ps python
Thank you for your email Dr. Johnson. I need to print : gene_symbol (from line ALDH3A1) entry_cdna (from line NM_000691.3) molecular_class (from line Enzyme:Dehydrogenase) title (from tags Catalytic activity) title (from tags section Metabolism) title (from tags section cytoplasm) Thi

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-20 Thread Kent Johnson
ps python wrote: > Dear Drs. Johnson and Yoo , > for the last 1 week I have been working on parsing > the elements from a bunch of XML files following your > suggestions. > > from elementtree.ElementTree import ElementTree > mydata = ElementTree(file='4.xml') for process in > > my

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-20 Thread ps python
Dear Drs. Johnson and Yoo , for the last 1 week I have been working on parsing the elements from a bunch of XML files following your suggestions. until now I have been unsuccessul. I have no clue why i am failing. I have ~16K XML files. this data obtained from johns hopkins university (of co

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-09 Thread Kent Johnson
Srinivas Iyyer wrote: > Hi group, > I just have another question in parsin XML files. I > found it very easy to parse XML files with kent and > danny's help. > > I realized that all my XML files have '\t' and '\n' > and whitespace. these extra features are making to > extract the text data fro

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-09 Thread Srinivas Iyyer
Hi group, I just have another question in parsin XML files. I found it very easy to parse XML files with kent and danny's help. I realized that all my XML files have '\t' and '\n' and whitespace. these extra features are making to extract the text data from the xml files very difficult. I can

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread Kent Johnson
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 : > > fr

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread ps python
Kent and Dany, Thanks for your replies. Here fromstring() assuming that the input is in a kind of text format. what should be the case when I am reading files directly. I am using the following : from elementtree.ElementTree import ElementTree mydata = ElementTree(file='1.xml') iter =

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread Kent Johnson
ps python wrote: > Hi, > > using ElementTree, how can I extract text of a > particular element, or a child node. > > For example: > > > >Signal transduction > > >Energy process > > > > In the case where I already know which element tags > have the in

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread Danny Yoo
> For example: > > > >Signal transduction > > >Energy process > > > > I looked at some tutorials (eg. Ogbuji). Those > examples described to extract all text of nodes and > child nodes. Hi Mdan, The following might help: http://article.gmane.org/

[Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread ps python
Hi, using ElementTree, how can I extract text of a particular element, or a child node. For example: Signal transduction Energy process I looked at some tutorials (eg. Ogbuji). Those examples described to extract all text of nodes and child nodes. In

[Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread ps python
Hi, using ElementTree, how can I extract text of a particular element, or a child node. For example: Signal transduction __ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.sha