XML parsers are supposed to barf on non-wellformed XML - it's in the spec. You should shout at whoever gives you the XML until they fix their output.
In the meantime, you can make your parsing script die a little more gracefully by using eval like this:
--my $file = 'file.rss'; my $p = XML::RSS->new; eval { $p->parsefile($file) }; if ($@) { die "Bad XML document!!\n"; } else { print "Good XML!\n"; }
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: Parsing badly formed RSS or XML
by davorg
in thread Parsing badly formed RSS or XML
by tomhukins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |