1

I'm looking for find the line number of the element where I'm in my etree from xml.etree.ElementTree. I saw a website (https://github.com/daveti/pyet/blob/master/Python-2.7.8/Lib/xml/etree/ElementTree.py) where the class ElementTree was re-writen but I can't modify libs for my job (the script must be re-usable everywhere). So my question is can I get my lineNumber through self._parser.CurrentLineNumber and my ElementTree in code directly ?

Thanks in advance.

  • Did you look at http://stackoverflow.com/q/6949395/407651? – mzjn Apr 14 '17 at 10:05
  • My answer at http://stackoverflow.com/questions/43378787/parsing-xml-with-invalid-nodes/43402439#43402439 offers an example. – Bill Bell Apr 14 '17 at 17:00
  • Possible duplicate of [Is there a way to get a line number from an ElementTree Element](http://stackoverflow.com/questions/6949395/is-there-a-way-to-get-a-line-number-from-an-elementtree-element) – mzjn Apr 24 '17 at 07:26

0 Answers0