diff options
| author | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-28 17:11:45 +0200 |
|---|---|---|
| committer | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-28 17:11:45 +0200 |
| commit | 215b7573acc8462c7ae0ea594f270bf21323bd11 (patch) | |
| tree | ae820dc9b763e394abdd812156c6fee14200e3f4 /Xerl/XML/SAXHandler.pm | |
| parent | 887eb3f41018262fc562e51561310cd0fdfb3bb0 (diff) | |
perltidy
Diffstat (limited to 'Xerl/XML/SAXHandler.pm')
| -rw-r--r-- | Xerl/XML/SAXHandler.pm | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/Xerl/XML/SAXHandler.pm b/Xerl/XML/SAXHandler.pm index 0b6b425..47febc2 100644 --- a/Xerl/XML/SAXHandler.pm +++ b/Xerl/XML/SAXHandler.pm @@ -2,7 +2,7 @@ # # E-Mail: xerl@dev.buetow.org WWW: http://xerl.buetow.org # -# This is free software, you may use it and distribute it under the same +# This is free software, you may use it and distribute it under the same # terms as Perl itself. package Xerl::XML::SAXHandler; @@ -20,39 +20,38 @@ use Xerl::Base; use Xerl::XML::Element; sub start_document { - my ($self, $doc) = @_; + my ( $self, $doc ) = @_; - $self->{xerl}{root} = undef; + $self->{xerl}{root} = undef; $self->{xerl}{current} = undef; - $self->{xerl}{stack} = []; - + $self->{xerl}{stack} = []; return undef; } sub start_element { - my ($self, $doc) = @_; + my ( $self, $doc ) = @_; my $x = $self->{xerl}; - if (defined $x->{current}) { - push @{$x->{stack}}, $x->{current}; + if ( defined $x->{current} ) { + push @{ $x->{stack} }, $x->{current}; $x->{root} = $x->{current} unless defined $x->{root}; } - my %params = map { $_->{Name} => $_->{Value} } values %{$doc->{Attributes}}; + my %params = map { $_->{Name} => $_->{Value} } values %{ $doc->{Attributes} }; $x->{current} = Xerl::XML::Element->new(); $x->{current}->set_text(''); - $x->{current}->set_name($doc->{Name}); - $x->{current}->set_params(\%params) if %params; + $x->{current}->set_name( $doc->{Name} ); + $x->{current}->set_params( \%params ) if %params; - ${$x->{stack}}[-1]->push_array($x->{current}) if @{$x->{stack}}; + ${ $x->{stack} }[-1]->push_array( $x->{current} ) if @{ $x->{stack} }; return undef; } sub characters { - my ($self, $doc) = @_; + my ( $self, $doc ) = @_; my $x = $self->{xerl}; my $data = $doc->{Data}; @@ -66,10 +65,10 @@ sub characters { } sub end_element { - my ($self, $doc) = @_; + my ( $self, $doc ) = @_; my $x = $self->{xerl}; - $x->{current} = pop @{$x->{stack}}; + $x->{current} = pop @{ $x->{stack} }; return undef; } |
