I have an xml file that looks like this:
<elements>
<topic id1=111 id2=222>
<title>title1</title>
<topic id1=333 id2=444>
<title>title2</title>
</topic>
<topic id1=555 id2=666>
<title>title3</title>
</topic>
</topic>
<topic id1=777 id2=888>
<title>title3</title>
</topic>
</elements>
I need as an output of this all the text in the title elements and all the id1 and id2 atributes, like this:
[[title1,111,222],[title2,333,444],...]
I'll put them later on in a csv file, but I know how to that, I'm quite stuck in this one. I have seen posts like this one, but I don't seem to hang of it to get the information from all of them at once. I'm using python 3.3 just in case. Any ideas are greatly appreciated.
Thanks!!