Branch Coverage

blib/lib/XML/Stream/Node.pm
Criterion Covered Total %
branch 100 160 62.5


line true false branch
154 214 582 if (ref $_[0] eq 'XML::Stream::Node')
164 578 4 if defined $tag
165 2 580 if defined $data
177 0 0 unless defined $indent
179 0 0 if ($$self{'TAG'} eq '__xmlstream__:node:cdata') { }
187 0 0 if (scalar keys %{$$self{'ATTRIBS'};} > 0)
195 0 0 if ($#{$$self{'CHILDREN'};} == -1) { }
217 25 710 unless exists $$self{'CHILDREN'}
239 0 0 if ($child == $$self{'CHILDREN'}[$index])
268 32 1 if $child->get_tag eq '__xmlstream__:node:cdata'
283 0 0 if ($$self{'CHILDREN'}[$index]->get_tag eq '__xmlstream__:node:cdata')
299 81 46 unless exists $$self{'ATTRIBS'}
309 91 204 unless exists $$self{'ATTRIBS'}{$key}
331 0 0 unless exists $$self{'ATTRIBS'}{$key}
348 106 53 if $#{$$self{'RAWXML'};} == -1
381 0 0 unless $#results > -1
382 0 0 unless wantarray
412 4 1 if ($child->get_tag eq '__xmlstream__:node:cdata') { }
440 118 134 if ref $_[0] eq 'XML::Stream::Parser'
441 134 118 unless ref $_[0] eq 'XML::Stream::Parser'
452 213 39 if ($#{$$self{'SIDS'}{$sid}{'node'};} >= 0)
472 172 180 if ref $_[0] eq 'XML::Stream::Parser'
473 180 172 unless ref $_[0] eq 'XML::Stream::Parser'
479 36 316 if $#{$$self{'SIDS'}{$sid}{'node'};} == -1
498 118 136 if ref $_[0] eq 'XML::Stream::Parser'
499 136 118 unless ref $_[0] eq 'XML::Stream::Parser'
507 2 252 if ($#{$$self{'SIDS'}{$sid}{'node'};} == -1)
510 0 2 if ($$self{'SIDS'}{$sid}{'rootTag'} ne $tag)
521 39 213 if ($#{$$self{'SIDS'}{$sid}{'node'};} == -1)
525 37 2 if (ref $self ne 'XML::Stream::Parser')
529 3 34 if (defined $$self{'SIDS'}{$sid}{'node'}[0] and $$self{'SIDS'}{$sid}{'node'}[0]->get_tag =~ /^$stream_prefix\:/) { }
546 0 34 if ($#special > -1) { }
550 0 0 if $xmlns eq &XML::Stream::ConstXMLNS('xmpp-sasl')
552 0 0 if $xmlns eq &XML::Stream::ConstXMLNS('xmpp-tls')
587 0 0 if ($tag ne '') { }
589 0 0 if ($type eq 'single')
593 0 0 if ($$XMLTree[1][$child] eq $tag)
599 0 0 if $data ne ''
606 0 0 if $data ne ''
611 0 0 if $data ne ''
661 470 506 unless defined $tag
662 808 168 unless defined $attrib
663 976 0 unless defined $value
670 338 638 if ($tag ne '') { }
676 1205 635 if ($child->get_tag eq $tag or $tag eq '*')
681 0 0 if $value ne '' and $attrib ne '' and $child->get_attrib($attrib) and $XMLTree->get_attrib($attrib) ne $value
682 0 1205 if $attrib ne '' and not $child->get_attrib($attrib)
687 0 1205 if ($type eq 'existence')
695 4 1201 if ($type eq 'value')
697 4 0 if ($attrib eq '')
702 0 0 if defined $XMLTree->get_attrib($attrib)
709 0 1201 if ($type eq 'value array')
711 0 0 if ($attrib eq '') { }
718 0 0 if defined $XMLTree->get_attrib($attrib)
726 0 1201 if ($type eq 'tree')
734 144 1057 if ($type eq 'tree array')
742 949 252 if ($type eq 'child array')
744 435 514 if $child->get_tag ne '__xmlstream__:node:cdata'
749 108 1093 if ($type eq 'count')
756 0 1201 if ($type eq 'attribs')
765 217 58 if ($type eq 'tree array' or $type eq 'value array' or $type eq 'child array')
774 58 0 if ($type eq 'count')
789 193 445 if ($type eq 'value')
791 25 168 if ($attrib eq '')
796 90 78 if $XMLTree->get_attrib($attrib)
803 0 523 if ($type eq 'tree')
811 0 523 if ($type eq 'existence')
813 0 0 if ($attrib ne '')
815 0 0 if $value ne ''
824 1 522 if ($type eq 'attribs')
831 444 78 if ($type eq 'tag')
840 0 78 if $type eq 'existence'
841 78 0 if $type eq 'value'
866 115 8 if ($#children > -1 or defined $rawXML and $rawXML ne '' or defined $node->get_raw_xml and $node->get_raw_xml ne '') { }
874 145 84 if ($child->get_tag eq '__xmlstream__:node:cdata') { }
883 17 98 if defined $node->get_raw_xml and $node->get_raw_xml ne ''
887 17 98 if defined $rawXML and $rawXML ne ''
928 86 58 if ($tree->get_tag eq '__xmlstream__:node:cdata') { }
931 23 63 unless $str =~ /^\s*$/
935 20 38 if (&XML::Stream::GetXMLData('count', $XMLTree, $tree->get_tag) > 1) { }