Is there a way to get a line number from an ElementTree Element
Took a while for me to work out how to do this using Python 3.x (using 3.3.2 here) so thought I would summarize: # Force python XML parser not faster C accelerators # because we can’t hook the C implementation sys.modules[‘_elementtree’] = None import xml.etree.ElementTree as ET class LineNumberingParser(ET.XMLParser): def _start_list(self, *args, **kwargs): # Here … Read more