I have a file
trace.xml.The very first line in this file is
<?xml version="1.0" encoding="UTF-8"?>.I tried reading the data using the following command:
with open('trace.xml') as fobj: xml=fobj.read() root = etree.fromstring(xml)
This however yields the following error:
ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.
I am assuming its because of the very first tag i mentioned above.Is there a way around this any help would be appreciated.