Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
# ... this is the part of the code I am trying to make work my $xp; # initialize parser object and parse the string $xp = XML::XPath->new( ErrorContext => 2 ); eval { $xp->parsefile( $open_this ); }; # $open_this is the xml file # report any error that stopped parsing if( $@ ) { $@ =~ s/at \/.*?$//s; # remove module line number print STDERR "\nERROR::: $open_this isn't well formated file:\n$@\ +n"; } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trapping XML error using Perl
by psini (Deacon) on Jun 13, 2008 at 18:53 UTC | |
by Anonymous Monk on Jun 13, 2008 at 19:33 UTC | |
by psini (Deacon) on Jun 13, 2008 at 19:58 UTC | |
by Anonymous Monk on Jun 14, 2008 at 07:56 UTC |