- Timestamp:
- 2013-07-08T22:17:10+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/release-kits/shared/linux/XML-Parser/perl-5.14/XML/Parser.pm
r27768 r27777 9 9 package XML::Parser; 10 10 11 use strict; 12 13 use vars qw($VERSION $LWP_load_failed); 14 11 15 use Carp; 12 16 13 17 BEGIN { 14 18 require XML::Parser::Expat; 15 $VERSION = '2. 34';19 $VERSION = '2.41'; 16 20 die "Parser.pm and Expat.pm versions don't match" 17 21 unless $VERSION eq $XML::Parser::Expat::VERSION; 18 22 } 19 20 use strict;21 22 use vars qw($VERSION $LWP_load_failed);23 23 24 24 $LWP_load_failed = 0; … … 144 144 my $final = delete $handlers{Final}; 145 145 146 my $expatnb = new XML::Parser::ExpatNB(@expat_options, @_);146 my $expatnb = XML::Parser::ExpatNB->new(@expat_options, @_); 147 147 $expatnb->setHandlers(%handlers); 148 148 … … 168 168 } 169 169 170 my $expat = new XML::Parser::Expat(@expat_options, @_);170 my $expat = XML::Parser::Expat->new(@expat_options, @_); 171 171 my %handlers = %{$self->{Handlers}}; 172 172 my $init = delete $handlers{Init}; … … 298 298 299 299 require IO::File; 300 my $fh = new IO::File($path);300 my $fh = IO::File->new($path); 301 301 unless (defined $fh) { 302 302 $xp->{ErrorMessage} … … 337 337 338 338 use XML::Parser; 339 340 $p1 = new XML::Parser(Style => 'Debug');339 340 $p1 = XML::Parser->new(Style => 'Debug'); 341 341 $p1->parsefile('REC-xml-19980210.xml'); 342 342 $p1->parse('<foo id="me">Hello World</foo>'); 343 343 344 344 # Alternative 345 $p2 = new XML::Parser(Handlers => {Start => \&handle_start,345 $p2 = XML::Parser->new(Handlers => {Start => \&handle_start, 346 346 End => \&handle_end, 347 347 Char => \&handle_char}); … … 349 349 350 350 # Another alternative 351 $p3 = new XML::Parser(ErrorContext => 2);351 $p3 = XML::Parser->new(ErrorContext => 2); 352 352 353 353 $p3->setHandlers(Char => \&text, … … 376 376 case they override options given at XML::Parser creation time. 377 377 378 The behavior of the parser is controlled either by C<L</S tyle>> and/or379 C<L</H andlers>> options, or by L</setHandlers> method. These all provide378 The behavior of the parser is controlled either by C<L</STYLES>> and/or 379 C<L</HANDLERS>> options, or by L</setHandlers> method. These all provide 380 380 mechanisms for XML::Parser to set the handlers needed by XML::Parser::Expat. 381 381 If neither C<Style> nor C<Handlers> are specified, then parsing just
Note:
See TracChangeset
for help on using the changeset viewer.