Branch Coverage

blib/lib/Template/Semantic/Document.pm
Criterion Covered Total %
branch 81 88 92.0


line true false branch
22 166 2 if ($self->{'engine'}{'parser'}->get_option('recover'))
41 136 2 unless defined $opt{'is_xhtml'}
43 3 135 if ($self->{'source'} =~ /^<\?xml/) { }
49 1 134 if (my $dtd = $self->{'dom'}->internalSubset) { }
133 1 elsif ($opt{'is_xhtml'}) { }
65 2 133 if ($self->{'xmlns_hacked'})
69 133 2 if ($self->{'dom_hacked'})
94 0 245 unless $exp
97 134 111 if ($exp =~ m[^(?:/|\.(?:/|$))]) { }
8 103 elsif ($exp =~ /^id\(/) { }
109 103 11 if ($elem) { }
11 0 elsif ($attr) { }
111 34 69 if $attr
124 0 206 if ref $vars ne 'HASH'
127 0 211 unless my $xpath = $self->_exp_to_xpath($exp)
137 8 304 if (not defined $value) { }
13 291 elsif ($value_type eq 'HASH') { }
15 276 elsif ($value_type eq 'ARRAY' and ref $value->[0] eq 'HASH') { }
11 265 elsif ($value_type eq 'ARRAY') { }
55 210 elsif ($value_type eq 'CODE') { }
0 210 elsif (&blessed($value) and $value->can('filter')) { }
9 201 elsif (&blessed($value) and $value->isa('Template::Semantic::Document')) { }
31 170 elsif (&blessed($value) and $value->isa('XML::LibXML::Node')) { }
9 161 elsif ($value_type eq 'SCALAR') { }
145 5 10 unless ($node->isa('XML::LibXML::Element'))
152 1 9 if ($node->isSameNode($self->{'dom'}->documentElement)) { }
162 5 11 unless ($node->isa('XML::LibXML::Element'))
170 0 27 if ref $v ne 'HASH'
174 14 13 if $joint
177 11 16 unless (defined $joint)
179 10 1 $p && $p->serialize =~ /^(\W+)$/s ? :
189 12 6 unless (ref $filter)
206 1 70 if ($@) { }
222 5 5 unless ($node->isa('XML::LibXML::Element'))
229 6 25 if ($value->isa('XML::LibXML::Attr'))
258 134 75 if ($node->isa('XML::LibXML::Element')) { }
31 44 elsif ($node->isa('XML::LibXML::Attr')) { }
22 22 elsif ($node->isa('XML::LibXML::Comment') or $node->isa('XML::LibXML::CDATASection')) { }
11 11 elsif ($node->isa('XML::LibXML::Text')) { }
261 143 0 unless $_->nodeType == 11
270 2 20 unless $_->nodeValue
280 11 60 if ($node->isa('XML::LibXML::Attr')) { }
10 50 elsif ($node->isa('XML::LibXML::Comment') or $node->isa('XML::LibXML::CDATASection')) { }
5 45 elsif ($node->isa('XML::LibXML::Text')) { }