Branch Coverage

blib/lib/XML/Writer.pm
Criterion Covered Total %
branch 200 200 100.0


line true false branch
42 159 171 if ($params{'NAMESPACES'})
60 1 170 if ($newlines)
66 15 156 if (lc $outputEncoding eq 'us-ascii') { }
109 1 88 if $use_selfcontained_output and defined wantarray
114 1 80 if (not $seen{'ELEMENT'}) { }
1 79 elsif ($elementLevel > 0) { }
128 1 21 if ($standalone and $standalone ne "no")
135 18 4 unless (defined $encoding)
139 7 14 if ($encoding)
142 2 19 if ($standalone)
150 2 21 if ($seen{'ANYTHING'}) { }
161 3 5 if ($data) { }
166 7 1 if ($elementLevel == 0)
175 1 10 if ($name =~ /^xml/i and not $name =~ /^xml-(stylesheet|model)$/i)
179 2 9 if ($name =~ /\?\>/ or defined $data and $data =~ /\?\>/) { }
1 8 elsif ($name =~ /\s/) { }
190 5 9 if ($dataMode and $elementLevel)
195 5 9 if ($dataMode and $elementLevel) { }
8 1 elsif ($elementLevel == 0) { }
205 2 12 if ($data =~ /--/)
209 1 13 if ($data =~ /-->/) { }
221 5 5 if ($publicId) { }
2 3 elsif (defined $systemId) { }
222 2 3 unless (defined $systemId)
235 1 10 if ($seen{'DOCTYPE'}) { }
1 9 elsif ($seen{'ELEMENT'}) { }
248 29 14 if ($dataMode and $hasHeading || $elementLevel)
257 43 63 if ($dataMode)
273 1 103 if ($seen{'ELEMENT'} and $elementLevel == 0) { }
1 102 elsif ($elementLevel == 0 and $seen{'DOCTYPE'} and $name ne $seen{'DOCTYPE'}) { }
2 100 elsif ($dataMode and $hasData) { }
290 18 1 if ($dataMode and $hasHeading || $elementLevel)
297 19 62 if ($dataMode)
309 1 79 if ($seen{'ELEMENT'} and $elementLevel == 0) { }
1 78 elsif ($elementLevel == 0 and $seen{'DOCTYPE'} and $name ne $seen{'DOCTYPE'}) { }
1 77 elsif ($dataMode and $hasData) { }
327 1 81 unless $name
329 20 62 if ($dataMode and $hasElement)
334 36 46 if ($dataMode)
343 1 76 if ($elementLevel <= 0) { }
1 75 elsif ($name and $name ne $oldName) { }
354 1 40 if ($data =~ /[\&\<\>]/)
365 1 42 if ($elementLevel < 1) { }
1 41 elsif ($dataMode and $hasElement) { }
394 1 10 if ($elementLevel < 1) { }
1 9 elsif ($dataMode and $hasElement) { }
407 10 161 if ($unsafe) { }
445 2 2 if $el eq $ancestor
456 3 2 if ($n < scalar @elementStack) { }
465 4 3 if (ref $output ne 'XML::Writer::_PrintChecker') { }
475 3 174 if (defined $newOutput and not ref $newOutput)
476 2 1 if ('self' eq $newOutput) { }
484 7 169 if (ref $newOutput eq 'SCALAR') { }
490 21 1 if ($outputEncoding and ref $output eq 'GLOB' || $output->isa('IO::Handle'))
491 4 17 if (lc $outputEncoding eq 'utf-8') { }
15 2 elsif (lc $outputEncoding eq 'us-ascii') { }
501 6 168 if ($params{'CHECK_PRINT'})
509 2 3 $use_selfcontained_output ? :
513 2 1 unless $use_selfcontained_output
528 169 10 if ($_[0] =~ /^\s*$/) { }
536 7 1 if ($dataIndent =~ /^ *$/) { }
790 2 71 if ($anames{$name}) { }
807 2 70 if ($data =~ /[\&\<\>\"]/)
821 5 17 if ($_[0] =~ /[^\x00-\x7F]/)
829 4 114 if ($_[0] =~ /([\x00-\x08\x0B-\x0C\x0E-\x1F])/)
837 2 266 if ($_[0] eq "")
840 4 262 if ($_[0] =~ /\s/)
849 1 261 if (not $_[0] =~ /^[:A-Z_a-z\x{C0}-\x{D6}\x{D8}-\x{F6}\x{F8}-\x{2FF}\x{370}-\x{37D}\x{37F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}\x{EFFFF}][-.0-9\x{B7}\x{0300}-\x{036F}\x{203F}-\x{2040}:A-Z_a-z\x{C0}-\x{D6}\x{D8}-\x{F6}\x{F8}-\x{2FF}\x{370}-\x{37D}\x{37F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}\x{EFFFF}]*$/)
860 3 2 unless $self->{'OVERLOADSTRING'}->()
885 8 151 if ($params{'PREFIX_MAP'})
899 4 155 if $defaultPrefix
918 2 154 if ($params{'FORCED_NS_DECLS'})
951 24 10 unless (defined $prefix)
971 17 54 if (not $attFlag and $defaultPrefix and $uri eq $defaultPrefix) { }
20 34 elsif ($prefix) { }
972 12 5 unless ($nsDefaultDecl and $nsDefaultDecl eq $uri)
979 9 8 if (defined $uriMap->{''})
984 16 1 unless ($nsCopyFlag)
996 30 4 unless ($nsCopyFlag)
1014 54 140 if (ref $_[0][0] eq "ARRAY")
1021 14 60 if (ref $_[0][$i] eq "ARRAY")
1031 3 191 if (@forcedNSDecls)
1035 1 2 if ($defaultPrefix and $_ eq $defaultPrefix) { }
1057 94 7 unless ($unsafe)
1070 94 4 unless ($unsafe)
1085 22 52 if (ref $_[0] eq 'ARRAY') { }
1087 17 5 if ($pfx) { }
1104 146 10 unless ($unsafe)
1108 1 11 if (index($target, ":") != -1)
1121 7 11 if ($prefix) { }
1124 4 7 if (defined $defaultPrefix)
1137 1 2 if ($defaultPrefix and $defaultPrefix eq $uri)
1178 55 133 if (ref $name eq 'ARRAY') { }
1 132 elsif (index($name, ':') != -1) { }
1179 1 54 if (index($name->[1], ":") != -1)
1191 13 16 if (ref $name eq 'ARRAY') { }
1193 1 12 if (index($local, ":") != -1)
1197 1 15 if ($name =~ /^xmlns/) { }
1 14 elsif (index($name, ':') != -1) { }
1248 2 2 if ($self->{'HANDLE'}->print(shift())) { }