line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Vparam::XML; |
2
|
72
|
|
|
72
|
|
5351114
|
use Mojo::Base -strict; |
|
72
|
|
|
|
|
7258
|
|
|
72
|
|
|
|
|
469
|
|
3
|
72
|
|
|
72
|
|
6879
|
use Mojolicious::Plugin::Vparam::Common qw(load_class); |
|
72
|
|
|
|
|
148
|
|
|
72
|
|
|
|
|
11516
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub parse_xml($) { |
6
|
5
|
|
|
5
|
0
|
169
|
my $str = shift; |
7
|
5
|
50
|
|
|
|
13
|
return undef unless defined $str; |
8
|
5
|
100
|
|
|
|
16
|
return undef unless length $str; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
|
|
16
|
my $e = load_class('XML::LibXML'); |
11
|
4
|
50
|
|
|
|
3298
|
die $e if $e; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
0
|
my $dom = eval{ XML::LibXML->load_xml(string => $str) }; |
|
0
|
|
|
|
|
0
|
|
14
|
0
|
0
|
0
|
|
|
0
|
warn $@ and return undef if $@; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
0
|
return $dom; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub register { |
20
|
74
|
|
|
74
|
0
|
227
|
my ($class, $self, $app, $conf) = @_; |
21
|
|
|
|
|
|
|
|
22
|
74
|
|
|
|
|
256
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |