Re: [XML-SIG] Learning to use elementtree

2008-04-08 Thread Doran, Harold
Thanks. I'm piecing this together slowly, but I did get the following to work. Test.py from xml.etree.ElementTree import ElementTree as ET f = open('test.txt', 'w') et = ET(file='out_g4r_b.xml') for statentityref in et.findall('admin/responseanalyses/analysis/analysisdata/statentityref') : prin

Re: [XML-SIG] Learning to use elementtree

2008-04-08 Thread Doran, Harold
Well, maybe this is what I should have done to start with to avoid the name collusion problem from xml.etree.ElementTree import ElementTree as ET f = open('test.txt', 'w') et = ET(file='out_g4r_b.xml') for statentityref in et.findall('admin/responseanalyses/analysis/analysisdata/statentityref') :

Re: [XML-SIG] Learning to use elementtree

2008-04-08 Thread Stefan Behnel
Doran, Harold wrote: >for statentityref in statentityref.findall('statentityref'): In this line, you assign new values to the name "statentityref" in each iteration of the loop. > for statval in statentityref.findall('statval'): > print >> f, statentityref.attrib['id'], '\t',