line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Interface for XML::DOM::Lite, version 0.15 |
2
|
|
|
|
|
|
|
package WWW::Scripter::Plugin::Ajax; |
3
|
2
|
|
|
2
|
|
1818
|
use XML::DOM::Lite; |
|
2
|
|
|
|
|
147093
|
|
|
2
|
|
|
|
|
130
|
|
4
|
2
|
|
|
2
|
|
25
|
use HTML::DOM::Interface ':all'; # for the constants |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1337
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
%WWW::Scripter::Plugin::Ajax::_xml_interf = ( |
7
|
|
|
|
|
|
|
'XML::DOM::Lite::Document' => 'Document', |
8
|
|
|
|
|
|
|
'XML::DOM::Lite::Node' => 'Node', |
9
|
|
|
|
|
|
|
'XML::DOM::Lite::NodeList' => 'NodeList', |
10
|
|
|
|
|
|
|
Document => { |
11
|
|
|
|
|
|
|
_isa => 'Node', |
12
|
|
|
|
|
|
|
_hash => 0, |
13
|
|
|
|
|
|
|
_array => 0, |
14
|
|
|
|
|
|
|
doctype => OBJ | READONLY, |
15
|
|
|
|
|
|
|
implementation => OBJ | READONLY, |
16
|
|
|
|
|
|
|
documentElement => OBJ | READONLY, |
17
|
|
|
|
|
|
|
createElement => METHOD | OBJ, |
18
|
|
|
|
|
|
|
createDocumentFragment => METHOD | OBJ, |
19
|
|
|
|
|
|
|
createTextNode => METHOD | OBJ, |
20
|
|
|
|
|
|
|
createComment => METHOD | OBJ, |
21
|
|
|
|
|
|
|
createCDATASection => METHOD | OBJ, |
22
|
|
|
|
|
|
|
createProcessingInstruction => METHOD | OBJ, |
23
|
|
|
|
|
|
|
createAttribute => METHOD | OBJ, |
24
|
|
|
|
|
|
|
createEntityReference => METHOD | OBJ, |
25
|
|
|
|
|
|
|
getElementsByTagName => METHOD | OBJ, |
26
|
|
|
|
|
|
|
}, |
27
|
|
|
|
|
|
|
Node => { |
28
|
|
|
|
|
|
|
_hash => 0, |
29
|
|
|
|
|
|
|
_array => 0, |
30
|
|
|
|
|
|
|
_constants => [qw[ |
31
|
|
|
|
|
|
|
XML::DOM::Lite::Node::ELEMENT_NODE |
32
|
|
|
|
|
|
|
XML::DOM::Lite::Node::ATTRIBUTE_NODE |
33
|
|
|
|
|
|
|
XML::DOM::Lite::Node::TEXT_NODE |
34
|
|
|
|
|
|
|
XML::DOM::Lite::Node::CDATA_SECTION_NODE |
35
|
|
|
|
|
|
|
XML::DOM::Lite::Node::ENTITY_REFERENCE_NODE |
36
|
|
|
|
|
|
|
XML::DOM::Lite::Node::ENTITY_NODE |
37
|
|
|
|
|
|
|
XML::DOM::Lite::Node::PROCESSING_INSTRUCTION_NODE |
38
|
|
|
|
|
|
|
XML::DOM::Lite::Node::COMMENT_NODE |
39
|
|
|
|
|
|
|
XML::DOM::Lite::Node::DOCUMENT_NODE |
40
|
|
|
|
|
|
|
XML::DOM::Lite::Node::DOCUMENT_TYPE_NODE |
41
|
|
|
|
|
|
|
XML::DOM::Lite::Node::DOCUMENT_FRAGMENT_NODE |
42
|
|
|
|
|
|
|
XML::DOM::Lite::Node::NOTATION_NODE |
43
|
|
|
|
|
|
|
]], |
44
|
|
|
|
|
|
|
nodeName => STR | READONLY, |
45
|
|
|
|
|
|
|
nodeValue => STR, |
46
|
|
|
|
|
|
|
nodeType => NUM | READONLY, |
47
|
|
|
|
|
|
|
parentNode => OBJ | READONLY, |
48
|
|
|
|
|
|
|
childNodes => OBJ | READONLY, |
49
|
|
|
|
|
|
|
firstChild => OBJ | READONLY, |
50
|
|
|
|
|
|
|
lastChild => OBJ | READONLY, |
51
|
|
|
|
|
|
|
previousSibling => OBJ | READONLY, |
52
|
|
|
|
|
|
|
nextSibling => OBJ | READONLY, |
53
|
|
|
|
|
|
|
attributes => OBJ | READONLY, |
54
|
|
|
|
|
|
|
ownerDocument => OBJ | READONLY, |
55
|
|
|
|
|
|
|
insertBefore => METHOD | OBJ, |
56
|
|
|
|
|
|
|
replaceChild => METHOD | OBJ, |
57
|
|
|
|
|
|
|
removeChild => METHOD | OBJ, |
58
|
|
|
|
|
|
|
appendChild => METHOD | OBJ, |
59
|
|
|
|
|
|
|
hasChildNodes => METHOD | BOOL, |
60
|
|
|
|
|
|
|
cloneNode => METHOD | OBJ, |
61
|
|
|
|
|
|
|
textContent => STR, # temporary band-aid; implemented by |
62
|
|
|
|
|
|
|
# this module, not by XDL |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
NodeList => { |
65
|
|
|
|
|
|
|
_hash => 1, |
66
|
|
|
|
|
|
|
_array => 1, |
67
|
|
|
|
|
|
|
item => METHOD | OBJ, |
68
|
|
|
|
|
|
|
length => NUM | READONLY, |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
2
|
100
|
|
2
|
0
|
13
|
can XML'DOM'Lite'Node:: textContent or eval ' |
|
2
|
100
|
|
2
|
|
6
|
|
|
2
|
|
|
|
|
492
|
|
|
2
|
|
|
|
|
3130
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
66
|
|
|
1
|
|
|
|
|
5
|
|
|
8
|
|
|
|
|
274
|
|
|
8
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
184
|
|
|
3
|
|
|
|
|
108
|
|
|
3
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
41
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
247
|
|
73
|
|
|
|
|
|
|
use XML::DOM::Lite "TEXT_NODE"; |
74
|
|
|
|
|
|
|
sub XML::DOM::Lite::Node::textContent { |
75
|
|
|
|
|
|
|
if(@_ == 1) { # serialise |
76
|
|
|
|
|
|
|
my @nodes = shift; |
77
|
|
|
|
|
|
|
my $out; |
78
|
|
|
|
|
|
|
while(@nodes) { |
79
|
|
|
|
|
|
|
my $node = shift @nodes; |
80
|
|
|
|
|
|
|
if($node->nodeType == TEXT_NODE) { |
81
|
|
|
|
|
|
|
$out .= $node->nodeValue; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
else { |
84
|
|
|
|
|
|
|
unshift @nodes, @{ $node->childNodes }; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
$out; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
else { # assignment |
90
|
|
|
|
|
|
|
my $node = shift; |
91
|
|
|
|
|
|
|
$node->removeChild($_) for @{[@{ $node->childNodes }]}; |
92
|
|
|
|
|
|
|
$node->appendChild($node->ownerDocument->createTextNode(shift)); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
'; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
for my $i(\%WWW::Scripter::Plugin::Ajax::_xml_interf){ |
98
|
|
|
|
|
|
|
for(grep /::/, keys %$i) { |
99
|
|
|
|
|
|
|
my $i = $$i{$$i{$_}}; |
100
|
|
|
|
|
|
|
for my $k(grep !/^_/,keys%$i){ |
101
|
|
|
|
|
|
|
delete $$i{$k} unless $_->can($k); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
__ |