aroso has asked for the wisdom of the Perl Monks concerning the following question:
This script find the tags that i can. But i need the content between the tags.#!C:/server/Perl/bin/perl.exe use strict; use XML::Parser; my $parser = new XML::Parser(ErrorContext => 2); $parser->setHandlers(Char => \&char_handler, Default => \&default_handler); $parser->parsefile('xml_teste1.xml'); sub char_handler { # This is just here to reduce the noise seen by # the default handler } # End of char_handler sub default_handler { my ($p, $data) = @_; if ($data =~ /^Entity id/) { my $line = $p->current_line; $data =~ s/\n/\n\t/g; print "$line:\t$data\n"; } } # End of default_handler
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Parser
by davorg (Chancellor) on Jul 28, 2003 at 11:31 UTC | |
|
Re: XML::Parser
by liz (Monsignor) on Jul 28, 2003 at 12:28 UTC | |
by vek (Prior) on Jul 28, 2003 at 15:57 UTC | |
by liz (Monsignor) on Jul 28, 2003 at 16:32 UTC | |
|