in reply to XML parsing with XML::Rules
G'day mcoblentz,
It would appear that's poorly documented and read_chunk_of_data() is either pseudocode or a function you're supposed to write yourself.
I haven't used this module previously; however, something like this seems to be the intent:
$ perl -Mstrict -Mwarnings -e ' use XML::Rules; use Data::Dumper; my @xml = qw{<some_tag> some content </some_tag>}; my $parser = XML::Rules::->new( rules => [ _default => sub {$_[0] => $_[1]->{_content}} ] ); for (@xml) { $parser->parse_chunk($_); } my $data = $parser->last_chunk(); print Dumper $data; ' $VAR1 = { 'some_tag' => 'somecontent' };
Someone who's actually used the module before may have a better answer.
Update: Minor text change: s/write it yourself/write yourself/
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML parsing with XML::Rules
by Anonymous Monk on Jun 16, 2013 at 09:43 UTC | |
by kcott (Archbishop) on Jun 16, 2013 at 10:58 UTC | |
by Anonymous Monk on Jun 16, 2013 at 11:20 UTC | |
by kcott (Archbishop) on Jun 16, 2013 at 18:48 UTC |