S
Shiraz
I am trying to use the XML simple to parse out some xml data. If I use
the code below with invalid xml, i just get a warning 'not well-formed
(invalid token) at line 1, column 16, byte 16 at /usr/local/lib/perl5/
site_perl/5.8.7/i686-linux/XML/Parser.pm line 187'
A test like 'unless (my $data = $xml->XMLin($msg) ) ' doesnt work
either.
Anyone know how to test for valid XML using just XML::Simple or would
i have to get a XML checking library
Thanks,
code:
#!/usr/bin/perl
use strict;
use XML::Simple;
$|=1;
my $xml = new XML::Simple;
my $msg = '<xml><select app>orig_gw</select></xml>'; #this is bad xml
my $data = $xml->XMLin($msg)
result:
not well-formed (invalid token) at line 1, column 16, byte 16 at /usr/
local/lib/perl5/site_perl/5.8.7/i686-linux/XML/Parser.pm line 187
the code below with invalid xml, i just get a warning 'not well-formed
(invalid token) at line 1, column 16, byte 16 at /usr/local/lib/perl5/
site_perl/5.8.7/i686-linux/XML/Parser.pm line 187'
A test like 'unless (my $data = $xml->XMLin($msg) ) ' doesnt work
either.
Anyone know how to test for valid XML using just XML::Simple or would
i have to get a XML checking library
Thanks,
code:
#!/usr/bin/perl
use strict;
use XML::Simple;
$|=1;
my $xml = new XML::Simple;
my $msg = '<xml><select app>orig_gw</select></xml>'; #this is bad xml
my $data = $xml->XMLin($msg)
result:
not well-formed (invalid token) at line 1, column 16, byte 16 at /usr/
local/lib/perl5/site_perl/5.8.7/i686-linux/XML/Parser.pm line 187