line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Elemental::Element; |
2
|
3
|
|
|
3
|
|
1948
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
99
|
|
3
|
3
|
|
|
3
|
|
14
|
use base qw( XML::Elemental::Node ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1977
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
17
|
|
|
17
|
1
|
57
|
my $self = bless {}, $_[0]; |
7
|
17
|
|
|
|
|
73
|
$self->{attribute} = {}; |
8
|
17
|
|
|
|
|
45
|
$self->{contents} = []; |
9
|
17
|
|
|
|
|
45
|
return $self; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub text_content { |
13
|
3
|
50
|
|
3
|
1
|
407
|
return '' unless defined $_[0]->{contents}; |
14
|
5
|
100
|
|
|
|
50
|
return join('', |
15
|
3
|
|
|
|
|
8
|
map { $_->can('text_content') ? $_->text_content : $_->data } |
16
|
3
|
|
|
|
|
23
|
@{$_[0]->contents}); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub name { |
20
|
11
|
50
|
|
11
|
1
|
2378
|
$_[0]->{name} = $_[1] if @_ > 1; |
21
|
11
|
|
|
|
|
45
|
return $_[0]->{name}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub parent { |
25
|
3
|
50
|
|
3
|
1
|
1146
|
$_[0]->{parent} = $_[1] if @_ > 1; |
26
|
3
|
|
|
|
|
17
|
return $_[0]->{parent}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub contents { |
30
|
8
|
|
50
|
8
|
1
|
1403
|
$_[0]->{contents} ||= []; |
31
|
8
|
50
|
|
|
|
24
|
$_[0]->{contents} = $_[1] if @_ > 1; |
32
|
8
|
|
|
|
|
27
|
return $_[0]->{contents}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub attributes { |
36
|
2
|
|
50
|
2
|
1
|
778
|
$_[0]->{attributes} ||= {}; |
37
|
2
|
50
|
|
|
|
8
|
$_[0]->{attributes} = $_[1] if @_ > 1; |
38
|
2
|
|
|
|
|
12
|
return $_[0]->{attributes}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |