On Wed, 2004-08-18 at 21:20 +1000, Louis wrote:
> Hi Sluggers:
> 
> I am parsing a rss url using XML::Parser for processing. I am getting this
> error from XML::Parser
> 
> not well-formed (invalid token) at line 1, column 4, byte 4 at
> /usr/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi-ld/XML/Parser.pm
> line 187
> 
> Does this mean the rss format I am parsing is not a supporting one for
> XML::Parser ?

Well, that's probably what it means. XML parsers are generally pretty
good at spotting errors. If you're able to reveal the source of your
XML, perhaps we could find the error. Of course, that may not be much
help unless you also control the source of the RSS.

The other option to consider is that there are XML parsers around that
will deal with dodgy XML. It's been too long since I've used the perl
XML libs, bit there might even be a flag you can set to get them to
work.

If you just want to catch the error, then you need to use eval. Like
this:

eval {
   # do stuff
};
warn "something broke" if $@;

HTH,

James.

-- 
James Gregory <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to