line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Vparam::XML; |
2
|
72
|
|
|
72
|
|
5972780
|
use Mojo::Base -strict; |
|
72
|
|
|
|
|
11222
|
|
|
72
|
|
|
|
|
539
|
|
3
|
72
|
|
|
72
|
|
8201
|
use Mojolicious::Plugin::Vparam::Common qw(load_class); |
|
72
|
|
|
|
|
171
|
|
|
72
|
|
|
|
|
13089
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub parse_xml($) { |
6
|
5
|
|
|
5
|
0
|
229
|
my $str = shift; |
7
|
5
|
50
|
|
|
|
15
|
return undef unless defined $str; |
8
|
5
|
100
|
|
|
|
21
|
return undef unless length $str; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
|
|
27
|
my $e = load_class('XML::LibXML'); |
11
|
4
|
50
|
|
|
|
4094
|
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
|
265
|
my ($class, $self, $app, $conf) = @_; |
21
|
|
|
|
|
|
|
|
22
|
74
|
|
|
|
|
333
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |