Is there a way to get a line number from an ElementTree Element

Viewed 12143

So I'm parsing some XML files using Python 3.2.1's cElementTree, and during the parsing I noticed that some of the tags were missing attribute information. I was wondering if there is any easy way of getting the line numbers of those Elements in the xml file.

4 Answers
Related