| 1 | # XML::Filter::Hekeln | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # (c) 1999 GNU General Public License | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # Michael Koehne Kraehe@Copyleft.de | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ---------------------------------------------------------------------------- # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | package XML::Filter::Hekeln; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use UNIVERSAL; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use vars qw($VERSION $METHODS); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | $VERSION = '0.06'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | $METHODS = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | start_document => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | end_document => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | doctype_decl => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | processing_instruction => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | start_element => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | end_element => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | start_cdata => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | end_cdata => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | characters => 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # ---------------------------------------------------------------------------- # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | my $proto = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my $self = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | bless($self, $class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | my $args = ($#_ == 0) ? { %{ (shift) } } : { @_ }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | foreach (keys %$args) { $self->{$_}=$args->{$_}; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | $self->{'Action'} = $self->script($self->{'Script'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | if $self->{'Script'} && !$self->{'Action'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"Script"} and not $self->{"Action"}
MC/DC0%0/2
$self->{"Script"} and not $self->{"Action"}
$self->{"Script"}
not $self->{"Action"}
Truth table0%0/3
A and not(B)
A= $self->{"Script"}B= not $self->{"Action"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | $self->{'Action'} = {} unless ref($self->{'Action'}) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | $self->{'Methods'} = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | $self->{'Stack'} = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | if ($self->{'Handler'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | foreach (keys %$METHODS) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | $self->{'Methods'}{$_} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | $self->{'Handler'}->can($_) ? 2 : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | sub script { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
script: not called CC=17 SCAR=57.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | my ($self,$script) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | my $hash = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | my ($key,$val,$str); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | my (@v, $o, $p); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | my $action; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | local $SIG{__WARN__} = sub { die $_[0] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | foreach (split /\n\n/, $script) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | if ($_ !~ /^#/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ($key,$val) = split /\n/, $_, 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if ($key =~ /^[^:]+:[^:]+$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | $str = 'sub {'."\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | $str .= 'my ($self,$param) = @_;'."\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | $str .= 'my ($hash) = {};'."\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | $val =~ s/\~(\w+)\~/\$param->{$1}/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | SCRIPT_TO_SUB_SW: foreach (split /\n/, $val) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | @v = split /\t/, $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | $o = shift @v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | $p = shift @v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | if ($o eq '<') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | $str .= '$hash->{Name}="'.$p.'"; '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | $str .= '$self->handle("start_element", $hash);'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | if ($o eq '</') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | $str .= '$hash->{Name}="'.$p.'"; '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $str .= '$self->handle("end_element", $hash);'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | if ($o eq '') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | $str .= '$hash->{Data}="'.$p.'"; '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | $str .= '$self->handle("characters", $hash);'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if ($o eq '!') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | $str .= $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | if ($o eq '+') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | $str .= '$self->{Flag}{'.$p.'}=1;'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | if ($o eq '++') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $str .= '$self->{Flag}{'.$p.'}=1;'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | $str .= 'unshift @{$self->{Stack}}, "'.$p.'";'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | if ($o eq '-') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | $str .= '$self->{Flag}{'.$p.'}=0;'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | if ($o eq '--') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | $str .= '$self->{Flag}{'.$p.'}=0;'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | $str .= 'shift @{$self->{Stack}} if $self->{Stack}[0] eq "'.$p.'";'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | if ($o eq '?{') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | $str .= 'if ($self->{Flag}{'.$p.'}) {'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | if ($o eq '?}') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | $str .= '}'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | $str .= "\n\t"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | next SCRIPT_TO_SUB_SW; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | $str.= '}'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | print STDERR '$hash->{'.$key.'}=eval "'.$str.'";'."\n\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | if $self->{'Debug'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | $action = eval $str; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | print STDERR "Error: $key: "; die $@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $hash->{$key}=$action; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | return $hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | sub start_document { my ($self, $param) = @_; $self->style('start_document',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_document: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | sub end_document { my ($self, $param) = @_; $self->style('end_document',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
end_document: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | sub doctype_decl { my ($self, $param) = @_; $self->style('doctype_decl',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
doctype_decl: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | sub processing_instruction { my ($self, $param) = @_; $self->style('processing_instruction',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
processing_instruction: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | sub start_element { my ($self, $param) = @_; $self->style('start_element',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_element: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | sub end_element { my ($self, $param) = @_; $self->style('end_element',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
end_element: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | sub start_cdata { my ($self, $param) = @_; $self->style('start_cdata',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start_cdata: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | sub end_cdata { my ($self, $param) = @_; $self->style('end_cdata',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
end_cdata: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | sub characters { my ($self, $param) = @_; $self->style('characters',$param); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
characters: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | sub style { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
style: not called CC=12 SCAR=50.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | my ($self,$event,$param) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | return unless $param; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | return unless $event; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | return unless $METHODS->{$event}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | my $target = "*"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | $target = $param->{'Name'} if $param->{'Name'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | $target = $param->{'Target'} if $param->{'Target'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | $target = $self->{Stack}[0] if ( $event eq 'characters' or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | $event eq 'start_cdata' or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | $event eq 'end_cdata' ) and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | $self->{Flag}{$self->{Stack}[0]}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$event eq "characters" || $event eq "start_cdata" || $event eq "end_cdata" and $self->{"Flag"}{$self->{"Stack"}[0]}
$event eq "characters" or $event eq "start_cdata" or $event eq "end_cdata"
$event eq "characters" or $event eq "start_cdata"
MC/DC0%0/4
$event eq "characters" || $event eq "start_cdata" || $event eq "end_cdata" and $self->{"Flag"}{$self->{"Stack"}[0]}
$event eq "characters"
$event eq "start_cdata"
$event eq "end_cdata"
$self->{"Flag"}{$self->{"Stack"}[0]}
Truth table0%0/7
A or B or C and D
A= $event eq "characters"B= $event eq "start_cdata"C= $event eq "end_cdata"D= $self->{"Flag"}{$self->{"Stack"}[0]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | my $action = $self->{'Action'}{$event.':'.$target}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | return undef unless $action; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my $hash = $param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | $hash = $param->{'Attributes'} if $event eq 'start_element'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | return &$action($self,$hash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | sub handle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my ($self,$event,$param) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | return $self->{'Handler'}->$event($param) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | if ($self->{'Methods'}{$event}>1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | # ---------------------------------------------------------------------------- # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||