Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: XML::Simple giving a non-specific error

by almut (Canon)
on Mar 12, 2010 at 00:41 UTC ( [id://828173]=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::Simple giving a non-specific error
in thread XML::Simple giving a non-specific error

By the way, the error wasn't reported at the end of the file

Judging by the byte position (377), it was (the closing angle bracket of </ROOT> is byte 375(*)).  I don't know why the line number is reported one less than it should be — maybe the <?xml ...?> header isn't being counted.

As for your other point, I think you're right if the parser would keep track of all starting positions of so far unclosed tags.

___

(*) assuming unix newlines, which I did after having seen i386-linux-thread-multi in the OP's error message.

Replies are listed 'Best First'.
Re^4: XML::Simple giving a non-specific error
by ikegami (Patriarch) on Mar 12, 2010 at 00:50 UTC

    If a guy catches the baseball at the edge of the outfield, it's not the edge of the outfield that caught the ball. Aside from the fact that it really was found before EOF (since at least the last newline and the EOF remain unparsed), the point was that the error could have been caught earlier, and would have been caught earlier (say if you had <ROOT><BODY><ERROR><ERROR></BODY></ROOT>).

    Besides, the following indicates the reported byte pos for me:

    </ROOT> ^ |

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://828173]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found