Branch Coverage

blib/lib/XML/XPathScript.pm
Criterion Covered Total %
branch 91 176 51.7


line true false branch
11 0 176 unless defined $XML::XPathScript::current
26 65 0 if (@_)
39 63 0 if (my $regex = shift())
54 0 1 unless defined $self->{'printer'}
91 0 29 if (grep {$_ eq 'XML::XPath';} @_) { }
0 29 elsif (grep {$_ eq 'XML::LibXML';} @_) { }
103 0 63 if @_ % 2
108 53 10 if $params{'xml'}
111 0 63 exists $params{'interpolation'} ? :
118 0 63 if ($XML_parser eq 'XML::XPath') { }
129 0 63 if $@
139 6 15 if $xml
141 5 16 if ($stylesheet)
146 2 19 $args ? :
165 7 69 ref $xml ? :
180 0 0 if ($XML_parser eq 'auto')
182 0 0 if (UNIVERSAL::isa($self->{'xml'}, 'XML::XPath')) { }
0 0 elsif (UNIVERSAL::isa($self->{'xml'}, 'XML::LibXML')) { }
194 0 0 if (UNIVERSAL::isa($self->{'xml'}, 'XML::XPath')) { }
0 0 elsif (UNIVERSAL::isa($self->{'xml'}, 'XML::libXML')) { }
196 0 0 if ($XML_parser eq 'XML::XPath' or $XML_parser eq 'auto') { }
208 0 0 if ($XML_parser eq 'XML::LibXML' or $XML_parser eq 'auto') { }
220 0 0 if $XML_parser eq 'auto'
222 0 0 if (ref $self->{'xml'})
227 0 0 $XML_parser eq 'XML::LibXML' ? :
237 7 0 if ($XML_parser eq 'XML::LibXML') { }
238 1 6 if ($xml->isa('XML::LibXML::Document'))
243 1 5 if ($xml->isa('XML::LibXML::Node'))
251 0 0 if ($xml->isa('XML::XPath'))
256 0 0 if ($xml->isa('XML::XPath::Node'))
265 5 0 $XML_parser eq 'XML::LibXML' ? :
278 1 0 if (index($xml, "\n") == -1 and index($xml, '<') == -1 and index($xml, '>') == -1 and -f $xml)
281 0 1 unless open my $fh, '<', $xml
283 1 0 $XML_parser eq 'XML::LibXML' ? :
293 68 0 $XML_parser eq 'XML::LibXML' ? :
307 9 0 if $self->{'stylesheet'}
314 66 7 if (UNIVERSAL::isa($printer, 'SCALAR'))
315 72 1 if $printer
317 0 73 unless $self->{'dom'}
320 73 0 if $XML_parser eq 'XML::LibXML'
329 0 73 if $^V lt v5.7.0
332 58 15 unless $self->{'compiledstylesheet'}
357 206 131 if (-1 == index($token, '<%'))
359 14 192 if -1 < index($tokens[0], '<%') and -1 < index($tokens[0], '-')
366 101 105 if length $token
379 16 310 if -1 < index($t, '<%')
380 147 179 if -1 < index($t, '%>')
381 131 195 if ($level == 0)
388 0 131 unless $closing_tag
393 53 78 if (-1 < index($opening_tag, '=')) { }
15 63 elsif (-1 < index($opening_tag, '~')) { }
4 59 elsif (-1 < index($opening_tag, '#')) { }
3 56 elsif (-1 < index($opening_tag, '@')) { }
406 0 3 unless my $tag = $1
424 18 113 if (-1 < index($closing_tag, '-'))
450 0 0 if ($type eq '<%=') { }
0 0 elsif ($type eq ''
460 0 0 if defined $2
464 0 0 unless $params{'file'}
470 0 0 unless $contents =~ /\G(.*?)%>/cgs
472 0 0 if ($type ne '<%#')
480 0 0 if ($contents =~ /\G(.+)/cgs)
496 20 91 if (ref $stylesheet) { }
510 19 0 unless ($filename =~ m[^\.?/])
516 5 14 $includestack[0] && $includestack[0] =~ m[^\.?/] ? :
525 2 17 if (grep {$_ eq $filename;} @includestack)
532 17 0 unless ($stylesheet = $self->{'stylesheet_cache'}{$filename})
533 0 17 unless open my $fh, '<', $filename
556 59 10 if (exists $self->{'stylesheet'}) { }
10 0 elsif (exists $self->{'stylesheetfile'}) { }
611 0 69 unless defined $retval
623 1 165 if (not defined $printer) { }
10 155 elsif (ref $printer eq 'CODE') { }
151 4 elsif (UNIVERSAL::isa($printer, 'SCALAR')) { }
642 0 71 if $_[1] <= $XML::XPathScript::debug_level
648 1 0 unless $self->{'compiledstylesheet'}
672 0 1 if ($XML_parser eq 'XML::XPath') { }
1 0 elsif ($XML_parser eq 'XML::LibXML') { }
673 0 0 $XML::XPath::VERSION < 1.07 ? :
693 0 1 if ($uri =~ /^\w\w+:/ and not $uri =~ /^axkit:/) { }
700 0 0 if (my $E = $@)
706 1 0 if ($XML_parser eq 'XML::LibXML') { }
0 0 elsif ($XML_parser eq 'XML::XPath') { }
714 1 0 if ($newdoc)
715 1 0 if ($XML_parser eq 'XML::LibXML') { }
0 0 elsif ($XML_parser eq 'XML::XPath') { }