Python recursive XML parsing

Fluterafax

New Member
Brand new to XML parsing. What would be the best way in python to parse something like:\[code\]<Item name="item1"> <data>item1data</data> <subItems> <Item name="item2"> <data>item2data</data> <subItems> <Item name="item3"> . . . </Item> </subItems> </Item> <Item name="item4"> . . . </Item> <subItems></Item>\[/code\]I was looking at \[code\]xml.sax\[/code\] parsing, but couldn't figure out how to enable it to do multiple levels of parsing down the \[code\]subItems\[/code\] trees. Could someone give me a recommendation of a parser/method to parse this? Thank you!I will be creating lists of 'Item' objects with this, expected results would loopks something like this:\[code\][Item(item1, item1data, [Item(item2, item2data, [Item(item3 ... ]) Item(item4 ... )])]`\[/code\]
 
Back
Top