Given the following:
>>> from lxml import etree
>>> contents=open('file.xml').read()
>>> node=etree.fromstring(contents)
How would I get the root tag name of the node? For example, if the xml were:
<Orders>
<Order>
<Digital_Order>1021</Digital_Order>
</Order>
</Orders>
It would return "Orders".
Should just be the simple node.tag
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With