summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow (pluto.buetow.org) <paul@buetow.org>2013-09-15 16:45:39 +0200
committerPaul Buetow (pluto.buetow.org) <paul@buetow.org>2013-09-15 16:45:39 +0200
commit5b8d78daa0477fbce7e0f55d2fc424bae469acc2 (patch)
tree2a86222e16e242a437241bae9c7b086d62f83f2d
parent439c92f7f9fa119cac30f114bcf8a70dd1a5c16a (diff)
can parse xml and attribs
-rw-r--r--Xerl/XML/Reader.pm15
1 files 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;
}