line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Liberal::Remedy::Declaration; |
2
|
2
|
|
|
2
|
|
1288
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
302
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# optimized to fix all errors in one apply() call |
5
|
|
|
|
|
|
|
sub apply { |
6
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
7
|
0
|
|
|
|
|
|
my($driver, $error, $xml_ref) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
0
|
|
|
|
|
return 0 if $error->message !~ |
10
|
|
|
|
|
|
|
/^parser error : XML declaration allowed only at the start of the document/; |
11
|
|
|
|
|
|
|
|
12
|
0
|
0
|
|
|
|
|
return 1 if $$xml_ref =~ s/^\s+(?=<)//; # s/^[^<]+// |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
Carp::carp("No whitespace found at the start of the document, error was: ", |
15
|
|
|
|
|
|
|
$error->summary); |
16
|
0
|
|
|
|
|
|
return 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |