File Coverage

blib/lib/XML/Liberal/Remedy/Declaration.pm
Criterion Covered Total %
statement 3 9 33.3
branch 0 4 0.0
condition n/a
subroutine 1 2 50.0
pod 0 1 0.0
total 4 16 25.0


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;