I have below xml data.
<transaction>
<date>20190415</date>
<ticket>303434037</ticket>
<value>15</value>
<notenders>01</notenders>
<tenderdetail>
<tendertype>00</tendertype>
<tenderamt>15</tenderamt>
</tenderdetail>
<item>
<receipeno>00001096</receipeno>
<price>7</price>
<qty>0001</qty>
<items>
<item>
<receipeno>00000786</receipeno>
<price>8</price>
<qty>0001</qty>
<items>
<item>
<receipeno>00000599</receipeno>
<price>0</price>
<qty>1</qty>
</item>
<item>
<receipeno>00000605</receipeno>
<price>0</price>
<qty>1</qty>
</item>
<item>
<receipeno>00000608</receipeno>
<price>0</price>
<qty>0004</qty>
</item>
</items>
</item>
<item>
<receipeno>10000043</receipeno>
<price>0</price>
<qty>0001</qty>
</item>
<item>
<receipeno>00000381</receipeno>
<price>7</price>
<qty>0001</qty>
<items>
<item>
<receipeno>00000607</receipeno>
<price>0</price>
<qty>1</qty>
</item>
</items>
</item>
</items>
</item>
</transaction>
I need to convert this to a table format. the issues is there are many nested branches inside each tag. eg many <item> & <items> tags. irrespective of the nested-ness. I need to list down the data one below he other.
my desired output is as follows
+----------+--------+-------+-----------+------------+-----------+-----------+-------+-----+
| date | ticket | value | notenders | tendertype | tenderamt | receipeno | price | qty |
+----------+--------+-------+-----------+------------+-----------+-----------+-------+-----+
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 1096 | 7 | 1 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 786 | 8 | 1 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 599 | 0 | 1 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 605 | 0 | 1 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 608 | 0 | 4 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 143 | 0 | 1 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 381 | 7 | 1 |
| 20190101 | 12345 | 15 | 1 | 0 | 15 | 607 | 0 | 1 |
+----------+--------+-------+-----------+------------+-----------+-----------+-------+-----+
I'm new to python & XML parsing. Hence, kindly, direct me to solve this. ...
