gam3 has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to keep XML::Parser from converting numeric entities into
UTF8?
Or is there some other parser that will let me do this?
I would like this program to outputuse strict; use XML::Parser; use vars qw($parser); sub handle_start { my $self = shift; my $x = shift; print "<" . $x . '>' ; } sub handle_end { my $self = shift; my $x = shift; print "</" . $x . '>' ; } sub handle_char { my $self = shift; my $x = shift; print $x; } $parser = XML::Parser->new( Handlers => { Start => \&handle_start, End => \&handle_end, Char => \&handle_char } ); $parser->parse(<<XML); <start>–</start> XML
not<start>–</start>
<start>–</start>
-- gam3
A picture is worth a thousand words, but takes 200K.
A picture is worth a thousand words, but takes 200K.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::Parser and numeric entities
by ikegami (Patriarch) on Jan 14, 2010 at 02:53 UTC | |
by gam3 (Curate) on Jan 14, 2010 at 10:50 UTC |
Back to
Seekers of Perl Wisdom