artist has asked for the wisdom of the Perl Monks concerning the following question:
It gives me error:use XML::Simple; use strict; use warnings; $| += 1; opendir TMP,'/u1/tmptest'; my @files = grep /xml$/, grep { - r } readdir TMP; chdir '/u1/tmptest'; my $flag = 0; foreach my $file (@files){ my $tmp_xml = XMLin("./$file"); process($tmp_xml); } sub process { my $xml = shift; my $title = $xml->{head}->{title}; .... }
Character reference & #133; refers to an illegal XML character (\205)When I checked the particular file, it has & #133; character inside.
What I like to do is either correct the problem and proceed or ignore the file. I don't have control over the source files. If I don't process this file it gives error for some other similar character .. ex: & #146;
In CB, podmaster pointed out that it XML::Simple which is based on XML::Parser dies upon invalid xml. I like to find some solution at this point.
Thanks,
artist
(Note: In the above examples & and # should not have space between them.. it's just that PM tries to interprete the character.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple exit problem
by mirod (Canon) on Dec 18, 2003 at 22:03 UTC | |
|
Re: XML::Simple exit problem
by neuroball (Pilgrim) on Dec 19, 2003 at 04:41 UTC |