Branch Coverage

blib/lib/XML/XSH2/XPathToXML.pm
Criterion Covered Total %
branch 38 134 28.3


line true false branch
68 8 0 unless defined $self->{'maxAutoSiblings'}
90 8 0 unless ($self->{'doc'})
91 8 0 if (ref $self->{'node'}) { }
108 0 0 unless (ref $node)
109 0 0 if ($self->{'XPathContext'}) { }
115 0 0 if ($node) { }
147 0 0 if (ref $data eq 'HASH') { }
0 0 elsif (ref $data eq 'ARRAY') { }
149 0 0 if $self->{'debug'}
154 0 0 if @$data % 2
156 0 0 if $self->{'debug'}
181 0 8 unless $xpath =~ /^(?:\$$NAME$FILTER*)?$STEP*$LAST_STEP$/
184 3 5 if ($xpath =~ s[^/][]) { }
188 0 5 if ($xpath =~ s[^(\$$NAME$FILTER*)/][./])
192 0 5 if ($context_node ne '' and not ref $context_node) { }
193 0 0 if ($self->{'XPathContext'}) { }
198 0 0 unless $context_node
208 0 11 if ($name =~ s/^($NAMECHAR+)://) { }
211 0 0 if (not defined $uri and $self->{'XPathContext'} and UNIVERSAL::can($self->{'XPathContext'}, 'lookupNs'))
215 0 0 if (not defined $uri and ref $self->{'namespaces'})
218 0 0 if (not defined $uri) { }
224 0 0 if ($real_prefix eq '' and not defined $node->lookupNamespaceURI(undef))
227 0 0 $real_prefix ne '' ? :
236 10 1 if ($axis =~ /^$|^child::|^descendant(?:-or-self)?::/) { }
1 0 elsif ($axis =~ /^(following(?:-sibling)?)::/) { }
0 0 elsif ($axis =~ /^(preceding(?:-sibling)?)::/) { }
0 0 elsif ($axis =~ /^(parent|ancestor|ancestor-or-self|self|namespace)::/) { }
240 0 1 unless $parent
244 0 0 unless $parent
258 4 8 if ($step =~ s[^(.*?)\/(.*)$][$1])
262 0 12 if $self->{'debug'}
265 12 0 $self->{'XPathContext'} ? :
268 3 9 unless ($next)
271 0 3 if ($step =~ /^(?:@|attribute::)($NAME)/) { }
0 3 elsif ($step =~ /^($AXIS)text\(\)/) { }
0 3 elsif ($step =~ /^($AXIS)comment\(\)/) { }
0 3 elsif ($step =~ /^($AXIS)processing-instruction\(($PREDICATE)\)/o) { }
273 0 0 if ($rest eq '') { }
274 0 0 if $self->{'debug'}
276 0 0 if (defined $uri and $uri ne '') { }
288 0 0 if ($rest eq '') { }
289 0 0 if $self->{'debug'}
298 0 0 if ($rest eq '') { }
299 0 0 if $self->{'debug'}
309 0 0 if ($name =~ /^(?:\s*'([^']*)'|"([^"]*)"\s*)$/) { }
311 0 0 if ($rest eq '') { }
312 0 0 if $self->{'debug'}
324 3 0 if ($step =~ /^($AXIS)($NAME)(?!\()/)
328 0 3 if ($name eq '')
333 0 11 if $self->{'debug'}
334 0 11 if ($self->{'maxAutoSiblings'} and @auto > $self->{'maxAutoSiblings'})
341 0 11 if (defined $uri and $uri ne '') { }
346 0 11 if ($node == $self->{'doc'}) { }
356 11 0 $self->{'XPathContext'} ? :
365 8 0 if ($node) { }
366 0 8 if $self->{'debug'}
367 0 8 if ($node->nodeType == 2) { }
0 8 elsif ($node->nodeType != 1) { }
372 0 8 if $node->hasChildNodes
373 0 8 if (ref $value and UNIVERSAL::isa($value, 'XML::LibXML::Node')) { }
376 6 2 if $value ne ''
414 0 0 if ($parent and not defined $self->{'tree'}{$parent})
419 0 0 if ($name =~ /^@/) { }
420 0 0 if $self->{'debug'}
425 0 0 if $self->{'debug'}
429 0 0 if ($parent) { }
435 0 0 if $value