line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::XMetaL::Mock::DOMNode;
|
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
651
|
use 5.008;
|
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
635
|
|
4
|
3
|
|
|
3
|
|
17
|
use strict;
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
99
|
|
5
|
3
|
|
|
3
|
|
16
|
use warnings;
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
94
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
use Carp;
|
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
285
|
|
8
|
3
|
|
|
3
|
|
16
|
use Hash::Util qw(lock_keys);
|
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
22
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
8373
|
use XML::XMetaL::Mock::DOMNodeList;
|
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
97
|
|
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
19
|
use constant TRUE => 1;
|
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
137
|
|
13
|
3
|
|
|
3
|
|
15
|
use constant FALSE => 0;
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
3674
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @keys = qw(
|
16
|
|
|
|
|
|
|
nodeID
|
17
|
|
|
|
|
|
|
attributes
|
18
|
|
|
|
|
|
|
childNodes
|
19
|
|
|
|
|
|
|
firstChild
|
20
|
|
|
|
|
|
|
lastChild
|
21
|
|
|
|
|
|
|
nextSibling
|
22
|
|
|
|
|
|
|
nodeName
|
23
|
|
|
|
|
|
|
nodeType
|
24
|
|
|
|
|
|
|
nodeValue
|
25
|
|
|
|
|
|
|
ownerDocument
|
26
|
|
|
|
|
|
|
parentNode
|
27
|
|
|
|
|
|
|
previousSibling
|
28
|
|
|
|
|
|
|
);
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our %node_types = (
|
31
|
|
|
|
|
|
|
DOMElement => 1,
|
32
|
|
|
|
|
|
|
DOMAttr => 2,
|
33
|
|
|
|
|
|
|
DOMText => 3,
|
34
|
|
|
|
|
|
|
DOMCDATASection => 4,
|
35
|
|
|
|
|
|
|
DOMEntityReference => 5,
|
36
|
|
|
|
|
|
|
DOMEntity => 6,
|
37
|
|
|
|
|
|
|
DOMProcessingInstruction => 7,
|
38
|
|
|
|
|
|
|
DOMComment => 8,
|
39
|
|
|
|
|
|
|
DOMDocument => 9,
|
40
|
|
|
|
|
|
|
DOMDocumentType => 10,
|
41
|
|
|
|
|
|
|
DOMDocumentFragment => 11,
|
42
|
|
|
|
|
|
|
DOMNotation => 12,
|
43
|
|
|
|
|
|
|
DOMCharacterReference => 505,
|
44
|
|
|
|
|
|
|
);
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub new {
|
47
|
6
|
|
|
6
|
0
|
18
|
my ($class, %args) = @_;
|
48
|
6
|
|
|
|
|
10
|
my $self;
|
49
|
6
|
|
|
|
|
11
|
eval {
|
50
|
6
|
|
|
|
|
10
|
my %properties;
|
51
|
6
|
|
|
|
|
70
|
@properties{@keys} = @args{@keys}; |
52
|
6
|
|
33
|
|
|
51
|
$self = bless \%properties, ref($class) || $class;
|
53
|
|
|
|
|
|
|
#lock_keys(%$self, @keys);
|
54
|
6
|
|
|
|
|
35
|
$self->{childNodes} = XML::XMetaL::Mock::DOMNodeList->new();
|
55
|
6
|
|
|
|
|
45
|
$self->_set_node_type();
|
56
|
|
|
|
|
|
|
};
|
57
|
6
|
50
|
|
|
|
16
|
croak $@ if $@;
|
58
|
6
|
|
|
|
|
25
|
return $self;
|
59
|
|
|
|
|
|
|
}
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _set_node_type {
|
62
|
6
|
|
|
6
|
|
10
|
my ($self) = @_;
|
63
|
6
|
|
|
|
|
13
|
my $class = ref $self;
|
64
|
6
|
|
|
|
|
60
|
my ($key) = $class =~ /([^:]+)$/;
|
65
|
6
|
50
|
0
|
|
|
27
|
croak "Node name ".($key || "FALSE")." does not exist"
|
66
|
|
|
|
|
|
|
unless exists $node_types{$key};
|
67
|
6
|
|
|
|
|
14
|
my $node_type = $node_types{$key};
|
68
|
6
|
|
|
|
|
17
|
$self->{nodeType} = $node_type;
|
69
|
|
|
|
|
|
|
}
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub appendChild {
|
72
|
3
|
|
|
3
|
0
|
19
|
eval {
|
73
|
3
|
|
|
|
|
5
|
my $self = shift @_;
|
74
|
3
|
|
33
|
|
|
9
|
my XML::XMetaL::Mock::DOMNode $child_node = shift(@_) || croak("Missing argument");
|
75
|
3
|
|
|
|
|
22
|
my XML::XMetaL::Mock::DOMNodeList $child_node_list = $self->{childNodes};
|
76
|
3
|
|
|
|
|
28
|
$child_node->{parentNode} = $self;
|
77
|
3
|
|
|
|
|
17
|
$child_node_list->add($child_node);
|
78
|
|
|
|
|
|
|
};
|
79
|
3
|
50
|
|
|
|
11
|
croak $@ if $@;
|
80
|
|
|
|
|
|
|
}
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#cloneNode
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub hasChildNodes {
|
85
|
0
|
|
|
0
|
0
|
|
my $self = shift @_;
|
86
|
0
|
|
|
|
|
|
my XML::XMetaL::Mock::DOMNodeList $child_node_list = $self->{childNodes};
|
87
|
0
|
|
|
|
|
|
return $child_node_list->hasChildNodes();
|
88
|
|
|
|
|
|
|
}
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
#insertBefore
|
91
|
|
|
|
|
|
|
#removeChild
|
92
|
|
|
|
|
|
|
#replaceChild
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1;
|
96
|
|
|
|
|
|
|
__END__
|