M
maxwells
Can anybody tell me why the following does not work as I expect it? It
is supposed to call the die function, because of the incorrect XML it
is parsing:
#!/usr/bin/perl
use XML:
arser;
$p1 = new XML:
arser;
if($p1->parse('<foo id="me">Hello World/foo>')){print 'xml is ok';}
else {die 'Error found - please check your xml';}
Instead it gives:
no element found at line 1, column 29, byte 29 at /usr/lib/perl5/
vendor_perl/5.8.8/i386-linux/XML/Parser.pm line 187
If I correct the xml by inserting a "<" after Hello World it prints
out 'xml is ok'.
Any help would be appreciated!
max
is supposed to call the die function, because of the incorrect XML it
is parsing:
#!/usr/bin/perl
use XML:
$p1 = new XML:
if($p1->parse('<foo id="me">Hello World/foo>')){print 'xml is ok';}
else {die 'Error found - please check your xml';}
Instead it gives:
no element found at line 1, column 29, byte 29 at /usr/lib/perl5/
vendor_perl/5.8.8/i386-linux/XML/Parser.pm line 187
If I correct the xml by inserting a "<" after Hello World it prints
out 'xml is ok'.
Any help would be appreciated!
max