line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Elemental::Document; |
2
|
3
|
|
|
3
|
|
2007
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
139
|
|
3
|
3
|
|
|
3
|
|
16
|
use base qw( XML::Elemental::Node ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1317
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
18
|
use Scalar::Util qw(weaken); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
762
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
1
|
10
|
sub root_element { $_[0]->{contents} } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub contents { |
10
|
5
|
100
|
|
5
|
1
|
8615
|
if (@_ > 1) { |
11
|
1
|
50
|
|
|
|
7
|
$_[0]->{contents} = ref $_[1] eq 'ARRAY' ? $_[1]->[0] : $_[1]; |
12
|
1
|
|
|
|
|
5
|
weaken($_[0]->{contents}->{parent} = $_[0]); |
13
|
|
|
|
|
|
|
} |
14
|
5
|
50
|
|
|
|
38
|
return $_[0]->{contents} ? [$_[0]->{contents}] : []; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
0
|
0
|
0
|
sub attributes { } # deprecated. documents never have attributes. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub DESTROY { |
20
|
4
|
100
|
|
4
|
|
3779
|
$_[0]->{contents}->DESTROY if $_[0]->{contents}; |
21
|
|
|
|
|
|
|
} # starts circular reference teardown |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |