Hello to everyone!!
I'm a newbie to Python and I have this problem:
I have an xml document like this
-
<root>
-
<one>
-
<two>
-
<third>
-
some text
-
</third>
-
<four>
-
some text
-
<five>
-
<six>
-
some text
-
</six>
-
<another six>
-
some test
-
</another six>
-
</five>
-
</four>
-
</two>
-
<eight>
-
some text
-
</eight>
-
</one>
-
</root>
-
I parsed it using pyrxp. Pyrxp return a tree of tuple. I want to insert the tag and the data in a dictionary where the keys are the tag and the value are the data or a list of dictionary (with key = tag and value = data) if tag have children.
Sorry for my english and for the bad explanation of the problem.
I'm interesting to know how I can extract the tag and the data from the parsed file.
Thank you very much.