File Coverage

blib/lib/XML/Liberal/Remedy/DeprecatedDTD.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::DeprecatedDTD;
2 2     2   965 use strict;
  2         3  
  2         267  
3              
4             sub apply {
5 0     0 0   my $class = shift;
6 0           my($driver, $error, $xml_ref) = @_;
7              
8 0 0         return 0 if $error->message !~
9             /:\d+: parser error : Content error in the external subset/;
10              
11 0 0         return 1 if $$xml_ref =~
12             s{(?<=\s(["'])http://)my\.netscape\.com/publish/formats(?=/rss-0\.91?\.dtd\1\s*>)}
13             {www.rssboard.org};
14              
15 0           Carp::carp("Can't find deprecated DTD, error was: ", $error->summary);
16 0           return 0;
17             }
18              
19             1;