Skip to content

Commit

Permalink
Merge pull request #2 from toddr/master
Browse files Browse the repository at this point in the history
Different patches from bug tracker
  • Loading branch information
chorny committed May 25, 2011
2 parents 8b0a6dd + ade7d56 commit d971407
Show file tree
Hide file tree
Showing 4 changed files with 474 additions and 456 deletions.
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Revision history for Perl extension XML::Parser.

2.40_01 2011-05-24 (by Todd Rinaldo)
- better installation instructions
- Small spelling patches from Debian package - Thanks Nicholas Bamber
- RT 68399 - Upgrade Devel::CheckLib to 0.93 to make it
perl 5.14 compliant - qw()
- RT 67207 - Stop doing tied on globs - Thanks sprout
- RT 31319 - Fix doc links in POD for XML/Parser.pm

2.40 2010-09-16 (by Alexandr Ciornii)
- Add windows-1251.enc, ibm866.enc, koi8-r.enc (Russian)
- Add windows-1255.enc (Hebrew)
Expand Down
17 changes: 9 additions & 8 deletions Expat/Expat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Carp;
require DynaLoader;

@ISA = qw(DynaLoader);
$VERSION = "2.40";
$VERSION = "2.40_01";

$have_File_Spec = $INC{'File/Spec.pm'} || do 'File/Spec.pm';

Expand Down Expand Up @@ -442,33 +442,34 @@ sub parse {
my $result = 0;

if (defined $arg) {
local *@;
if (ref($arg) and UNIVERSAL::isa($arg, 'IO::Handle')) {
$ioref = $arg;
} elsif (tied($arg)) {
my $class = ref($arg);
no strict 'refs';
$ioref = $arg if defined &{"${class}::TIEHANDLE"};
} elsif ($] < 5.008 and defined tied($arg)) {
require IO::Handle;
$ioref = $arg;
}
else {
require IO::Handle;
eval {
no strict 'refs';
$ioref = *{$arg}{IO} if defined *{$arg};
};
undef $@;
}
}

if (defined($ioref)) {
my $delim = $self->{Stream_Delimiter};
my $prev_rs;
my $ioclass = ref $ioref;
$ioclass = "IO::Handle" if !length $ioclass;

$prev_rs = ref($ioref)->input_record_separator("\n$delim\n")
$prev_rs = $ioclass->input_record_separator("\n$delim\n")
if defined($delim);

$result = ParseStream($parser, $ioref, $delim);

ref($ioref)->input_record_separator($prev_rs)
$ioclass->input_record_separator($prev_rs)
if defined($delim);
} else {
$result = ParseString($parser, $arg);
Expand Down
6 changes: 3 additions & 3 deletions Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use Carp;

BEGIN {
require XML::Parser::Expat;
$VERSION = '2.40';
$VERSION = '2.40_01';
die "Parser.pm and Expat.pm versions don't match"
unless $VERSION eq $XML::Parser::Expat::VERSION;
}
Expand Down Expand Up @@ -375,8 +375,8 @@ These options are then passed on to the Expat object on each parse call.
They can also be given as extra arguments to the parse methods, in which
case they override options given at XML::Parser creation time.
The behavior of the parser is controlled either by C<L</Style>> and/or
C<L</Handlers>> options, or by L</setHandlers> method. These all provide
The behavior of the parser is controlled either by C<L</STYLES>> and/or
C<L</HANDLERS>> options, or by L</setHandlers> method. These all provide
mechanisms for XML::Parser to set the handlers needed by XML::Parser::Expat.
If neither C<Style> nor C<Handlers> are specified, then parsing just
checks the document for being well-formed.
Expand Down
Loading

0 comments on commit d971407

Please sign in to comment.