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 1
1
package Paws::Net::RestXMLResponse ;
2
2
use Moose;
3
- use XML::Simple qw/ / ;
3
+ use XML::Hash::XS qw/ / ;
4
4
use Carp qw( croak) ;
5
5
use HTTP::Status;
6
6
use Paws::Exception;
@@ -10,12 +10,10 @@ package Paws::Net::RestXMLResponse;
10
10
11
11
return {} if (not defined $data or $data eq ' ' );
12
12
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 ,
17
15
);
18
- return $xml -> parse_string ($data );
16
+ return $xml -> xml2hash ($data );
19
17
}
20
18
21
19
sub process {
Original file line number Diff line number Diff line change 1
1
package Paws::Net::XMLResponse ;
2
2
use Moose;
3
- use XML::Simple qw/ / ;
3
+ use XML::Hash::XS qw/ / ;
4
+
4
5
use Carp qw( croak) ;
5
6
use Paws::Exception;
6
-
7
7
has _xml_parser => (
8
8
is => ' ro' ,
9
9
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 ,
14
12
);
15
13
}
16
14
);
@@ -27,7 +25,7 @@ package Paws::Net::XMLResponse;
27
25
);
28
26
}
29
27
30
- my $struct = eval { $self -> _xml_parser-> parse_string ($response -> content) };
28
+ my $struct = eval { $self -> _xml_parser-> xml2hash ($response -> content) };
31
29
if ($@ ){
32
30
return Paws::Exception-> throw(
33
31
message => $@ ,
You can’t perform that action at this time.
0 commit comments