I'm trying to access the XML elements using ElementTree in Python 3.7. XML entry tag in the file my_file.xml
is of the format:
<?xml version="1.0" encoding="utf-16"?>
When I try to parse the XML using the below method,
>>import xml.etree.ElementTree as ET
>>file_content = ET.parse('my_file.xml')
I keep getting the error as:
xml.etree.ElementTree.ParseError: encoding specified in XML declaration is incorrect
What could be the reason for this?