[Tutor] Fwd: Fwd: find second occurance of string in line

richard kappler richkappler at gmail.com
Wed Sep 9 15:40:16 CEST 2015


> It looks likes I was not clear enough: XML doesn't have the concept of lines.
When you process XML "by line" you have buggy code.

No Peter, I'm pretty sure it was I who was less than clear. The xml data is
generated by events, one line in a log for each event, so while xml doesn't
have the concept of lines, each event creates a new line of xml data in the
log from which I will be reading. Sorry about the confusion. I should have
phrased it better, perhaps calling them events instead of lines?

> Just for fun take the five minutes to install lxml and compare the output
of the two scripts. If it's the same now there's no harm switching to lxml,
and you are making future failures less likely.

I'll take a look at it, thanks.

regards, Richard


More information about the Tutor mailing list