File Coverage

blib/lib/XML/Liberal/Remedy/DeprecatedDTD.pm
Criterion Covered Total %
statement 6 9 66.6
branch 1 4 25.0
condition n/a
subroutine 2 2 100.0
pod 0 1 0.0
total 9 16 56.2


line stmt bran cond sub pod time code
1             package XML::Liberal::Remedy::DeprecatedDTD;
2 5     5   2011 use strict;
  5         10  
  5         551  
3              
4             sub apply {
5 149     149 0 230 my $class = shift;
6 149         248 my($driver, $error, $xml_ref) = @_;
7              
8 149 50       290 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 0            
15 0           Carp::carp("Can't find deprecated DTD, error was: ", $error->summary);
16             return 0;
17             }
18              
19             1;