As mentioned, I need to get the list of XML tags in file, using library xml.etree.ElementTree
.
I am aware that there are properties and methods like ETVar.child, ETVar.getroot(), ETVar.tag, ETVar.attrib
.
But to be able to use them and get at least name of tags on level 2, I had to use nested for.
At the moment I have something like
for xmlChild in xmlRootTag:
if xmlChild.tag:
print(xmlChild.tag)
Goal would be to get a list of ALL, even deeply nested XML tags in file, eliminating duplicates.
For a better idea, I add the possible example of XML code:
<root>
<firstLevel>
<secondlevel level="2">
<thirdlevel>
<fourth>text</fourth>
<fourth2>text</fourth>
</thirdlevel>
</secondlevel>
</firstlevel>
</root>