XML::LibXML::SAX allows bad XML
by Grant McLean other posts by this author
Jan 24 2005 12:40AM messages near this date
view in the new Beta List Site
RE: Regarding Perl LibXML
|
Regarding Perl LibXML
& XSLT The XML::LibXML::SAX parser module doesn't seem to throw exceptions when
it encounters badly formed XML. For example:
package MyHandler;
use base 'XML::SAX::Base';
sub characters { print "Character data: '$_[1]-> {Data}'\n"; }
package main;
use XML::LibXML::SAX;
my $handler = MyHandler-> new;
my $parser = XML::LibXML::SAX-> new(Handler => $handler);
$parser-> parse_string('<para>one < two</para>');
Which prints:
Character data: 'one '
Character data: ' two'
When it ought to die on the rogue '<' character. Other errors like
mismatched closing tags also don't trigger exceptions.
This is the default SAX parser installed into ParserDetails.ini by the
XML::LibXML Makefile.
I don't think this behaviour is new, but for some reason, I'm getting
more people reporting it to me as a bug in XML::Simple recently :-(
Anyone know if this behaviour is deliberate?
Cheers
Grant
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|