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
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')
:
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',