Starting here:
<Program>
<ManyTag>
<InstSpecific Inst="FAMU" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="FAU" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="FIU" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="UCF" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="UF" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="UNF" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="USF" PgmHrs="120" LimitedAccess="N"/>
<InstSpecific Inst="UWF" PgmHrs="120" LimitedAccess="N"/>
<OtherTags>stuff</OtherTags>
<ManyTag>
<Program>
From above I have a nested grouping of tags that are unique in attrib but not in tag name. I need to keep this grouping but I cannot figure out how to append the 'Inst' attrib together in an array, document or magical container. Before someone starts hollerin' about code:
tree = etree.parse('some.xml')
root = tree.getroot()
inst = []
for element in root.iter():
if element.tag == 'InstSpecific':
inst.append(element.get('Inst')
This is a short, truncated version but I have tried many things and am nearly blind with rage. I am so frustrated I would do it by hand, but that's over 20,000 entries for the 'InstSpecific' alone. Please help.