in reply to File parsing with HTML::TokeParser::Simple
The problem is that you're trying to use the tool in a way it can't be used. Consider the following process instruction:
<? echo 'This is from PHP.'; ?>
That runs over three lines. However, if you're reading things in line-by-line, you lose all context. When HTS gets to an individual line, it can't parse it as a process instruction because it doesn't know that it is one. I'm afraid you'll have to take a different approach to solving your problem.
I'm not sure there is a way around this problem, frankly, because the tokens will never have a direct correlation with line numbers. One possibility would be to (forgive me!) track the number of line endings in all tokens as a rough heuristic of which line a token is on.
Cheers,
Ovid
New address of my CGI Course.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File parsing with HTML::TokeParser::Simple
by THRAK (Monk) on Feb 24, 2005 at 20:19 UTC |