From 5b8d78daa0477fbce7e0f55d2fc424bae469acc2 Mon Sep 17 00:00:00 2001 From: "Paul Buetow (pluto.buetow.org)" Date: Sun, 15 Sep 2013 16:45:39 +0200 Subject: can parse xml and attribs --- Xerl/XML/Reader.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Xerl/XML/Reader.pm b/Xerl/XML/Reader.pm index c3ecbcd..96a8835 100644 --- a/Xerl/XML/Reader.pm +++ b/Xerl/XML/Reader.pm @@ -58,13 +58,13 @@ sub sax() { ); $parser->parse_uri($self->get_path()); + + return $parser->{xerl}{root}; } sub parse($) { my Xerl::XML::Reader $self = $_[0]; - my $sax_result = $self->sax(); - my $rarray = $self->get_array(); return $self unless ref $rarray eq 'ARRAY'; @@ -172,6 +172,17 @@ sub parse($) { # $root->print(); $self->set_root($root); + use Data::Dumper; + open my $foo, '>', '/tmp/root.old'; + print $foo (Dumper $root); + close $foo; + + my $root = $self->sax(); + open $foo, '>', '/tmp/root.new'; + print $foo (Dumper $root); + close $foo; + + return undef; } -- cgit v1.2.3