File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 11package Paws::Net::RestXMLResponse ;
22 use Moose;
3- use XML::Simple qw/ / ;
3+ use XML::Hash::XS qw/ / ;
44 use Carp qw( croak) ;
55 use HTTP::Status;
66 use Paws::Exception;
@@ -10,12 +10,10 @@ package Paws::Net::RestXMLResponse;
1010
1111 return {} if (not defined $data or $data eq ' ' );
1212
13- my $xml = XML::Simple-> new(
14- ForceArray => qr / ^(?:item|Errors)/ i ,
15- KeyAttr => ' ' ,
16- SuppressEmpty => undef ,
13+ my $xml = XML::Hash::XS-> new(
14+ force_array => qr / ^(?:item|Errors)/ i ,
1715 );
18- return $xml -> parse_string ($data );
16+ return $xml -> xml2hash ($data );
1917 }
2018
2119 sub process {
Original file line number Diff line number Diff line change 11package Paws::Net::XMLResponse ;
22 use Moose;
3- use XML::Simple qw/ / ;
3+ use XML::Hash::XS qw/ / ;
4+
45 use Carp qw( croak) ;
56 use Paws::Exception;
6-
77 has _xml_parser => (
88 is => ' ro' ,
99 default => sub {
10- return XML::Simple-> new(
11- ForceArray => qr / ^(?:item|Errors)/ i ,
12- KeyAttr => ' ' ,
13- SuppressEmpty => undef ,
10+ return XML::Hash::XS-> new(
11+ force_array => qr / ^(?:item|Errors)/ i ,
1412 );
1513 }
1614 );
@@ -27,7 +25,7 @@ package Paws::Net::XMLResponse;
2725 );
2826 }
2927
30- my $struct = eval { $self -> _xml_parser-> parse_string ($response -> content) };
28+ my $struct = eval { $self -> _xml_parser-> xml2hash ($response -> content) };
3129 if ($@ ){
3230 return Paws::Exception-> throw(
3331 message => $@ ,
You can’t perform that action at this time.
0 commit comments