| Store | Cart

XML::Simple, how to catch error: not well-formed?

From: Kelvin Wu <kelv...@gmail.com>
Tue, 28 Dec 2004 18:50:03 +0800
Hi list,

Is it possible to catch XML error when parsing XML files using XML::Smple?

my $xml = XMLin($file);
next if $xml->error();

something like that.

I want to catch any error if the XML file is not a valid XML file,
rather than stop my script at :

not well-formed (invalid token) at line 1, column 269, byte 269 at
/usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/XML/Parser.pm
line 185

Recent Messages in this Thread
Kelvin Wu Dec 28, 2004 10:50 am
Grant McLean Dec 28, 2004 06:46 pm
Messages in this thread