line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#line 1 |
2
|
|
|
|
|
|
|
package XML::SAX::Base; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# version 0.10 - Kip Hampton |
5
|
|
|
|
|
|
|
# version 0.13 - Robin Berjon |
6
|
|
|
|
|
|
|
# version 0.15 - Kip Hampton |
7
|
|
|
|
|
|
|
# version 0.17 - Kip Hampton |
8
|
|
|
|
|
|
|
# version 0.19 - Kip Hampton |
9
|
|
|
|
|
|
|
# version 0.21 - Kip Hampton |
10
|
|
|
|
|
|
|
# version 0.22 - Robin Berjon |
11
|
|
|
|
|
|
|
# version 0.23 - Matt Sergeant |
12
|
|
|
|
|
|
|
# version 0.24 - Robin Berjon |
13
|
|
|
|
|
|
|
# version 0.25 - Kip Hampton |
14
|
|
|
|
|
|
|
# version 1.00 - Kip Hampton |
15
|
|
|
|
|
|
|
# version 1.01 - Kip Hampton |
16
|
|
|
|
|
|
|
# version 1.02 - Robin Berjon |
17
|
|
|
|
|
|
|
# version 1.03 - Matt Sergeant |
18
|
|
|
|
|
|
|
# version 1.04 - Kip Hampton |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#-----------------------------------------------------# |
21
|
|
|
|
|
|
|
# STOP!!!!! |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
# This file is generated by the 'Makefile.PL' file |
24
|
|
|
|
|
|
|
# that ships with the XML::SAX distribution. |
25
|
|
|
|
|
|
|
# If you need to make changes, patch that file NOT |
26
|
|
|
|
|
|
|
# this one. |
27
|
|
|
|
|
|
|
#-----------------------------------------------------# |
28
|
3
|
|
|
3
|
|
16
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
105
|
|
29
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
139
|
|
30
|
3
|
|
|
3
|
|
1915
|
use vars qw($VERSION); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
75520
|
|
31
|
|
|
|
|
|
|
use XML::SAX::Exception qw(); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$VERSION = '1.04'; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
0
|
sub end_prefix_mapping { |
36
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
37
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'end_prefix_mapping'}) { |
38
|
|
|
|
|
|
|
$self->{Methods}->{'end_prefix_mapping'}->(@_); |
39
|
|
|
|
|
|
|
} |
40
|
0
|
|
|
|
|
0
|
else { |
41
|
|
|
|
|
|
|
my $method; |
42
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
43
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
44
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
45
|
|
|
|
|
|
|
} |
46
|
0
|
|
|
|
|
0
|
else { |
47
|
|
|
|
|
|
|
$callbacks = $self; |
48
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
49
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
50
|
0
|
0
|
|
|
|
0
|
} |
51
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('end_prefix_mapping') ) { |
52
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
53
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_prefix_mapping'} = sub { $method->($handler, @_) }; |
54
|
|
|
|
|
|
|
return $method->($handler, @_); |
55
|
|
|
|
|
|
|
} |
56
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_prefix_mapping') ) { |
57
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
58
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_prefix_mapping'} = sub { $method->($handler, @_) }; |
59
|
|
|
|
|
|
|
return $method->($handler, @_); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
62
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
63
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
64
|
|
|
|
|
|
|
) |
65
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
66
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->end_prefix_mapping(@_) }; |
67
|
0
|
|
|
|
|
0
|
if ($@) { |
68
|
|
|
|
|
|
|
die $@; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
else { |
71
|
|
|
|
|
|
|
# I think there's a buggette here... |
72
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
73
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
74
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
75
|
|
|
|
|
|
|
$self->{Methods}->{'end_prefix_mapping'} = sub { $handler->end_prefix_mapping(@_) }; |
76
|
0
|
|
|
|
|
0
|
} |
77
|
|
|
|
|
|
|
return $res; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
80
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
81
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
82
|
|
|
|
|
|
|
) |
83
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
84
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->end_prefix_mapping(@_) }; |
85
|
0
|
|
|
|
|
0
|
if ($@) { |
86
|
|
|
|
|
|
|
die $@; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
else { |
89
|
|
|
|
|
|
|
# I think there's a buggette here... |
90
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
91
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
92
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
93
|
|
|
|
|
|
|
$self->{Methods}->{'end_prefix_mapping'} = sub { $handler->end_prefix_mapping(@_) }; |
94
|
0
|
|
|
|
|
0
|
} |
95
|
|
|
|
|
|
|
return $res; |
96
|
|
|
|
|
|
|
} |
97
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
98
|
|
|
|
|
|
|
$self->{Methods}->{'end_prefix_mapping'} = sub { }; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
0
|
1
|
0
|
sub internal_entity_decl { |
105
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
106
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'internal_entity_decl'}) { |
107
|
|
|
|
|
|
|
$self->{Methods}->{'internal_entity_decl'}->(@_); |
108
|
|
|
|
|
|
|
} |
109
|
0
|
|
|
|
|
0
|
else { |
110
|
|
|
|
|
|
|
my $method; |
111
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
112
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
113
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
114
|
|
|
|
|
|
|
} |
115
|
0
|
|
|
|
|
0
|
else { |
116
|
|
|
|
|
|
|
$callbacks = $self; |
117
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
118
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
119
|
0
|
0
|
|
|
|
0
|
} |
120
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DeclHandler'} and $method = $callbacks->{'DeclHandler'}->can('internal_entity_decl') ) { |
121
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
122
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'internal_entity_decl'} = sub { $method->($handler, @_) }; |
123
|
|
|
|
|
|
|
return $method->($handler, @_); |
124
|
|
|
|
|
|
|
} |
125
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('internal_entity_decl') ) { |
126
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
127
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'internal_entity_decl'} = sub { $method->($handler, @_) }; |
128
|
|
|
|
|
|
|
return $method->($handler, @_); |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DeclHandler'} |
131
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') |
132
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
133
|
|
|
|
|
|
|
) |
134
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
135
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DeclHandler'}->internal_entity_decl(@_) }; |
136
|
0
|
|
|
|
|
0
|
if ($@) { |
137
|
|
|
|
|
|
|
die $@; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
else { |
140
|
|
|
|
|
|
|
# I think there's a buggette here... |
141
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
142
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
143
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
144
|
|
|
|
|
|
|
$self->{Methods}->{'internal_entity_decl'} = sub { $handler->internal_entity_decl(@_) }; |
145
|
0
|
|
|
|
|
0
|
} |
146
|
|
|
|
|
|
|
return $res; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
149
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
150
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
151
|
|
|
|
|
|
|
) |
152
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
153
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->internal_entity_decl(@_) }; |
154
|
0
|
|
|
|
|
0
|
if ($@) { |
155
|
|
|
|
|
|
|
die $@; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
else { |
158
|
|
|
|
|
|
|
# I think there's a buggette here... |
159
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
160
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
161
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
162
|
|
|
|
|
|
|
$self->{Methods}->{'internal_entity_decl'} = sub { $handler->internal_entity_decl(@_) }; |
163
|
0
|
|
|
|
|
0
|
} |
164
|
|
|
|
|
|
|
return $res; |
165
|
|
|
|
|
|
|
} |
166
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
167
|
|
|
|
|
|
|
$self->{Methods}->{'internal_entity_decl'} = sub { }; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
13
|
|
|
13
|
1
|
579
|
sub characters { |
174
|
13
|
100
|
|
|
|
38
|
my $self = shift; |
175
|
12
|
|
|
|
|
30
|
if (defined $self->{Methods}->{'characters'}) { |
176
|
|
|
|
|
|
|
$self->{Methods}->{'characters'}->(@_); |
177
|
|
|
|
|
|
|
} |
178
|
1
|
|
|
|
|
3
|
else { |
179
|
|
|
|
|
|
|
my $method; |
180
|
1
|
50
|
|
|
|
6
|
my $callbacks; |
181
|
1
|
|
|
|
|
2
|
if (exists $self->{ParseOptions}) { |
182
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
183
|
|
|
|
|
|
|
} |
184
|
0
|
|
|
|
|
0
|
else { |
185
|
|
|
|
|
|
|
$callbacks = $self; |
186
|
1
|
50
|
33
|
|
|
21
|
} |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
187
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
188
|
0
|
50
|
|
|
|
0
|
} |
189
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('characters') ) { |
190
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
191
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'characters'} = sub { $method->($handler, @_) }; |
192
|
|
|
|
|
|
|
return $method->($handler, @_); |
193
|
|
|
|
|
|
|
} |
194
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('characters') ) { |
195
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
196
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'characters'} = sub { $method->($handler, @_) }; |
197
|
|
|
|
|
|
|
return $method->($handler, @_); |
198
|
|
|
|
|
|
|
} |
199
|
1
|
|
|
|
|
3
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('characters') ) { |
200
|
1
|
|
|
12
|
|
5
|
my $handler = $callbacks->{'Handler'}; |
|
12
|
|
|
|
|
41
|
|
201
|
1
|
|
|
|
|
6
|
$self->{Methods}->{'characters'} = sub { $method->($handler, @_) }; |
202
|
|
|
|
|
|
|
return $method->($handler, @_); |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
205
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
206
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
207
|
|
|
|
|
|
|
) |
208
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
209
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->characters(@_) }; |
210
|
0
|
|
|
|
|
0
|
if ($@) { |
211
|
|
|
|
|
|
|
die $@; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
else { |
214
|
|
|
|
|
|
|
# I think there's a buggette here... |
215
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
216
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
217
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
218
|
|
|
|
|
|
|
$self->{Methods}->{'characters'} = sub { $handler->characters(@_) }; |
219
|
0
|
|
|
|
|
0
|
} |
220
|
|
|
|
|
|
|
return $res; |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
223
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
224
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
225
|
|
|
|
|
|
|
) |
226
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
227
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->characters(@_) }; |
228
|
0
|
|
|
|
|
0
|
if ($@) { |
229
|
|
|
|
|
|
|
die $@; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
else { |
232
|
|
|
|
|
|
|
# I think there's a buggette here... |
233
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
234
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
235
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
236
|
|
|
|
|
|
|
$self->{Methods}->{'characters'} = sub { $handler->characters(@_) }; |
237
|
0
|
|
|
|
|
0
|
} |
238
|
|
|
|
|
|
|
return $res; |
239
|
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
241
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
242
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
243
|
|
|
|
|
|
|
) |
244
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
245
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->characters(@_) }; |
246
|
0
|
|
|
|
|
0
|
if ($@) { |
247
|
|
|
|
|
|
|
die $@; |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
else { |
250
|
|
|
|
|
|
|
# I think there's a buggette here... |
251
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
252
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
253
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
254
|
|
|
|
|
|
|
$self->{Methods}->{'characters'} = sub { $handler->characters(@_) }; |
255
|
0
|
|
|
|
|
0
|
} |
256
|
|
|
|
|
|
|
return $res; |
257
|
|
|
|
|
|
|
} |
258
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
259
|
|
|
|
|
|
|
$self->{Methods}->{'characters'} = sub { }; |
260
|
|
|
|
|
|
|
} |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
7
|
|
|
7
|
1
|
465
|
sub start_element { |
266
|
7
|
100
|
|
|
|
27
|
my $self = shift; |
267
|
6
|
|
|
|
|
18
|
if (defined $self->{Methods}->{'start_element'}) { |
268
|
|
|
|
|
|
|
$self->{Methods}->{'start_element'}->(@_); |
269
|
|
|
|
|
|
|
} |
270
|
1
|
|
|
|
|
2
|
else { |
271
|
|
|
|
|
|
|
my $method; |
272
|
1
|
50
|
|
|
|
4
|
my $callbacks; |
273
|
1
|
|
|
|
|
3
|
if (exists $self->{ParseOptions}) { |
274
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
275
|
|
|
|
|
|
|
} |
276
|
0
|
|
|
|
|
0
|
else { |
277
|
|
|
|
|
|
|
$callbacks = $self; |
278
|
1
|
50
|
33
|
|
|
22
|
} |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
279
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
280
|
0
|
50
|
|
|
|
0
|
} |
281
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('start_element') ) { |
282
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
283
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_element'} = sub { $method->($handler, @_) }; |
284
|
|
|
|
|
|
|
return $method->($handler, @_); |
285
|
|
|
|
|
|
|
} |
286
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('start_element') ) { |
287
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
288
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_element'} = sub { $method->($handler, @_) }; |
289
|
|
|
|
|
|
|
return $method->($handler, @_); |
290
|
|
|
|
|
|
|
} |
291
|
1
|
|
|
|
|
2
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_element') ) { |
292
|
1
|
|
|
6
|
|
7
|
my $handler = $callbacks->{'Handler'}; |
|
6
|
|
|
|
|
22
|
|
293
|
1
|
|
|
|
|
5
|
$self->{Methods}->{'start_element'} = sub { $method->($handler, @_) }; |
294
|
|
|
|
|
|
|
return $method->($handler, @_); |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
297
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
298
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
299
|
|
|
|
|
|
|
) |
300
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
301
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->start_element(@_) }; |
302
|
0
|
|
|
|
|
0
|
if ($@) { |
303
|
|
|
|
|
|
|
die $@; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
else { |
306
|
|
|
|
|
|
|
# I think there's a buggette here... |
307
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
308
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
309
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
310
|
|
|
|
|
|
|
$self->{Methods}->{'start_element'} = sub { $handler->start_element(@_) }; |
311
|
0
|
|
|
|
|
0
|
} |
312
|
|
|
|
|
|
|
return $res; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
315
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
316
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
317
|
|
|
|
|
|
|
) |
318
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
319
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->start_element(@_) }; |
320
|
0
|
|
|
|
|
0
|
if ($@) { |
321
|
|
|
|
|
|
|
die $@; |
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
else { |
324
|
|
|
|
|
|
|
# I think there's a buggette here... |
325
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
326
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
327
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
328
|
|
|
|
|
|
|
$self->{Methods}->{'start_element'} = sub { $handler->start_element(@_) }; |
329
|
0
|
|
|
|
|
0
|
} |
330
|
|
|
|
|
|
|
return $res; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
333
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
334
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
335
|
|
|
|
|
|
|
) |
336
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
337
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->start_element(@_) }; |
338
|
0
|
|
|
|
|
0
|
if ($@) { |
339
|
|
|
|
|
|
|
die $@; |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
else { |
342
|
|
|
|
|
|
|
# I think there's a buggette here... |
343
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
344
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
345
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
346
|
|
|
|
|
|
|
$self->{Methods}->{'start_element'} = sub { $handler->start_element(@_) }; |
347
|
0
|
|
|
|
|
0
|
} |
348
|
|
|
|
|
|
|
return $res; |
349
|
|
|
|
|
|
|
} |
350
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
351
|
|
|
|
|
|
|
$self->{Methods}->{'start_element'} = sub { }; |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
} |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
} |
356
|
|
|
|
|
|
|
|
357
|
0
|
|
|
0
|
1
|
0
|
sub external_entity_decl { |
358
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
359
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'external_entity_decl'}) { |
360
|
|
|
|
|
|
|
$self->{Methods}->{'external_entity_decl'}->(@_); |
361
|
|
|
|
|
|
|
} |
362
|
0
|
|
|
|
|
0
|
else { |
363
|
|
|
|
|
|
|
my $method; |
364
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
365
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
366
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
367
|
|
|
|
|
|
|
} |
368
|
0
|
|
|
|
|
0
|
else { |
369
|
|
|
|
|
|
|
$callbacks = $self; |
370
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
371
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
372
|
0
|
0
|
|
|
|
0
|
} |
373
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DeclHandler'} and $method = $callbacks->{'DeclHandler'}->can('external_entity_decl') ) { |
374
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
375
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'external_entity_decl'} = sub { $method->($handler, @_) }; |
376
|
|
|
|
|
|
|
return $method->($handler, @_); |
377
|
|
|
|
|
|
|
} |
378
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('external_entity_decl') ) { |
379
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
380
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'external_entity_decl'} = sub { $method->($handler, @_) }; |
381
|
|
|
|
|
|
|
return $method->($handler, @_); |
382
|
|
|
|
|
|
|
} |
383
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DeclHandler'} |
384
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') |
385
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
386
|
|
|
|
|
|
|
) |
387
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
388
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DeclHandler'}->external_entity_decl(@_) }; |
389
|
0
|
|
|
|
|
0
|
if ($@) { |
390
|
|
|
|
|
|
|
die $@; |
391
|
|
|
|
|
|
|
} |
392
|
|
|
|
|
|
|
else { |
393
|
|
|
|
|
|
|
# I think there's a buggette here... |
394
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
395
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
396
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
397
|
|
|
|
|
|
|
$self->{Methods}->{'external_entity_decl'} = sub { $handler->external_entity_decl(@_) }; |
398
|
0
|
|
|
|
|
0
|
} |
399
|
|
|
|
|
|
|
return $res; |
400
|
|
|
|
|
|
|
} |
401
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
402
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
403
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
404
|
|
|
|
|
|
|
) |
405
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
406
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->external_entity_decl(@_) }; |
407
|
0
|
|
|
|
|
0
|
if ($@) { |
408
|
|
|
|
|
|
|
die $@; |
409
|
|
|
|
|
|
|
} |
410
|
|
|
|
|
|
|
else { |
411
|
|
|
|
|
|
|
# I think there's a buggette here... |
412
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
413
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
414
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
415
|
|
|
|
|
|
|
$self->{Methods}->{'external_entity_decl'} = sub { $handler->external_entity_decl(@_) }; |
416
|
0
|
|
|
|
|
0
|
} |
417
|
|
|
|
|
|
|
return $res; |
418
|
|
|
|
|
|
|
} |
419
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
420
|
|
|
|
|
|
|
$self->{Methods}->{'external_entity_decl'} = sub { }; |
421
|
|
|
|
|
|
|
} |
422
|
|
|
|
|
|
|
} |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
} |
425
|
|
|
|
|
|
|
|
426
|
0
|
|
|
0
|
1
|
0
|
sub xml_decl { |
427
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
428
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'xml_decl'}) { |
429
|
|
|
|
|
|
|
$self->{Methods}->{'xml_decl'}->(@_); |
430
|
|
|
|
|
|
|
} |
431
|
0
|
|
|
|
|
0
|
else { |
432
|
|
|
|
|
|
|
my $method; |
433
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
434
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
435
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
436
|
|
|
|
|
|
|
} |
437
|
0
|
|
|
|
|
0
|
else { |
438
|
|
|
|
|
|
|
$callbacks = $self; |
439
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
440
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
441
|
0
|
0
|
|
|
|
0
|
} |
442
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DTDHandler'} and $method = $callbacks->{'DTDHandler'}->can('xml_decl') ) { |
443
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
444
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'xml_decl'} = sub { $method->($handler, @_) }; |
445
|
|
|
|
|
|
|
return $method->($handler, @_); |
446
|
|
|
|
|
|
|
} |
447
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('xml_decl') ) { |
448
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
449
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'xml_decl'} = sub { $method->($handler, @_) }; |
450
|
|
|
|
|
|
|
return $method->($handler, @_); |
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DTDHandler'} |
453
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') |
454
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
455
|
|
|
|
|
|
|
) |
456
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
457
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DTDHandler'}->xml_decl(@_) }; |
458
|
0
|
|
|
|
|
0
|
if ($@) { |
459
|
|
|
|
|
|
|
die $@; |
460
|
|
|
|
|
|
|
} |
461
|
|
|
|
|
|
|
else { |
462
|
|
|
|
|
|
|
# I think there's a buggette here... |
463
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
464
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
465
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
466
|
|
|
|
|
|
|
$self->{Methods}->{'xml_decl'} = sub { $handler->xml_decl(@_) }; |
467
|
0
|
|
|
|
|
0
|
} |
468
|
|
|
|
|
|
|
return $res; |
469
|
|
|
|
|
|
|
} |
470
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
471
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
472
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
473
|
|
|
|
|
|
|
) |
474
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
475
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->xml_decl(@_) }; |
476
|
0
|
|
|
|
|
0
|
if ($@) { |
477
|
|
|
|
|
|
|
die $@; |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
else { |
480
|
|
|
|
|
|
|
# I think there's a buggette here... |
481
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
482
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
483
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
484
|
|
|
|
|
|
|
$self->{Methods}->{'xml_decl'} = sub { $handler->xml_decl(@_) }; |
485
|
0
|
|
|
|
|
0
|
} |
486
|
|
|
|
|
|
|
return $res; |
487
|
|
|
|
|
|
|
} |
488
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
489
|
|
|
|
|
|
|
$self->{Methods}->{'xml_decl'} = sub { }; |
490
|
|
|
|
|
|
|
} |
491
|
|
|
|
|
|
|
} |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
} |
494
|
|
|
|
|
|
|
|
495
|
0
|
|
|
0
|
1
|
0
|
sub entity_decl { |
496
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
497
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'entity_decl'}) { |
498
|
|
|
|
|
|
|
$self->{Methods}->{'entity_decl'}->(@_); |
499
|
|
|
|
|
|
|
} |
500
|
0
|
|
|
|
|
0
|
else { |
501
|
|
|
|
|
|
|
my $method; |
502
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
503
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
504
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
505
|
|
|
|
|
|
|
} |
506
|
0
|
|
|
|
|
0
|
else { |
507
|
|
|
|
|
|
|
$callbacks = $self; |
508
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
509
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
510
|
0
|
0
|
|
|
|
0
|
} |
511
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DTDHandler'} and $method = $callbacks->{'DTDHandler'}->can('entity_decl') ) { |
512
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
513
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'entity_decl'} = sub { $method->($handler, @_) }; |
514
|
|
|
|
|
|
|
return $method->($handler, @_); |
515
|
|
|
|
|
|
|
} |
516
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('entity_decl') ) { |
517
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
518
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'entity_decl'} = sub { $method->($handler, @_) }; |
519
|
|
|
|
|
|
|
return $method->($handler, @_); |
520
|
|
|
|
|
|
|
} |
521
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DTDHandler'} |
522
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') |
523
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
524
|
|
|
|
|
|
|
) |
525
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
526
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DTDHandler'}->entity_decl(@_) }; |
527
|
0
|
|
|
|
|
0
|
if ($@) { |
528
|
|
|
|
|
|
|
die $@; |
529
|
|
|
|
|
|
|
} |
530
|
|
|
|
|
|
|
else { |
531
|
|
|
|
|
|
|
# I think there's a buggette here... |
532
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
533
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
534
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
535
|
|
|
|
|
|
|
$self->{Methods}->{'entity_decl'} = sub { $handler->entity_decl(@_) }; |
536
|
0
|
|
|
|
|
0
|
} |
537
|
|
|
|
|
|
|
return $res; |
538
|
|
|
|
|
|
|
} |
539
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
540
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
541
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
542
|
|
|
|
|
|
|
) |
543
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
544
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->entity_decl(@_) }; |
545
|
0
|
|
|
|
|
0
|
if ($@) { |
546
|
|
|
|
|
|
|
die $@; |
547
|
|
|
|
|
|
|
} |
548
|
|
|
|
|
|
|
else { |
549
|
|
|
|
|
|
|
# I think there's a buggette here... |
550
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
551
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
552
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
553
|
|
|
|
|
|
|
$self->{Methods}->{'entity_decl'} = sub { $handler->entity_decl(@_) }; |
554
|
0
|
|
|
|
|
0
|
} |
555
|
|
|
|
|
|
|
return $res; |
556
|
|
|
|
|
|
|
} |
557
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
558
|
|
|
|
|
|
|
$self->{Methods}->{'entity_decl'} = sub { }; |
559
|
|
|
|
|
|
|
} |
560
|
|
|
|
|
|
|
} |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
} |
563
|
|
|
|
|
|
|
|
564
|
0
|
|
|
0
|
1
|
0
|
sub end_dtd { |
565
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
566
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'end_dtd'}) { |
567
|
|
|
|
|
|
|
$self->{Methods}->{'end_dtd'}->(@_); |
568
|
|
|
|
|
|
|
} |
569
|
0
|
|
|
|
|
0
|
else { |
570
|
|
|
|
|
|
|
my $method; |
571
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
572
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
573
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
574
|
|
|
|
|
|
|
} |
575
|
0
|
|
|
|
|
0
|
else { |
576
|
|
|
|
|
|
|
$callbacks = $self; |
577
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
578
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
579
|
0
|
0
|
|
|
|
0
|
} |
580
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('end_dtd') ) { |
581
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
582
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_dtd'} = sub { $method->($handler, @_) }; |
583
|
|
|
|
|
|
|
return $method->($handler, @_); |
584
|
|
|
|
|
|
|
} |
585
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_dtd') ) { |
586
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
587
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_dtd'} = sub { $method->($handler, @_) }; |
588
|
|
|
|
|
|
|
return $method->($handler, @_); |
589
|
|
|
|
|
|
|
} |
590
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
591
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
592
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
593
|
|
|
|
|
|
|
) |
594
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
595
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->end_dtd(@_) }; |
596
|
0
|
|
|
|
|
0
|
if ($@) { |
597
|
|
|
|
|
|
|
die $@; |
598
|
|
|
|
|
|
|
} |
599
|
|
|
|
|
|
|
else { |
600
|
|
|
|
|
|
|
# I think there's a buggette here... |
601
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
602
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
603
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
604
|
|
|
|
|
|
|
$self->{Methods}->{'end_dtd'} = sub { $handler->end_dtd(@_) }; |
605
|
0
|
|
|
|
|
0
|
} |
606
|
|
|
|
|
|
|
return $res; |
607
|
|
|
|
|
|
|
} |
608
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
609
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
610
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
611
|
|
|
|
|
|
|
) |
612
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
613
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->end_dtd(@_) }; |
614
|
0
|
|
|
|
|
0
|
if ($@) { |
615
|
|
|
|
|
|
|
die $@; |
616
|
|
|
|
|
|
|
} |
617
|
|
|
|
|
|
|
else { |
618
|
|
|
|
|
|
|
# I think there's a buggette here... |
619
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
620
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
621
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
622
|
|
|
|
|
|
|
$self->{Methods}->{'end_dtd'} = sub { $handler->end_dtd(@_) }; |
623
|
0
|
|
|
|
|
0
|
} |
624
|
|
|
|
|
|
|
return $res; |
625
|
|
|
|
|
|
|
} |
626
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
627
|
|
|
|
|
|
|
$self->{Methods}->{'end_dtd'} = sub { }; |
628
|
|
|
|
|
|
|
} |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
} |
632
|
|
|
|
|
|
|
|
633
|
0
|
|
|
0
|
1
|
0
|
sub unparsed_entity_decl { |
634
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
635
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'unparsed_entity_decl'}) { |
636
|
|
|
|
|
|
|
$self->{Methods}->{'unparsed_entity_decl'}->(@_); |
637
|
|
|
|
|
|
|
} |
638
|
0
|
|
|
|
|
0
|
else { |
639
|
|
|
|
|
|
|
my $method; |
640
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
641
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
642
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
643
|
|
|
|
|
|
|
} |
644
|
0
|
|
|
|
|
0
|
else { |
645
|
|
|
|
|
|
|
$callbacks = $self; |
646
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
647
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
648
|
0
|
0
|
|
|
|
0
|
} |
649
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DTDHandler'} and $method = $callbacks->{'DTDHandler'}->can('unparsed_entity_decl') ) { |
650
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
651
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'unparsed_entity_decl'} = sub { $method->($handler, @_) }; |
652
|
|
|
|
|
|
|
return $method->($handler, @_); |
653
|
|
|
|
|
|
|
} |
654
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('unparsed_entity_decl') ) { |
655
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
656
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'unparsed_entity_decl'} = sub { $method->($handler, @_) }; |
657
|
|
|
|
|
|
|
return $method->($handler, @_); |
658
|
|
|
|
|
|
|
} |
659
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DTDHandler'} |
660
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') |
661
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
662
|
|
|
|
|
|
|
) |
663
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
664
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DTDHandler'}->unparsed_entity_decl(@_) }; |
665
|
0
|
|
|
|
|
0
|
if ($@) { |
666
|
|
|
|
|
|
|
die $@; |
667
|
|
|
|
|
|
|
} |
668
|
|
|
|
|
|
|
else { |
669
|
|
|
|
|
|
|
# I think there's a buggette here... |
670
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
671
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
672
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
673
|
|
|
|
|
|
|
$self->{Methods}->{'unparsed_entity_decl'} = sub { $handler->unparsed_entity_decl(@_) }; |
674
|
0
|
|
|
|
|
0
|
} |
675
|
|
|
|
|
|
|
return $res; |
676
|
|
|
|
|
|
|
} |
677
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
678
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
679
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
680
|
|
|
|
|
|
|
) |
681
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
682
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->unparsed_entity_decl(@_) }; |
683
|
0
|
|
|
|
|
0
|
if ($@) { |
684
|
|
|
|
|
|
|
die $@; |
685
|
|
|
|
|
|
|
} |
686
|
|
|
|
|
|
|
else { |
687
|
|
|
|
|
|
|
# I think there's a buggette here... |
688
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
689
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
690
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
691
|
|
|
|
|
|
|
$self->{Methods}->{'unparsed_entity_decl'} = sub { $handler->unparsed_entity_decl(@_) }; |
692
|
0
|
|
|
|
|
0
|
} |
693
|
|
|
|
|
|
|
return $res; |
694
|
|
|
|
|
|
|
} |
695
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
696
|
|
|
|
|
|
|
$self->{Methods}->{'unparsed_entity_decl'} = sub { }; |
697
|
|
|
|
|
|
|
} |
698
|
|
|
|
|
|
|
} |
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
} |
701
|
|
|
|
|
|
|
|
702
|
0
|
|
|
0
|
1
|
0
|
sub processing_instruction { |
703
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
704
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'processing_instruction'}) { |
705
|
|
|
|
|
|
|
$self->{Methods}->{'processing_instruction'}->(@_); |
706
|
|
|
|
|
|
|
} |
707
|
0
|
|
|
|
|
0
|
else { |
708
|
|
|
|
|
|
|
my $method; |
709
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
710
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
711
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
712
|
|
|
|
|
|
|
} |
713
|
0
|
|
|
|
|
0
|
else { |
714
|
|
|
|
|
|
|
$callbacks = $self; |
715
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
716
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
717
|
0
|
0
|
|
|
|
0
|
} |
718
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('processing_instruction') ) { |
719
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
720
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'processing_instruction'} = sub { $method->($handler, @_) }; |
721
|
|
|
|
|
|
|
return $method->($handler, @_); |
722
|
|
|
|
|
|
|
} |
723
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('processing_instruction') ) { |
724
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
725
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'processing_instruction'} = sub { $method->($handler, @_) }; |
726
|
|
|
|
|
|
|
return $method->($handler, @_); |
727
|
|
|
|
|
|
|
} |
728
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('processing_instruction') ) { |
729
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
730
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'processing_instruction'} = sub { $method->($handler, @_) }; |
731
|
|
|
|
|
|
|
return $method->($handler, @_); |
732
|
|
|
|
|
|
|
} |
733
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
734
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
735
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
736
|
|
|
|
|
|
|
) |
737
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
738
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->processing_instruction(@_) }; |
739
|
0
|
|
|
|
|
0
|
if ($@) { |
740
|
|
|
|
|
|
|
die $@; |
741
|
|
|
|
|
|
|
} |
742
|
|
|
|
|
|
|
else { |
743
|
|
|
|
|
|
|
# I think there's a buggette here... |
744
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
745
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
746
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
747
|
|
|
|
|
|
|
$self->{Methods}->{'processing_instruction'} = sub { $handler->processing_instruction(@_) }; |
748
|
0
|
|
|
|
|
0
|
} |
749
|
|
|
|
|
|
|
return $res; |
750
|
|
|
|
|
|
|
} |
751
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
752
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
753
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
754
|
|
|
|
|
|
|
) |
755
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
756
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->processing_instruction(@_) }; |
757
|
0
|
|
|
|
|
0
|
if ($@) { |
758
|
|
|
|
|
|
|
die $@; |
759
|
|
|
|
|
|
|
} |
760
|
|
|
|
|
|
|
else { |
761
|
|
|
|
|
|
|
# I think there's a buggette here... |
762
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
763
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
764
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
765
|
|
|
|
|
|
|
$self->{Methods}->{'processing_instruction'} = sub { $handler->processing_instruction(@_) }; |
766
|
0
|
|
|
|
|
0
|
} |
767
|
|
|
|
|
|
|
return $res; |
768
|
|
|
|
|
|
|
} |
769
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
770
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
771
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
772
|
|
|
|
|
|
|
) |
773
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
774
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->processing_instruction(@_) }; |
775
|
0
|
|
|
|
|
0
|
if ($@) { |
776
|
|
|
|
|
|
|
die $@; |
777
|
|
|
|
|
|
|
} |
778
|
|
|
|
|
|
|
else { |
779
|
|
|
|
|
|
|
# I think there's a buggette here... |
780
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
781
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
782
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
783
|
|
|
|
|
|
|
$self->{Methods}->{'processing_instruction'} = sub { $handler->processing_instruction(@_) }; |
784
|
0
|
|
|
|
|
0
|
} |
785
|
|
|
|
|
|
|
return $res; |
786
|
|
|
|
|
|
|
} |
787
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
788
|
|
|
|
|
|
|
$self->{Methods}->{'processing_instruction'} = sub { }; |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
} |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
} |
793
|
|
|
|
|
|
|
|
794
|
0
|
|
|
0
|
1
|
0
|
sub attribute_decl { |
795
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
796
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'attribute_decl'}) { |
797
|
|
|
|
|
|
|
$self->{Methods}->{'attribute_decl'}->(@_); |
798
|
|
|
|
|
|
|
} |
799
|
0
|
|
|
|
|
0
|
else { |
800
|
|
|
|
|
|
|
my $method; |
801
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
802
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
803
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
804
|
|
|
|
|
|
|
} |
805
|
0
|
|
|
|
|
0
|
else { |
806
|
|
|
|
|
|
|
$callbacks = $self; |
807
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
808
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
809
|
0
|
0
|
|
|
|
0
|
} |
810
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DeclHandler'} and $method = $callbacks->{'DeclHandler'}->can('attribute_decl') ) { |
811
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
812
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'attribute_decl'} = sub { $method->($handler, @_) }; |
813
|
|
|
|
|
|
|
return $method->($handler, @_); |
814
|
|
|
|
|
|
|
} |
815
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('attribute_decl') ) { |
816
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
817
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'attribute_decl'} = sub { $method->($handler, @_) }; |
818
|
|
|
|
|
|
|
return $method->($handler, @_); |
819
|
|
|
|
|
|
|
} |
820
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DeclHandler'} |
821
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') |
822
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
823
|
|
|
|
|
|
|
) |
824
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
825
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DeclHandler'}->attribute_decl(@_) }; |
826
|
0
|
|
|
|
|
0
|
if ($@) { |
827
|
|
|
|
|
|
|
die $@; |
828
|
|
|
|
|
|
|
} |
829
|
|
|
|
|
|
|
else { |
830
|
|
|
|
|
|
|
# I think there's a buggette here... |
831
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
832
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
833
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
834
|
|
|
|
|
|
|
$self->{Methods}->{'attribute_decl'} = sub { $handler->attribute_decl(@_) }; |
835
|
0
|
|
|
|
|
0
|
} |
836
|
|
|
|
|
|
|
return $res; |
837
|
|
|
|
|
|
|
} |
838
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
839
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
840
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
841
|
|
|
|
|
|
|
) |
842
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
843
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->attribute_decl(@_) }; |
844
|
0
|
|
|
|
|
0
|
if ($@) { |
845
|
|
|
|
|
|
|
die $@; |
846
|
|
|
|
|
|
|
} |
847
|
|
|
|
|
|
|
else { |
848
|
|
|
|
|
|
|
# I think there's a buggette here... |
849
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
850
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
851
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
852
|
|
|
|
|
|
|
$self->{Methods}->{'attribute_decl'} = sub { $handler->attribute_decl(@_) }; |
853
|
0
|
|
|
|
|
0
|
} |
854
|
|
|
|
|
|
|
return $res; |
855
|
|
|
|
|
|
|
} |
856
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
857
|
|
|
|
|
|
|
$self->{Methods}->{'attribute_decl'} = sub { }; |
858
|
|
|
|
|
|
|
} |
859
|
|
|
|
|
|
|
} |
860
|
|
|
|
|
|
|
|
861
|
|
|
|
|
|
|
} |
862
|
|
|
|
|
|
|
|
863
|
0
|
|
|
0
|
1
|
0
|
sub fatal_error { |
864
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
865
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'fatal_error'}) { |
866
|
|
|
|
|
|
|
$self->{Methods}->{'fatal_error'}->(@_); |
867
|
|
|
|
|
|
|
} |
868
|
0
|
|
|
|
|
0
|
else { |
869
|
|
|
|
|
|
|
my $method; |
870
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
871
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
872
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
873
|
|
|
|
|
|
|
} |
874
|
0
|
|
|
|
|
0
|
else { |
875
|
|
|
|
|
|
|
$callbacks = $self; |
876
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
877
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
878
|
0
|
0
|
|
|
|
0
|
} |
879
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ErrorHandler'} and $method = $callbacks->{'ErrorHandler'}->can('fatal_error') ) { |
880
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ErrorHandler'}; |
|
0
|
|
|
|
|
0
|
|
881
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'fatal_error'} = sub { $method->($handler, @_) }; |
882
|
|
|
|
|
|
|
return $method->($handler, @_); |
883
|
|
|
|
|
|
|
} |
884
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('fatal_error') ) { |
885
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
886
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'fatal_error'} = sub { $method->($handler, @_) }; |
887
|
|
|
|
|
|
|
return $method->($handler, @_); |
888
|
|
|
|
|
|
|
} |
889
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ErrorHandler'} |
890
|
|
|
|
|
|
|
and $callbacks->{'ErrorHandler'}->can('AUTOLOAD') |
891
|
|
|
|
|
|
|
and $callbacks->{'ErrorHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
892
|
|
|
|
|
|
|
) |
893
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
894
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ErrorHandler'}->fatal_error(@_) }; |
895
|
0
|
|
|
|
|
0
|
if ($@) { |
896
|
|
|
|
|
|
|
die $@; |
897
|
|
|
|
|
|
|
} |
898
|
|
|
|
|
|
|
else { |
899
|
|
|
|
|
|
|
# I think there's a buggette here... |
900
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
901
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
902
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ErrorHandler'}; |
|
0
|
|
|
|
|
0
|
|
903
|
|
|
|
|
|
|
$self->{Methods}->{'fatal_error'} = sub { $handler->fatal_error(@_) }; |
904
|
0
|
|
|
|
|
0
|
} |
905
|
|
|
|
|
|
|
return $res; |
906
|
|
|
|
|
|
|
} |
907
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
908
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
909
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
910
|
|
|
|
|
|
|
) |
911
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
912
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->fatal_error(@_) }; |
913
|
0
|
|
|
|
|
0
|
if ($@) { |
914
|
|
|
|
|
|
|
die $@; |
915
|
|
|
|
|
|
|
} |
916
|
|
|
|
|
|
|
else { |
917
|
|
|
|
|
|
|
# I think there's a buggette here... |
918
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
919
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
920
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
921
|
|
|
|
|
|
|
$self->{Methods}->{'fatal_error'} = sub { $handler->fatal_error(@_) }; |
922
|
0
|
|
|
|
|
0
|
} |
923
|
|
|
|
|
|
|
return $res; |
924
|
|
|
|
|
|
|
} |
925
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
926
|
|
|
|
|
|
|
$self->{Methods}->{'fatal_error'} = sub { }; |
927
|
|
|
|
|
|
|
} |
928
|
|
|
|
|
|
|
} |
929
|
|
|
|
|
|
|
|
930
|
|
|
|
|
|
|
} |
931
|
|
|
|
|
|
|
|
932
|
0
|
|
|
0
|
1
|
0
|
sub end_cdata { |
933
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
934
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'end_cdata'}) { |
935
|
|
|
|
|
|
|
$self->{Methods}->{'end_cdata'}->(@_); |
936
|
|
|
|
|
|
|
} |
937
|
0
|
|
|
|
|
0
|
else { |
938
|
|
|
|
|
|
|
my $method; |
939
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
940
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
941
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
942
|
|
|
|
|
|
|
} |
943
|
0
|
|
|
|
|
0
|
else { |
944
|
|
|
|
|
|
|
$callbacks = $self; |
945
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
946
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
947
|
0
|
0
|
|
|
|
0
|
} |
948
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('end_cdata') ) { |
949
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
950
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_cdata'} = sub { $method->($handler, @_) }; |
951
|
|
|
|
|
|
|
return $method->($handler, @_); |
952
|
|
|
|
|
|
|
} |
953
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('end_cdata') ) { |
954
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
955
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_cdata'} = sub { $method->($handler, @_) }; |
956
|
|
|
|
|
|
|
return $method->($handler, @_); |
957
|
|
|
|
|
|
|
} |
958
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_cdata') ) { |
959
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
960
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_cdata'} = sub { $method->($handler, @_) }; |
961
|
|
|
|
|
|
|
return $method->($handler, @_); |
962
|
|
|
|
|
|
|
} |
963
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
964
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
965
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
966
|
|
|
|
|
|
|
) |
967
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
968
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->end_cdata(@_) }; |
969
|
0
|
|
|
|
|
0
|
if ($@) { |
970
|
|
|
|
|
|
|
die $@; |
971
|
|
|
|
|
|
|
} |
972
|
|
|
|
|
|
|
else { |
973
|
|
|
|
|
|
|
# I think there's a buggette here... |
974
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
975
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
976
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
977
|
|
|
|
|
|
|
$self->{Methods}->{'end_cdata'} = sub { $handler->end_cdata(@_) }; |
978
|
0
|
|
|
|
|
0
|
} |
979
|
|
|
|
|
|
|
return $res; |
980
|
|
|
|
|
|
|
} |
981
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
982
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
983
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
984
|
|
|
|
|
|
|
) |
985
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
986
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->end_cdata(@_) }; |
987
|
0
|
|
|
|
|
0
|
if ($@) { |
988
|
|
|
|
|
|
|
die $@; |
989
|
|
|
|
|
|
|
} |
990
|
|
|
|
|
|
|
else { |
991
|
|
|
|
|
|
|
# I think there's a buggette here... |
992
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
993
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
994
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
995
|
|
|
|
|
|
|
$self->{Methods}->{'end_cdata'} = sub { $handler->end_cdata(@_) }; |
996
|
0
|
|
|
|
|
0
|
} |
997
|
|
|
|
|
|
|
return $res; |
998
|
|
|
|
|
|
|
} |
999
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1000
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1001
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1002
|
|
|
|
|
|
|
) |
1003
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1004
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->end_cdata(@_) }; |
1005
|
0
|
|
|
|
|
0
|
if ($@) { |
1006
|
|
|
|
|
|
|
die $@; |
1007
|
|
|
|
|
|
|
} |
1008
|
|
|
|
|
|
|
else { |
1009
|
|
|
|
|
|
|
# I think there's a buggette here... |
1010
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1011
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1012
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1013
|
|
|
|
|
|
|
$self->{Methods}->{'end_cdata'} = sub { $handler->end_cdata(@_) }; |
1014
|
0
|
|
|
|
|
0
|
} |
1015
|
|
|
|
|
|
|
return $res; |
1016
|
|
|
|
|
|
|
} |
1017
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1018
|
|
|
|
|
|
|
$self->{Methods}->{'end_cdata'} = sub { }; |
1019
|
|
|
|
|
|
|
} |
1020
|
|
|
|
|
|
|
} |
1021
|
|
|
|
|
|
|
|
1022
|
|
|
|
|
|
|
} |
1023
|
|
|
|
|
|
|
|
1024
|
0
|
|
|
0
|
1
|
0
|
sub start_entity { |
1025
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1026
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'start_entity'}) { |
1027
|
|
|
|
|
|
|
$self->{Methods}->{'start_entity'}->(@_); |
1028
|
|
|
|
|
|
|
} |
1029
|
0
|
|
|
|
|
0
|
else { |
1030
|
|
|
|
|
|
|
my $method; |
1031
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1032
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1033
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1034
|
|
|
|
|
|
|
} |
1035
|
0
|
|
|
|
|
0
|
else { |
1036
|
|
|
|
|
|
|
$callbacks = $self; |
1037
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1038
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1039
|
0
|
0
|
|
|
|
0
|
} |
1040
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('start_entity') ) { |
1041
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
1042
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_entity'} = sub { $method->($handler, @_) }; |
1043
|
|
|
|
|
|
|
return $method->($handler, @_); |
1044
|
|
|
|
|
|
|
} |
1045
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_entity') ) { |
1046
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1047
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_entity'} = sub { $method->($handler, @_) }; |
1048
|
|
|
|
|
|
|
return $method->($handler, @_); |
1049
|
|
|
|
|
|
|
} |
1050
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
1051
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
1052
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1053
|
|
|
|
|
|
|
) |
1054
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1055
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->start_entity(@_) }; |
1056
|
0
|
|
|
|
|
0
|
if ($@) { |
1057
|
|
|
|
|
|
|
die $@; |
1058
|
|
|
|
|
|
|
} |
1059
|
|
|
|
|
|
|
else { |
1060
|
|
|
|
|
|
|
# I think there's a buggette here... |
1061
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1062
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1063
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
1064
|
|
|
|
|
|
|
$self->{Methods}->{'start_entity'} = sub { $handler->start_entity(@_) }; |
1065
|
0
|
|
|
|
|
0
|
} |
1066
|
|
|
|
|
|
|
return $res; |
1067
|
|
|
|
|
|
|
} |
1068
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1069
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1070
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1071
|
|
|
|
|
|
|
) |
1072
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1073
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->start_entity(@_) }; |
1074
|
0
|
|
|
|
|
0
|
if ($@) { |
1075
|
|
|
|
|
|
|
die $@; |
1076
|
|
|
|
|
|
|
} |
1077
|
|
|
|
|
|
|
else { |
1078
|
|
|
|
|
|
|
# I think there's a buggette here... |
1079
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1080
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1081
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1082
|
|
|
|
|
|
|
$self->{Methods}->{'start_entity'} = sub { $handler->start_entity(@_) }; |
1083
|
0
|
|
|
|
|
0
|
} |
1084
|
|
|
|
|
|
|
return $res; |
1085
|
|
|
|
|
|
|
} |
1086
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1087
|
|
|
|
|
|
|
$self->{Methods}->{'start_entity'} = sub { }; |
1088
|
|
|
|
|
|
|
} |
1089
|
|
|
|
|
|
|
} |
1090
|
|
|
|
|
|
|
|
1091
|
|
|
|
|
|
|
} |
1092
|
|
|
|
|
|
|
|
1093
|
0
|
|
|
0
|
1
|
0
|
sub start_prefix_mapping { |
1094
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1095
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'start_prefix_mapping'}) { |
1096
|
|
|
|
|
|
|
$self->{Methods}->{'start_prefix_mapping'}->(@_); |
1097
|
|
|
|
|
|
|
} |
1098
|
0
|
|
|
|
|
0
|
else { |
1099
|
|
|
|
|
|
|
my $method; |
1100
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1101
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1102
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1103
|
|
|
|
|
|
|
} |
1104
|
0
|
|
|
|
|
0
|
else { |
1105
|
|
|
|
|
|
|
$callbacks = $self; |
1106
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1107
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1108
|
0
|
0
|
|
|
|
0
|
} |
1109
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('start_prefix_mapping') ) { |
1110
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1111
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_prefix_mapping'} = sub { $method->($handler, @_) }; |
1112
|
|
|
|
|
|
|
return $method->($handler, @_); |
1113
|
|
|
|
|
|
|
} |
1114
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_prefix_mapping') ) { |
1115
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1116
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_prefix_mapping'} = sub { $method->($handler, @_) }; |
1117
|
|
|
|
|
|
|
return $method->($handler, @_); |
1118
|
|
|
|
|
|
|
} |
1119
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
1120
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
1121
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1122
|
|
|
|
|
|
|
) |
1123
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1124
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->start_prefix_mapping(@_) }; |
1125
|
0
|
|
|
|
|
0
|
if ($@) { |
1126
|
|
|
|
|
|
|
die $@; |
1127
|
|
|
|
|
|
|
} |
1128
|
|
|
|
|
|
|
else { |
1129
|
|
|
|
|
|
|
# I think there's a buggette here... |
1130
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1131
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1132
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1133
|
|
|
|
|
|
|
$self->{Methods}->{'start_prefix_mapping'} = sub { $handler->start_prefix_mapping(@_) }; |
1134
|
0
|
|
|
|
|
0
|
} |
1135
|
|
|
|
|
|
|
return $res; |
1136
|
|
|
|
|
|
|
} |
1137
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1138
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1139
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1140
|
|
|
|
|
|
|
) |
1141
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1142
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->start_prefix_mapping(@_) }; |
1143
|
0
|
|
|
|
|
0
|
if ($@) { |
1144
|
|
|
|
|
|
|
die $@; |
1145
|
|
|
|
|
|
|
} |
1146
|
|
|
|
|
|
|
else { |
1147
|
|
|
|
|
|
|
# I think there's a buggette here... |
1148
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1149
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1150
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1151
|
|
|
|
|
|
|
$self->{Methods}->{'start_prefix_mapping'} = sub { $handler->start_prefix_mapping(@_) }; |
1152
|
0
|
|
|
|
|
0
|
} |
1153
|
|
|
|
|
|
|
return $res; |
1154
|
|
|
|
|
|
|
} |
1155
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1156
|
|
|
|
|
|
|
$self->{Methods}->{'start_prefix_mapping'} = sub { }; |
1157
|
|
|
|
|
|
|
} |
1158
|
|
|
|
|
|
|
} |
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
} |
1161
|
|
|
|
|
|
|
|
1162
|
0
|
|
|
0
|
1
|
0
|
sub error { |
1163
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1164
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'error'}) { |
1165
|
|
|
|
|
|
|
$self->{Methods}->{'error'}->(@_); |
1166
|
|
|
|
|
|
|
} |
1167
|
0
|
|
|
|
|
0
|
else { |
1168
|
|
|
|
|
|
|
my $method; |
1169
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1170
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1171
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1172
|
|
|
|
|
|
|
} |
1173
|
0
|
|
|
|
|
0
|
else { |
1174
|
|
|
|
|
|
|
$callbacks = $self; |
1175
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1176
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1177
|
0
|
0
|
|
|
|
0
|
} |
1178
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ErrorHandler'} and $method = $callbacks->{'ErrorHandler'}->can('error') ) { |
1179
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ErrorHandler'}; |
|
0
|
|
|
|
|
0
|
|
1180
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'error'} = sub { $method->($handler, @_) }; |
1181
|
|
|
|
|
|
|
return $method->($handler, @_); |
1182
|
|
|
|
|
|
|
} |
1183
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('error') ) { |
1184
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1185
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'error'} = sub { $method->($handler, @_) }; |
1186
|
|
|
|
|
|
|
return $method->($handler, @_); |
1187
|
|
|
|
|
|
|
} |
1188
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ErrorHandler'} |
1189
|
|
|
|
|
|
|
and $callbacks->{'ErrorHandler'}->can('AUTOLOAD') |
1190
|
|
|
|
|
|
|
and $callbacks->{'ErrorHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1191
|
|
|
|
|
|
|
) |
1192
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1193
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ErrorHandler'}->error(@_) }; |
1194
|
0
|
|
|
|
|
0
|
if ($@) { |
1195
|
|
|
|
|
|
|
die $@; |
1196
|
|
|
|
|
|
|
} |
1197
|
|
|
|
|
|
|
else { |
1198
|
|
|
|
|
|
|
# I think there's a buggette here... |
1199
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1200
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1201
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ErrorHandler'}; |
|
0
|
|
|
|
|
0
|
|
1202
|
|
|
|
|
|
|
$self->{Methods}->{'error'} = sub { $handler->error(@_) }; |
1203
|
0
|
|
|
|
|
0
|
} |
1204
|
|
|
|
|
|
|
return $res; |
1205
|
|
|
|
|
|
|
} |
1206
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1207
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1208
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1209
|
|
|
|
|
|
|
) |
1210
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1211
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->error(@_) }; |
1212
|
0
|
|
|
|
|
0
|
if ($@) { |
1213
|
|
|
|
|
|
|
die $@; |
1214
|
|
|
|
|
|
|
} |
1215
|
|
|
|
|
|
|
else { |
1216
|
|
|
|
|
|
|
# I think there's a buggette here... |
1217
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1218
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1219
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1220
|
|
|
|
|
|
|
$self->{Methods}->{'error'} = sub { $handler->error(@_) }; |
1221
|
0
|
|
|
|
|
0
|
} |
1222
|
|
|
|
|
|
|
return $res; |
1223
|
|
|
|
|
|
|
} |
1224
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1225
|
|
|
|
|
|
|
$self->{Methods}->{'error'} = sub { }; |
1226
|
|
|
|
|
|
|
} |
1227
|
|
|
|
|
|
|
} |
1228
|
|
|
|
|
|
|
|
1229
|
|
|
|
|
|
|
} |
1230
|
|
|
|
|
|
|
|
1231
|
1
|
|
|
1
|
1
|
30
|
sub start_document { |
1232
|
1
|
50
|
|
|
|
4
|
my $self = shift; |
1233
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'start_document'}) { |
1234
|
|
|
|
|
|
|
$self->{Methods}->{'start_document'}->(@_); |
1235
|
|
|
|
|
|
|
} |
1236
|
1
|
|
|
|
|
3
|
else { |
1237
|
|
|
|
|
|
|
my $method; |
1238
|
1
|
50
|
|
|
|
6
|
my $callbacks; |
1239
|
1
|
|
|
|
|
2
|
if (exists $self->{ParseOptions}) { |
1240
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1241
|
|
|
|
|
|
|
} |
1242
|
0
|
|
|
|
|
0
|
else { |
1243
|
|
|
|
|
|
|
$callbacks = $self; |
1244
|
1
|
50
|
33
|
|
|
19
|
} |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1245
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1246
|
0
|
50
|
|
|
|
0
|
} |
1247
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('start_document') ) { |
1248
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1249
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_document'} = sub { $method->($handler, @_) }; |
1250
|
|
|
|
|
|
|
return $method->($handler, @_); |
1251
|
|
|
|
|
|
|
} |
1252
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('start_document') ) { |
1253
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1254
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_document'} = sub { $method->($handler, @_) }; |
1255
|
|
|
|
|
|
|
return $method->($handler, @_); |
1256
|
|
|
|
|
|
|
} |
1257
|
1
|
|
|
|
|
3
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_document') ) { |
1258
|
1
|
|
|
0
|
|
5
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1259
|
1
|
|
|
|
|
10
|
$self->{Methods}->{'start_document'} = sub { $method->($handler, @_) }; |
1260
|
|
|
|
|
|
|
return $method->($handler, @_); |
1261
|
|
|
|
|
|
|
} |
1262
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
1263
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
1264
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1265
|
|
|
|
|
|
|
) |
1266
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1267
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->start_document(@_) }; |
1268
|
0
|
|
|
|
|
0
|
if ($@) { |
1269
|
|
|
|
|
|
|
die $@; |
1270
|
|
|
|
|
|
|
} |
1271
|
|
|
|
|
|
|
else { |
1272
|
|
|
|
|
|
|
# I think there's a buggette here... |
1273
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1274
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1275
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1276
|
|
|
|
|
|
|
$self->{Methods}->{'start_document'} = sub { $handler->start_document(@_) }; |
1277
|
0
|
|
|
|
|
0
|
} |
1278
|
|
|
|
|
|
|
return $res; |
1279
|
|
|
|
|
|
|
} |
1280
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
1281
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
1282
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1283
|
|
|
|
|
|
|
) |
1284
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1285
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->start_document(@_) }; |
1286
|
0
|
|
|
|
|
0
|
if ($@) { |
1287
|
|
|
|
|
|
|
die $@; |
1288
|
|
|
|
|
|
|
} |
1289
|
|
|
|
|
|
|
else { |
1290
|
|
|
|
|
|
|
# I think there's a buggette here... |
1291
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1292
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1293
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1294
|
|
|
|
|
|
|
$self->{Methods}->{'start_document'} = sub { $handler->start_document(@_) }; |
1295
|
0
|
|
|
|
|
0
|
} |
1296
|
|
|
|
|
|
|
return $res; |
1297
|
|
|
|
|
|
|
} |
1298
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1299
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1300
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1301
|
|
|
|
|
|
|
) |
1302
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1303
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->start_document(@_) }; |
1304
|
0
|
|
|
|
|
0
|
if ($@) { |
1305
|
|
|
|
|
|
|
die $@; |
1306
|
|
|
|
|
|
|
} |
1307
|
|
|
|
|
|
|
else { |
1308
|
|
|
|
|
|
|
# I think there's a buggette here... |
1309
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1310
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1311
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1312
|
|
|
|
|
|
|
$self->{Methods}->{'start_document'} = sub { $handler->start_document(@_) }; |
1313
|
0
|
|
|
|
|
0
|
} |
1314
|
|
|
|
|
|
|
return $res; |
1315
|
|
|
|
|
|
|
} |
1316
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1317
|
|
|
|
|
|
|
$self->{Methods}->{'start_document'} = sub { }; |
1318
|
|
|
|
|
|
|
} |
1319
|
|
|
|
|
|
|
} |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
} |
1322
|
|
|
|
|
|
|
|
1323
|
0
|
|
|
0
|
1
|
0
|
sub ignorable_whitespace { |
1324
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1325
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'ignorable_whitespace'}) { |
1326
|
|
|
|
|
|
|
$self->{Methods}->{'ignorable_whitespace'}->(@_); |
1327
|
|
|
|
|
|
|
} |
1328
|
0
|
|
|
|
|
0
|
else { |
1329
|
|
|
|
|
|
|
my $method; |
1330
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1331
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1332
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1333
|
|
|
|
|
|
|
} |
1334
|
0
|
|
|
|
|
0
|
else { |
1335
|
|
|
|
|
|
|
$callbacks = $self; |
1336
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1337
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1338
|
0
|
0
|
|
|
|
0
|
} |
1339
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('ignorable_whitespace') ) { |
1340
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1341
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'ignorable_whitespace'} = sub { $method->($handler, @_) }; |
1342
|
|
|
|
|
|
|
return $method->($handler, @_); |
1343
|
|
|
|
|
|
|
} |
1344
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('ignorable_whitespace') ) { |
1345
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1346
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'ignorable_whitespace'} = sub { $method->($handler, @_) }; |
1347
|
|
|
|
|
|
|
return $method->($handler, @_); |
1348
|
|
|
|
|
|
|
} |
1349
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('ignorable_whitespace') ) { |
1350
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1351
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'ignorable_whitespace'} = sub { $method->($handler, @_) }; |
1352
|
|
|
|
|
|
|
return $method->($handler, @_); |
1353
|
|
|
|
|
|
|
} |
1354
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
1355
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
1356
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1357
|
|
|
|
|
|
|
) |
1358
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1359
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->ignorable_whitespace(@_) }; |
1360
|
0
|
|
|
|
|
0
|
if ($@) { |
1361
|
|
|
|
|
|
|
die $@; |
1362
|
|
|
|
|
|
|
} |
1363
|
|
|
|
|
|
|
else { |
1364
|
|
|
|
|
|
|
# I think there's a buggette here... |
1365
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1366
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1367
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1368
|
|
|
|
|
|
|
$self->{Methods}->{'ignorable_whitespace'} = sub { $handler->ignorable_whitespace(@_) }; |
1369
|
0
|
|
|
|
|
0
|
} |
1370
|
|
|
|
|
|
|
return $res; |
1371
|
|
|
|
|
|
|
} |
1372
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
1373
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
1374
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1375
|
|
|
|
|
|
|
) |
1376
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1377
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->ignorable_whitespace(@_) }; |
1378
|
0
|
|
|
|
|
0
|
if ($@) { |
1379
|
|
|
|
|
|
|
die $@; |
1380
|
|
|
|
|
|
|
} |
1381
|
|
|
|
|
|
|
else { |
1382
|
|
|
|
|
|
|
# I think there's a buggette here... |
1383
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1384
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1385
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1386
|
|
|
|
|
|
|
$self->{Methods}->{'ignorable_whitespace'} = sub { $handler->ignorable_whitespace(@_) }; |
1387
|
0
|
|
|
|
|
0
|
} |
1388
|
|
|
|
|
|
|
return $res; |
1389
|
|
|
|
|
|
|
} |
1390
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1391
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1392
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1393
|
|
|
|
|
|
|
) |
1394
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1395
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->ignorable_whitespace(@_) }; |
1396
|
0
|
|
|
|
|
0
|
if ($@) { |
1397
|
|
|
|
|
|
|
die $@; |
1398
|
|
|
|
|
|
|
} |
1399
|
|
|
|
|
|
|
else { |
1400
|
|
|
|
|
|
|
# I think there's a buggette here... |
1401
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1402
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1403
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1404
|
|
|
|
|
|
|
$self->{Methods}->{'ignorable_whitespace'} = sub { $handler->ignorable_whitespace(@_) }; |
1405
|
0
|
|
|
|
|
0
|
} |
1406
|
|
|
|
|
|
|
return $res; |
1407
|
|
|
|
|
|
|
} |
1408
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1409
|
|
|
|
|
|
|
$self->{Methods}->{'ignorable_whitespace'} = sub { }; |
1410
|
|
|
|
|
|
|
} |
1411
|
|
|
|
|
|
|
} |
1412
|
|
|
|
|
|
|
|
1413
|
|
|
|
|
|
|
} |
1414
|
|
|
|
|
|
|
|
1415
|
2
|
|
|
2
|
1
|
154
|
sub end_document { |
1416
|
2
|
50
|
|
|
|
11
|
my $self = shift; |
1417
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'end_document'}) { |
1418
|
|
|
|
|
|
|
$self->{Methods}->{'end_document'}->(@_); |
1419
|
|
|
|
|
|
|
} |
1420
|
2
|
|
|
|
|
5
|
else { |
1421
|
|
|
|
|
|
|
my $method; |
1422
|
2
|
100
|
|
|
|
7
|
my $callbacks; |
1423
|
1
|
|
|
|
|
4
|
if (exists $self->{ParseOptions}) { |
1424
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1425
|
|
|
|
|
|
|
} |
1426
|
1
|
|
|
|
|
2
|
else { |
1427
|
|
|
|
|
|
|
$callbacks = $self; |
1428
|
2
|
50
|
33
|
|
|
60
|
} |
|
|
50
|
66
|
|
|
|
|
|
|
100
|
33
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
1429
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1430
|
0
|
50
|
|
|
|
0
|
} |
1431
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('end_document') ) { |
1432
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1433
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_document'} = sub { $method->($handler, @_) }; |
1434
|
|
|
|
|
|
|
return $method->($handler, @_); |
1435
|
|
|
|
|
|
|
} |
1436
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('end_document') ) { |
1437
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1438
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_document'} = sub { $method->($handler, @_) }; |
1439
|
|
|
|
|
|
|
return $method->($handler, @_); |
1440
|
|
|
|
|
|
|
} |
1441
|
1
|
|
|
|
|
4
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_document') ) { |
1442
|
1
|
|
|
0
|
|
10
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1443
|
1
|
|
|
|
|
13
|
$self->{Methods}->{'end_document'} = sub { $method->($handler, @_) }; |
1444
|
|
|
|
|
|
|
return $method->($handler, @_); |
1445
|
|
|
|
|
|
|
} |
1446
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
1447
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
1448
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1449
|
|
|
|
|
|
|
) |
1450
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1451
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->end_document(@_) }; |
1452
|
0
|
|
|
|
|
0
|
if ($@) { |
1453
|
|
|
|
|
|
|
die $@; |
1454
|
|
|
|
|
|
|
} |
1455
|
|
|
|
|
|
|
else { |
1456
|
|
|
|
|
|
|
# I think there's a buggette here... |
1457
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1458
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1459
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1460
|
|
|
|
|
|
|
$self->{Methods}->{'end_document'} = sub { $handler->end_document(@_) }; |
1461
|
0
|
|
|
|
|
0
|
} |
1462
|
|
|
|
|
|
|
return $res; |
1463
|
|
|
|
|
|
|
} |
1464
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
1465
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
1466
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1467
|
|
|
|
|
|
|
) |
1468
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1469
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->end_document(@_) }; |
1470
|
0
|
|
|
|
|
0
|
if ($@) { |
1471
|
|
|
|
|
|
|
die $@; |
1472
|
|
|
|
|
|
|
} |
1473
|
|
|
|
|
|
|
else { |
1474
|
|
|
|
|
|
|
# I think there's a buggette here... |
1475
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1476
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1477
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1478
|
|
|
|
|
|
|
$self->{Methods}->{'end_document'} = sub { $handler->end_document(@_) }; |
1479
|
0
|
|
|
|
|
0
|
} |
1480
|
|
|
|
|
|
|
return $res; |
1481
|
|
|
|
|
|
|
} |
1482
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1483
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1484
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1485
|
|
|
|
|
|
|
) |
1486
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1487
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->end_document(@_) }; |
1488
|
0
|
|
|
|
|
0
|
if ($@) { |
1489
|
|
|
|
|
|
|
die $@; |
1490
|
|
|
|
|
|
|
} |
1491
|
|
|
|
|
|
|
else { |
1492
|
|
|
|
|
|
|
# I think there's a buggette here... |
1493
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1494
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1495
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1496
|
|
|
|
|
|
|
$self->{Methods}->{'end_document'} = sub { $handler->end_document(@_) }; |
1497
|
0
|
|
|
|
|
0
|
} |
1498
|
|
|
|
|
|
|
return $res; |
1499
|
|
|
|
|
|
|
} |
1500
|
1
|
|
|
0
|
|
33
|
else { |
|
0
|
|
|
|
|
0
|
|
1501
|
|
|
|
|
|
|
$self->{Methods}->{'end_document'} = sub { }; |
1502
|
|
|
|
|
|
|
} |
1503
|
|
|
|
|
|
|
} |
1504
|
|
|
|
|
|
|
|
1505
|
|
|
|
|
|
|
} |
1506
|
|
|
|
|
|
|
|
1507
|
0
|
|
|
0
|
1
|
0
|
sub start_cdata { |
1508
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1509
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'start_cdata'}) { |
1510
|
|
|
|
|
|
|
$self->{Methods}->{'start_cdata'}->(@_); |
1511
|
|
|
|
|
|
|
} |
1512
|
0
|
|
|
|
|
0
|
else { |
1513
|
|
|
|
|
|
|
my $method; |
1514
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1515
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1516
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1517
|
|
|
|
|
|
|
} |
1518
|
0
|
|
|
|
|
0
|
else { |
1519
|
|
|
|
|
|
|
$callbacks = $self; |
1520
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1521
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1522
|
0
|
0
|
|
|
|
0
|
} |
1523
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('start_cdata') ) { |
1524
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1525
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_cdata'} = sub { $method->($handler, @_) }; |
1526
|
|
|
|
|
|
|
return $method->($handler, @_); |
1527
|
|
|
|
|
|
|
} |
1528
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('start_cdata') ) { |
1529
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
1530
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_cdata'} = sub { $method->($handler, @_) }; |
1531
|
|
|
|
|
|
|
return $method->($handler, @_); |
1532
|
|
|
|
|
|
|
} |
1533
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_cdata') ) { |
1534
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1535
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_cdata'} = sub { $method->($handler, @_) }; |
1536
|
|
|
|
|
|
|
return $method->($handler, @_); |
1537
|
|
|
|
|
|
|
} |
1538
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
1539
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
1540
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1541
|
|
|
|
|
|
|
) |
1542
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1543
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->start_cdata(@_) }; |
1544
|
0
|
|
|
|
|
0
|
if ($@) { |
1545
|
|
|
|
|
|
|
die $@; |
1546
|
|
|
|
|
|
|
} |
1547
|
|
|
|
|
|
|
else { |
1548
|
|
|
|
|
|
|
# I think there's a buggette here... |
1549
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1550
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1551
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1552
|
|
|
|
|
|
|
$self->{Methods}->{'start_cdata'} = sub { $handler->start_cdata(@_) }; |
1553
|
0
|
|
|
|
|
0
|
} |
1554
|
|
|
|
|
|
|
return $res; |
1555
|
|
|
|
|
|
|
} |
1556
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
1557
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
1558
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1559
|
|
|
|
|
|
|
) |
1560
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1561
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->start_cdata(@_) }; |
1562
|
0
|
|
|
|
|
0
|
if ($@) { |
1563
|
|
|
|
|
|
|
die $@; |
1564
|
|
|
|
|
|
|
} |
1565
|
|
|
|
|
|
|
else { |
1566
|
|
|
|
|
|
|
# I think there's a buggette here... |
1567
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1568
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1569
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
1570
|
|
|
|
|
|
|
$self->{Methods}->{'start_cdata'} = sub { $handler->start_cdata(@_) }; |
1571
|
0
|
|
|
|
|
0
|
} |
1572
|
|
|
|
|
|
|
return $res; |
1573
|
|
|
|
|
|
|
} |
1574
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1575
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1576
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1577
|
|
|
|
|
|
|
) |
1578
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1579
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->start_cdata(@_) }; |
1580
|
0
|
|
|
|
|
0
|
if ($@) { |
1581
|
|
|
|
|
|
|
die $@; |
1582
|
|
|
|
|
|
|
} |
1583
|
|
|
|
|
|
|
else { |
1584
|
|
|
|
|
|
|
# I think there's a buggette here... |
1585
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1586
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1587
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1588
|
|
|
|
|
|
|
$self->{Methods}->{'start_cdata'} = sub { $handler->start_cdata(@_) }; |
1589
|
0
|
|
|
|
|
0
|
} |
1590
|
|
|
|
|
|
|
return $res; |
1591
|
|
|
|
|
|
|
} |
1592
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1593
|
|
|
|
|
|
|
$self->{Methods}->{'start_cdata'} = sub { }; |
1594
|
|
|
|
|
|
|
} |
1595
|
|
|
|
|
|
|
} |
1596
|
|
|
|
|
|
|
|
1597
|
|
|
|
|
|
|
} |
1598
|
|
|
|
|
|
|
|
1599
|
2
|
|
|
2
|
1
|
47
|
sub set_document_locator { |
1600
|
2
|
50
|
|
|
|
8
|
my $self = shift; |
1601
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'set_document_locator'}) { |
1602
|
|
|
|
|
|
|
$self->{Methods}->{'set_document_locator'}->(@_); |
1603
|
|
|
|
|
|
|
} |
1604
|
2
|
|
|
|
|
4
|
else { |
1605
|
|
|
|
|
|
|
my $method; |
1606
|
2
|
100
|
|
|
|
6
|
my $callbacks; |
1607
|
1
|
|
|
|
|
2
|
if (exists $self->{ParseOptions}) { |
1608
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1609
|
|
|
|
|
|
|
} |
1610
|
1
|
|
|
|
|
3
|
else { |
1611
|
|
|
|
|
|
|
$callbacks = $self; |
1612
|
2
|
50
|
33
|
|
|
72
|
} |
|
|
50
|
66
|
|
|
|
|
|
|
100
|
33
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
33
|
|
|
|
|
1613
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1614
|
0
|
50
|
|
|
|
0
|
} |
1615
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('set_document_locator') ) { |
1616
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1617
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'set_document_locator'} = sub { $method->($handler, @_) }; |
1618
|
|
|
|
|
|
|
return $method->($handler, @_); |
1619
|
|
|
|
|
|
|
} |
1620
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('set_document_locator') ) { |
1621
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1622
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'set_document_locator'} = sub { $method->($handler, @_) }; |
1623
|
|
|
|
|
|
|
return $method->($handler, @_); |
1624
|
|
|
|
|
|
|
} |
1625
|
1
|
|
|
|
|
3
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('set_document_locator') ) { |
1626
|
1
|
|
|
0
|
|
8
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1627
|
1
|
|
|
|
|
10
|
$self->{Methods}->{'set_document_locator'} = sub { $method->($handler, @_) }; |
1628
|
|
|
|
|
|
|
return $method->($handler, @_); |
1629
|
|
|
|
|
|
|
} |
1630
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
1631
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
1632
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1633
|
|
|
|
|
|
|
) |
1634
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1635
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->set_document_locator(@_) }; |
1636
|
0
|
|
|
|
|
0
|
if ($@) { |
1637
|
|
|
|
|
|
|
die $@; |
1638
|
|
|
|
|
|
|
} |
1639
|
|
|
|
|
|
|
else { |
1640
|
|
|
|
|
|
|
# I think there's a buggette here... |
1641
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1642
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1643
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1644
|
|
|
|
|
|
|
$self->{Methods}->{'set_document_locator'} = sub { $handler->set_document_locator(@_) }; |
1645
|
0
|
|
|
|
|
0
|
} |
1646
|
|
|
|
|
|
|
return $res; |
1647
|
|
|
|
|
|
|
} |
1648
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
1649
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
1650
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1651
|
|
|
|
|
|
|
) |
1652
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1653
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->set_document_locator(@_) }; |
1654
|
0
|
|
|
|
|
0
|
if ($@) { |
1655
|
|
|
|
|
|
|
die $@; |
1656
|
|
|
|
|
|
|
} |
1657
|
|
|
|
|
|
|
else { |
1658
|
|
|
|
|
|
|
# I think there's a buggette here... |
1659
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1660
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1661
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1662
|
|
|
|
|
|
|
$self->{Methods}->{'set_document_locator'} = sub { $handler->set_document_locator(@_) }; |
1663
|
0
|
|
|
|
|
0
|
} |
1664
|
|
|
|
|
|
|
return $res; |
1665
|
|
|
|
|
|
|
} |
1666
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1667
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1668
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1669
|
|
|
|
|
|
|
) |
1670
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1671
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->set_document_locator(@_) }; |
1672
|
0
|
|
|
|
|
0
|
if ($@) { |
1673
|
|
|
|
|
|
|
die $@; |
1674
|
|
|
|
|
|
|
} |
1675
|
|
|
|
|
|
|
else { |
1676
|
|
|
|
|
|
|
# I think there's a buggette here... |
1677
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1678
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1679
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1680
|
|
|
|
|
|
|
$self->{Methods}->{'set_document_locator'} = sub { $handler->set_document_locator(@_) }; |
1681
|
0
|
|
|
|
|
0
|
} |
1682
|
|
|
|
|
|
|
return $res; |
1683
|
|
|
|
|
|
|
} |
1684
|
1
|
|
|
0
|
|
10
|
else { |
|
0
|
|
|
|
|
0
|
|
1685
|
|
|
|
|
|
|
$self->{Methods}->{'set_document_locator'} = sub { }; |
1686
|
|
|
|
|
|
|
} |
1687
|
|
|
|
|
|
|
} |
1688
|
|
|
|
|
|
|
|
1689
|
|
|
|
|
|
|
} |
1690
|
|
|
|
|
|
|
|
1691
|
0
|
|
|
0
|
1
|
0
|
sub attlist_decl { |
1692
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1693
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'attlist_decl'}) { |
1694
|
|
|
|
|
|
|
$self->{Methods}->{'attlist_decl'}->(@_); |
1695
|
|
|
|
|
|
|
} |
1696
|
0
|
|
|
|
|
0
|
else { |
1697
|
|
|
|
|
|
|
my $method; |
1698
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1699
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1700
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1701
|
|
|
|
|
|
|
} |
1702
|
0
|
|
|
|
|
0
|
else { |
1703
|
|
|
|
|
|
|
$callbacks = $self; |
1704
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1705
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1706
|
0
|
0
|
|
|
|
0
|
} |
1707
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DTDHandler'} and $method = $callbacks->{'DTDHandler'}->can('attlist_decl') ) { |
1708
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
1709
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'attlist_decl'} = sub { $method->($handler, @_) }; |
1710
|
|
|
|
|
|
|
return $method->($handler, @_); |
1711
|
|
|
|
|
|
|
} |
1712
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('attlist_decl') ) { |
1713
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1714
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'attlist_decl'} = sub { $method->($handler, @_) }; |
1715
|
|
|
|
|
|
|
return $method->($handler, @_); |
1716
|
|
|
|
|
|
|
} |
1717
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DTDHandler'} |
1718
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') |
1719
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1720
|
|
|
|
|
|
|
) |
1721
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1722
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DTDHandler'}->attlist_decl(@_) }; |
1723
|
0
|
|
|
|
|
0
|
if ($@) { |
1724
|
|
|
|
|
|
|
die $@; |
1725
|
|
|
|
|
|
|
} |
1726
|
|
|
|
|
|
|
else { |
1727
|
|
|
|
|
|
|
# I think there's a buggette here... |
1728
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1729
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1730
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
1731
|
|
|
|
|
|
|
$self->{Methods}->{'attlist_decl'} = sub { $handler->attlist_decl(@_) }; |
1732
|
0
|
|
|
|
|
0
|
} |
1733
|
|
|
|
|
|
|
return $res; |
1734
|
|
|
|
|
|
|
} |
1735
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1736
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1737
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1738
|
|
|
|
|
|
|
) |
1739
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1740
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->attlist_decl(@_) }; |
1741
|
0
|
|
|
|
|
0
|
if ($@) { |
1742
|
|
|
|
|
|
|
die $@; |
1743
|
|
|
|
|
|
|
} |
1744
|
|
|
|
|
|
|
else { |
1745
|
|
|
|
|
|
|
# I think there's a buggette here... |
1746
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1747
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1748
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1749
|
|
|
|
|
|
|
$self->{Methods}->{'attlist_decl'} = sub { $handler->attlist_decl(@_) }; |
1750
|
0
|
|
|
|
|
0
|
} |
1751
|
|
|
|
|
|
|
return $res; |
1752
|
|
|
|
|
|
|
} |
1753
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1754
|
|
|
|
|
|
|
$self->{Methods}->{'attlist_decl'} = sub { }; |
1755
|
|
|
|
|
|
|
} |
1756
|
|
|
|
|
|
|
} |
1757
|
|
|
|
|
|
|
|
1758
|
|
|
|
|
|
|
} |
1759
|
|
|
|
|
|
|
|
1760
|
0
|
|
|
0
|
1
|
0
|
sub start_dtd { |
1761
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1762
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'start_dtd'}) { |
1763
|
|
|
|
|
|
|
$self->{Methods}->{'start_dtd'}->(@_); |
1764
|
|
|
|
|
|
|
} |
1765
|
0
|
|
|
|
|
0
|
else { |
1766
|
|
|
|
|
|
|
my $method; |
1767
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1768
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1769
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1770
|
|
|
|
|
|
|
} |
1771
|
0
|
|
|
|
|
0
|
else { |
1772
|
|
|
|
|
|
|
$callbacks = $self; |
1773
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1774
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1775
|
0
|
0
|
|
|
|
0
|
} |
1776
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('start_dtd') ) { |
1777
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
1778
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_dtd'} = sub { $method->($handler, @_) }; |
1779
|
|
|
|
|
|
|
return $method->($handler, @_); |
1780
|
|
|
|
|
|
|
} |
1781
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_dtd') ) { |
1782
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1783
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'start_dtd'} = sub { $method->($handler, @_) }; |
1784
|
|
|
|
|
|
|
return $method->($handler, @_); |
1785
|
|
|
|
|
|
|
} |
1786
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
1787
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
1788
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1789
|
|
|
|
|
|
|
) |
1790
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1791
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->start_dtd(@_) }; |
1792
|
0
|
|
|
|
|
0
|
if ($@) { |
1793
|
|
|
|
|
|
|
die $@; |
1794
|
|
|
|
|
|
|
} |
1795
|
|
|
|
|
|
|
else { |
1796
|
|
|
|
|
|
|
# I think there's a buggette here... |
1797
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1798
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1799
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
1800
|
|
|
|
|
|
|
$self->{Methods}->{'start_dtd'} = sub { $handler->start_dtd(@_) }; |
1801
|
0
|
|
|
|
|
0
|
} |
1802
|
|
|
|
|
|
|
return $res; |
1803
|
|
|
|
|
|
|
} |
1804
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1805
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1806
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1807
|
|
|
|
|
|
|
) |
1808
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1809
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->start_dtd(@_) }; |
1810
|
0
|
|
|
|
|
0
|
if ($@) { |
1811
|
|
|
|
|
|
|
die $@; |
1812
|
|
|
|
|
|
|
} |
1813
|
|
|
|
|
|
|
else { |
1814
|
|
|
|
|
|
|
# I think there's a buggette here... |
1815
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1816
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1817
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1818
|
|
|
|
|
|
|
$self->{Methods}->{'start_dtd'} = sub { $handler->start_dtd(@_) }; |
1819
|
0
|
|
|
|
|
0
|
} |
1820
|
|
|
|
|
|
|
return $res; |
1821
|
|
|
|
|
|
|
} |
1822
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1823
|
|
|
|
|
|
|
$self->{Methods}->{'start_dtd'} = sub { }; |
1824
|
|
|
|
|
|
|
} |
1825
|
|
|
|
|
|
|
} |
1826
|
|
|
|
|
|
|
|
1827
|
|
|
|
|
|
|
} |
1828
|
|
|
|
|
|
|
|
1829
|
0
|
|
|
0
|
1
|
0
|
sub resolve_entity { |
1830
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1831
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'resolve_entity'}) { |
1832
|
|
|
|
|
|
|
$self->{Methods}->{'resolve_entity'}->(@_); |
1833
|
|
|
|
|
|
|
} |
1834
|
0
|
|
|
|
|
0
|
else { |
1835
|
|
|
|
|
|
|
my $method; |
1836
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1837
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1838
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1839
|
|
|
|
|
|
|
} |
1840
|
0
|
|
|
|
|
0
|
else { |
1841
|
|
|
|
|
|
|
$callbacks = $self; |
1842
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1843
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1844
|
0
|
0
|
|
|
|
0
|
} |
1845
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'EntityResolver'} and $method = $callbacks->{'EntityResolver'}->can('resolve_entity') ) { |
1846
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'EntityResolver'}; |
|
0
|
|
|
|
|
0
|
|
1847
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'resolve_entity'} = sub { $method->($handler, @_) }; |
1848
|
|
|
|
|
|
|
return $method->($handler, @_); |
1849
|
|
|
|
|
|
|
} |
1850
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('resolve_entity') ) { |
1851
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1852
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'resolve_entity'} = sub { $method->($handler, @_) }; |
1853
|
|
|
|
|
|
|
return $method->($handler, @_); |
1854
|
|
|
|
|
|
|
} |
1855
|
|
|
|
|
|
|
elsif (defined $callbacks->{'EntityResolver'} |
1856
|
|
|
|
|
|
|
and $callbacks->{'EntityResolver'}->can('AUTOLOAD') |
1857
|
|
|
|
|
|
|
and $callbacks->{'EntityResolver'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1858
|
|
|
|
|
|
|
) |
1859
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1860
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'EntityResolver'}->resolve_entity(@_) }; |
1861
|
0
|
|
|
|
|
0
|
if ($@) { |
1862
|
|
|
|
|
|
|
die $@; |
1863
|
|
|
|
|
|
|
} |
1864
|
|
|
|
|
|
|
else { |
1865
|
|
|
|
|
|
|
# I think there's a buggette here... |
1866
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1867
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1868
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'EntityResolver'}; |
|
0
|
|
|
|
|
0
|
|
1869
|
|
|
|
|
|
|
$self->{Methods}->{'resolve_entity'} = sub { $handler->resolve_entity(@_) }; |
1870
|
0
|
|
|
|
|
0
|
} |
1871
|
|
|
|
|
|
|
return $res; |
1872
|
|
|
|
|
|
|
} |
1873
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1874
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1875
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1876
|
|
|
|
|
|
|
) |
1877
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1878
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->resolve_entity(@_) }; |
1879
|
0
|
|
|
|
|
0
|
if ($@) { |
1880
|
|
|
|
|
|
|
die $@; |
1881
|
|
|
|
|
|
|
} |
1882
|
|
|
|
|
|
|
else { |
1883
|
|
|
|
|
|
|
# I think there's a buggette here... |
1884
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1885
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1886
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1887
|
|
|
|
|
|
|
$self->{Methods}->{'resolve_entity'} = sub { $handler->resolve_entity(@_) }; |
1888
|
0
|
|
|
|
|
0
|
} |
1889
|
|
|
|
|
|
|
return $res; |
1890
|
|
|
|
|
|
|
} |
1891
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1892
|
|
|
|
|
|
|
$self->{Methods}->{'resolve_entity'} = sub { }; |
1893
|
|
|
|
|
|
|
} |
1894
|
|
|
|
|
|
|
} |
1895
|
|
|
|
|
|
|
|
1896
|
|
|
|
|
|
|
} |
1897
|
|
|
|
|
|
|
|
1898
|
0
|
|
|
0
|
1
|
0
|
sub entity_reference { |
1899
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1900
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'entity_reference'}) { |
1901
|
|
|
|
|
|
|
$self->{Methods}->{'entity_reference'}->(@_); |
1902
|
|
|
|
|
|
|
} |
1903
|
0
|
|
|
|
|
0
|
else { |
1904
|
|
|
|
|
|
|
my $method; |
1905
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1906
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1907
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1908
|
|
|
|
|
|
|
} |
1909
|
0
|
|
|
|
|
0
|
else { |
1910
|
|
|
|
|
|
|
$callbacks = $self; |
1911
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1912
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1913
|
0
|
0
|
|
|
|
0
|
} |
1914
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('entity_reference') ) { |
1915
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1916
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'entity_reference'} = sub { $method->($handler, @_) }; |
1917
|
|
|
|
|
|
|
return $method->($handler, @_); |
1918
|
|
|
|
|
|
|
} |
1919
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('entity_reference') ) { |
1920
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1921
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'entity_reference'} = sub { $method->($handler, @_) }; |
1922
|
|
|
|
|
|
|
return $method->($handler, @_); |
1923
|
|
|
|
|
|
|
} |
1924
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
1925
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
1926
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1927
|
|
|
|
|
|
|
) |
1928
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1929
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->entity_reference(@_) }; |
1930
|
0
|
|
|
|
|
0
|
if ($@) { |
1931
|
|
|
|
|
|
|
die $@; |
1932
|
|
|
|
|
|
|
} |
1933
|
|
|
|
|
|
|
else { |
1934
|
|
|
|
|
|
|
# I think there's a buggette here... |
1935
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1936
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1937
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
1938
|
|
|
|
|
|
|
$self->{Methods}->{'entity_reference'} = sub { $handler->entity_reference(@_) }; |
1939
|
0
|
|
|
|
|
0
|
} |
1940
|
|
|
|
|
|
|
return $res; |
1941
|
|
|
|
|
|
|
} |
1942
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
1943
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
1944
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1945
|
|
|
|
|
|
|
) |
1946
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1947
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->entity_reference(@_) }; |
1948
|
0
|
|
|
|
|
0
|
if ($@) { |
1949
|
|
|
|
|
|
|
die $@; |
1950
|
|
|
|
|
|
|
} |
1951
|
|
|
|
|
|
|
else { |
1952
|
|
|
|
|
|
|
# I think there's a buggette here... |
1953
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
1954
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
1955
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1956
|
|
|
|
|
|
|
$self->{Methods}->{'entity_reference'} = sub { $handler->entity_reference(@_) }; |
1957
|
0
|
|
|
|
|
0
|
} |
1958
|
|
|
|
|
|
|
return $res; |
1959
|
|
|
|
|
|
|
} |
1960
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
1961
|
|
|
|
|
|
|
$self->{Methods}->{'entity_reference'} = sub { }; |
1962
|
|
|
|
|
|
|
} |
1963
|
|
|
|
|
|
|
} |
1964
|
|
|
|
|
|
|
|
1965
|
|
|
|
|
|
|
} |
1966
|
|
|
|
|
|
|
|
1967
|
0
|
|
|
0
|
1
|
0
|
sub element_decl { |
1968
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
1969
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'element_decl'}) { |
1970
|
|
|
|
|
|
|
$self->{Methods}->{'element_decl'}->(@_); |
1971
|
|
|
|
|
|
|
} |
1972
|
0
|
|
|
|
|
0
|
else { |
1973
|
|
|
|
|
|
|
my $method; |
1974
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
1975
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
1976
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
1977
|
|
|
|
|
|
|
} |
1978
|
0
|
|
|
|
|
0
|
else { |
1979
|
|
|
|
|
|
|
$callbacks = $self; |
1980
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1981
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
1982
|
0
|
0
|
|
|
|
0
|
} |
1983
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DeclHandler'} and $method = $callbacks->{'DeclHandler'}->can('element_decl') ) { |
1984
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
1985
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'element_decl'} = sub { $method->($handler, @_) }; |
1986
|
|
|
|
|
|
|
return $method->($handler, @_); |
1987
|
|
|
|
|
|
|
} |
1988
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('element_decl') ) { |
1989
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
1990
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'element_decl'} = sub { $method->($handler, @_) }; |
1991
|
|
|
|
|
|
|
return $method->($handler, @_); |
1992
|
|
|
|
|
|
|
} |
1993
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DeclHandler'} |
1994
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') |
1995
|
|
|
|
|
|
|
and $callbacks->{'DeclHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
1996
|
|
|
|
|
|
|
) |
1997
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
1998
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DeclHandler'}->element_decl(@_) }; |
1999
|
0
|
|
|
|
|
0
|
if ($@) { |
2000
|
|
|
|
|
|
|
die $@; |
2001
|
|
|
|
|
|
|
} |
2002
|
|
|
|
|
|
|
else { |
2003
|
|
|
|
|
|
|
# I think there's a buggette here... |
2004
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2005
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2006
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DeclHandler'}; |
|
0
|
|
|
|
|
0
|
|
2007
|
|
|
|
|
|
|
$self->{Methods}->{'element_decl'} = sub { $handler->element_decl(@_) }; |
2008
|
0
|
|
|
|
|
0
|
} |
2009
|
|
|
|
|
|
|
return $res; |
2010
|
|
|
|
|
|
|
} |
2011
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2012
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2013
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2014
|
|
|
|
|
|
|
) |
2015
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2016
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->element_decl(@_) }; |
2017
|
0
|
|
|
|
|
0
|
if ($@) { |
2018
|
|
|
|
|
|
|
die $@; |
2019
|
|
|
|
|
|
|
} |
2020
|
|
|
|
|
|
|
else { |
2021
|
|
|
|
|
|
|
# I think there's a buggette here... |
2022
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2023
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2024
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2025
|
|
|
|
|
|
|
$self->{Methods}->{'element_decl'} = sub { $handler->element_decl(@_) }; |
2026
|
0
|
|
|
|
|
0
|
} |
2027
|
|
|
|
|
|
|
return $res; |
2028
|
|
|
|
|
|
|
} |
2029
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2030
|
|
|
|
|
|
|
$self->{Methods}->{'element_decl'} = sub { }; |
2031
|
|
|
|
|
|
|
} |
2032
|
|
|
|
|
|
|
} |
2033
|
|
|
|
|
|
|
|
2034
|
|
|
|
|
|
|
} |
2035
|
|
|
|
|
|
|
|
2036
|
0
|
|
|
0
|
1
|
0
|
sub notation_decl { |
2037
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
2038
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'notation_decl'}) { |
2039
|
|
|
|
|
|
|
$self->{Methods}->{'notation_decl'}->(@_); |
2040
|
|
|
|
|
|
|
} |
2041
|
0
|
|
|
|
|
0
|
else { |
2042
|
|
|
|
|
|
|
my $method; |
2043
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
2044
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
2045
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2046
|
|
|
|
|
|
|
} |
2047
|
0
|
|
|
|
|
0
|
else { |
2048
|
|
|
|
|
|
|
$callbacks = $self; |
2049
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2050
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2051
|
0
|
0
|
|
|
|
0
|
} |
2052
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DTDHandler'} and $method = $callbacks->{'DTDHandler'}->can('notation_decl') ) { |
2053
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
2054
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'notation_decl'} = sub { $method->($handler, @_) }; |
2055
|
|
|
|
|
|
|
return $method->($handler, @_); |
2056
|
|
|
|
|
|
|
} |
2057
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('notation_decl') ) { |
2058
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2059
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'notation_decl'} = sub { $method->($handler, @_) }; |
2060
|
|
|
|
|
|
|
return $method->($handler, @_); |
2061
|
|
|
|
|
|
|
} |
2062
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DTDHandler'} |
2063
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') |
2064
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2065
|
|
|
|
|
|
|
) |
2066
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2067
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DTDHandler'}->notation_decl(@_) }; |
2068
|
0
|
|
|
|
|
0
|
if ($@) { |
2069
|
|
|
|
|
|
|
die $@; |
2070
|
|
|
|
|
|
|
} |
2071
|
|
|
|
|
|
|
else { |
2072
|
|
|
|
|
|
|
# I think there's a buggette here... |
2073
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2074
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2075
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
2076
|
|
|
|
|
|
|
$self->{Methods}->{'notation_decl'} = sub { $handler->notation_decl(@_) }; |
2077
|
0
|
|
|
|
|
0
|
} |
2078
|
|
|
|
|
|
|
return $res; |
2079
|
|
|
|
|
|
|
} |
2080
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2081
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2082
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2083
|
|
|
|
|
|
|
) |
2084
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2085
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->notation_decl(@_) }; |
2086
|
0
|
|
|
|
|
0
|
if ($@) { |
2087
|
|
|
|
|
|
|
die $@; |
2088
|
|
|
|
|
|
|
} |
2089
|
|
|
|
|
|
|
else { |
2090
|
|
|
|
|
|
|
# I think there's a buggette here... |
2091
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2092
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2093
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2094
|
|
|
|
|
|
|
$self->{Methods}->{'notation_decl'} = sub { $handler->notation_decl(@_) }; |
2095
|
0
|
|
|
|
|
0
|
} |
2096
|
|
|
|
|
|
|
return $res; |
2097
|
|
|
|
|
|
|
} |
2098
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2099
|
|
|
|
|
|
|
$self->{Methods}->{'notation_decl'} = sub { }; |
2100
|
|
|
|
|
|
|
} |
2101
|
|
|
|
|
|
|
} |
2102
|
|
|
|
|
|
|
|
2103
|
|
|
|
|
|
|
} |
2104
|
|
|
|
|
|
|
|
2105
|
0
|
|
|
0
|
1
|
0
|
sub skipped_entity { |
2106
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
2107
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'skipped_entity'}) { |
2108
|
|
|
|
|
|
|
$self->{Methods}->{'skipped_entity'}->(@_); |
2109
|
|
|
|
|
|
|
} |
2110
|
0
|
|
|
|
|
0
|
else { |
2111
|
|
|
|
|
|
|
my $method; |
2112
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
2113
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
2114
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2115
|
|
|
|
|
|
|
} |
2116
|
0
|
|
|
|
|
0
|
else { |
2117
|
|
|
|
|
|
|
$callbacks = $self; |
2118
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2119
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2120
|
0
|
0
|
|
|
|
0
|
} |
2121
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('skipped_entity') ) { |
2122
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2123
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'skipped_entity'} = sub { $method->($handler, @_) }; |
2124
|
|
|
|
|
|
|
return $method->($handler, @_); |
2125
|
|
|
|
|
|
|
} |
2126
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('skipped_entity') ) { |
2127
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2128
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'skipped_entity'} = sub { $method->($handler, @_) }; |
2129
|
|
|
|
|
|
|
return $method->($handler, @_); |
2130
|
|
|
|
|
|
|
} |
2131
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
2132
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
2133
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2134
|
|
|
|
|
|
|
) |
2135
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2136
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->skipped_entity(@_) }; |
2137
|
0
|
|
|
|
|
0
|
if ($@) { |
2138
|
|
|
|
|
|
|
die $@; |
2139
|
|
|
|
|
|
|
} |
2140
|
|
|
|
|
|
|
else { |
2141
|
|
|
|
|
|
|
# I think there's a buggette here... |
2142
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2143
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2144
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2145
|
|
|
|
|
|
|
$self->{Methods}->{'skipped_entity'} = sub { $handler->skipped_entity(@_) }; |
2146
|
0
|
|
|
|
|
0
|
} |
2147
|
|
|
|
|
|
|
return $res; |
2148
|
|
|
|
|
|
|
} |
2149
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2150
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2151
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2152
|
|
|
|
|
|
|
) |
2153
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2154
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->skipped_entity(@_) }; |
2155
|
0
|
|
|
|
|
0
|
if ($@) { |
2156
|
|
|
|
|
|
|
die $@; |
2157
|
|
|
|
|
|
|
} |
2158
|
|
|
|
|
|
|
else { |
2159
|
|
|
|
|
|
|
# I think there's a buggette here... |
2160
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2161
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2162
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2163
|
|
|
|
|
|
|
$self->{Methods}->{'skipped_entity'} = sub { $handler->skipped_entity(@_) }; |
2164
|
0
|
|
|
|
|
0
|
} |
2165
|
|
|
|
|
|
|
return $res; |
2166
|
|
|
|
|
|
|
} |
2167
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2168
|
|
|
|
|
|
|
$self->{Methods}->{'skipped_entity'} = sub { }; |
2169
|
|
|
|
|
|
|
} |
2170
|
|
|
|
|
|
|
} |
2171
|
|
|
|
|
|
|
|
2172
|
|
|
|
|
|
|
} |
2173
|
|
|
|
|
|
|
|
2174
|
7
|
|
|
7
|
1
|
967
|
sub end_element { |
2175
|
7
|
100
|
|
|
|
26
|
my $self = shift; |
2176
|
6
|
|
|
|
|
21
|
if (defined $self->{Methods}->{'end_element'}) { |
2177
|
|
|
|
|
|
|
$self->{Methods}->{'end_element'}->(@_); |
2178
|
|
|
|
|
|
|
} |
2179
|
1
|
|
|
|
|
2
|
else { |
2180
|
|
|
|
|
|
|
my $method; |
2181
|
1
|
50
|
|
|
|
5
|
my $callbacks; |
2182
|
1
|
|
|
|
|
2
|
if (exists $self->{ParseOptions}) { |
2183
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2184
|
|
|
|
|
|
|
} |
2185
|
0
|
|
|
|
|
0
|
else { |
2186
|
|
|
|
|
|
|
$callbacks = $self; |
2187
|
1
|
50
|
33
|
|
|
22
|
} |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2188
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2189
|
0
|
50
|
|
|
|
0
|
} |
2190
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('end_element') ) { |
2191
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2192
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_element'} = sub { $method->($handler, @_) }; |
2193
|
|
|
|
|
|
|
return $method->($handler, @_); |
2194
|
|
|
|
|
|
|
} |
2195
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('end_element') ) { |
2196
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2197
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_element'} = sub { $method->($handler, @_) }; |
2198
|
|
|
|
|
|
|
return $method->($handler, @_); |
2199
|
|
|
|
|
|
|
} |
2200
|
1
|
|
|
|
|
3
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_element') ) { |
2201
|
1
|
|
|
6
|
|
6
|
my $handler = $callbacks->{'Handler'}; |
|
6
|
|
|
|
|
19
|
|
2202
|
1
|
|
|
|
|
5
|
$self->{Methods}->{'end_element'} = sub { $method->($handler, @_) }; |
2203
|
|
|
|
|
|
|
return $method->($handler, @_); |
2204
|
|
|
|
|
|
|
} |
2205
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ContentHandler'} |
2206
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') |
2207
|
|
|
|
|
|
|
and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2208
|
|
|
|
|
|
|
) |
2209
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2210
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ContentHandler'}->end_element(@_) }; |
2211
|
0
|
|
|
|
|
0
|
if ($@) { |
2212
|
|
|
|
|
|
|
die $@; |
2213
|
|
|
|
|
|
|
} |
2214
|
|
|
|
|
|
|
else { |
2215
|
|
|
|
|
|
|
# I think there's a buggette here... |
2216
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2217
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2218
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ContentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2219
|
|
|
|
|
|
|
$self->{Methods}->{'end_element'} = sub { $handler->end_element(@_) }; |
2220
|
0
|
|
|
|
|
0
|
} |
2221
|
|
|
|
|
|
|
return $res; |
2222
|
|
|
|
|
|
|
} |
2223
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
2224
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
2225
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2226
|
|
|
|
|
|
|
) |
2227
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2228
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->end_element(@_) }; |
2229
|
0
|
|
|
|
|
0
|
if ($@) { |
2230
|
|
|
|
|
|
|
die $@; |
2231
|
|
|
|
|
|
|
} |
2232
|
|
|
|
|
|
|
else { |
2233
|
|
|
|
|
|
|
# I think there's a buggette here... |
2234
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2235
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2236
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2237
|
|
|
|
|
|
|
$self->{Methods}->{'end_element'} = sub { $handler->end_element(@_) }; |
2238
|
0
|
|
|
|
|
0
|
} |
2239
|
|
|
|
|
|
|
return $res; |
2240
|
|
|
|
|
|
|
} |
2241
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2242
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2243
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2244
|
|
|
|
|
|
|
) |
2245
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2246
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->end_element(@_) }; |
2247
|
0
|
|
|
|
|
0
|
if ($@) { |
2248
|
|
|
|
|
|
|
die $@; |
2249
|
|
|
|
|
|
|
} |
2250
|
|
|
|
|
|
|
else { |
2251
|
|
|
|
|
|
|
# I think there's a buggette here... |
2252
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2253
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2254
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2255
|
|
|
|
|
|
|
$self->{Methods}->{'end_element'} = sub { $handler->end_element(@_) }; |
2256
|
0
|
|
|
|
|
0
|
} |
2257
|
|
|
|
|
|
|
return $res; |
2258
|
|
|
|
|
|
|
} |
2259
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2260
|
|
|
|
|
|
|
$self->{Methods}->{'end_element'} = sub { }; |
2261
|
|
|
|
|
|
|
} |
2262
|
|
|
|
|
|
|
} |
2263
|
|
|
|
|
|
|
|
2264
|
|
|
|
|
|
|
} |
2265
|
|
|
|
|
|
|
|
2266
|
0
|
|
|
0
|
1
|
0
|
sub doctype_decl { |
2267
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
2268
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'doctype_decl'}) { |
2269
|
|
|
|
|
|
|
$self->{Methods}->{'doctype_decl'}->(@_); |
2270
|
|
|
|
|
|
|
} |
2271
|
0
|
|
|
|
|
0
|
else { |
2272
|
|
|
|
|
|
|
my $method; |
2273
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
2274
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
2275
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2276
|
|
|
|
|
|
|
} |
2277
|
0
|
|
|
|
|
0
|
else { |
2278
|
|
|
|
|
|
|
$callbacks = $self; |
2279
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2280
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2281
|
0
|
0
|
|
|
|
0
|
} |
2282
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DTDHandler'} and $method = $callbacks->{'DTDHandler'}->can('doctype_decl') ) { |
2283
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
2284
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'doctype_decl'} = sub { $method->($handler, @_) }; |
2285
|
|
|
|
|
|
|
return $method->($handler, @_); |
2286
|
|
|
|
|
|
|
} |
2287
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('doctype_decl') ) { |
2288
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2289
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'doctype_decl'} = sub { $method->($handler, @_) }; |
2290
|
|
|
|
|
|
|
return $method->($handler, @_); |
2291
|
|
|
|
|
|
|
} |
2292
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DTDHandler'} |
2293
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') |
2294
|
|
|
|
|
|
|
and $callbacks->{'DTDHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2295
|
|
|
|
|
|
|
) |
2296
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2297
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DTDHandler'}->doctype_decl(@_) }; |
2298
|
0
|
|
|
|
|
0
|
if ($@) { |
2299
|
|
|
|
|
|
|
die $@; |
2300
|
|
|
|
|
|
|
} |
2301
|
|
|
|
|
|
|
else { |
2302
|
|
|
|
|
|
|
# I think there's a buggette here... |
2303
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2304
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2305
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DTDHandler'}; |
|
0
|
|
|
|
|
0
|
|
2306
|
|
|
|
|
|
|
$self->{Methods}->{'doctype_decl'} = sub { $handler->doctype_decl(@_) }; |
2307
|
0
|
|
|
|
|
0
|
} |
2308
|
|
|
|
|
|
|
return $res; |
2309
|
|
|
|
|
|
|
} |
2310
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2311
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2312
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2313
|
|
|
|
|
|
|
) |
2314
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2315
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->doctype_decl(@_) }; |
2316
|
0
|
|
|
|
|
0
|
if ($@) { |
2317
|
|
|
|
|
|
|
die $@; |
2318
|
|
|
|
|
|
|
} |
2319
|
|
|
|
|
|
|
else { |
2320
|
|
|
|
|
|
|
# I think there's a buggette here... |
2321
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2322
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2323
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2324
|
|
|
|
|
|
|
$self->{Methods}->{'doctype_decl'} = sub { $handler->doctype_decl(@_) }; |
2325
|
0
|
|
|
|
|
0
|
} |
2326
|
|
|
|
|
|
|
return $res; |
2327
|
|
|
|
|
|
|
} |
2328
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2329
|
|
|
|
|
|
|
$self->{Methods}->{'doctype_decl'} = sub { }; |
2330
|
|
|
|
|
|
|
} |
2331
|
|
|
|
|
|
|
} |
2332
|
|
|
|
|
|
|
|
2333
|
|
|
|
|
|
|
} |
2334
|
|
|
|
|
|
|
|
2335
|
0
|
|
|
0
|
1
|
0
|
sub comment { |
2336
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
2337
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'comment'}) { |
2338
|
|
|
|
|
|
|
$self->{Methods}->{'comment'}->(@_); |
2339
|
|
|
|
|
|
|
} |
2340
|
0
|
|
|
|
|
0
|
else { |
2341
|
|
|
|
|
|
|
my $method; |
2342
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
2343
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
2344
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2345
|
|
|
|
|
|
|
} |
2346
|
0
|
|
|
|
|
0
|
else { |
2347
|
|
|
|
|
|
|
$callbacks = $self; |
2348
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2349
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2350
|
0
|
0
|
|
|
|
0
|
} |
2351
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('comment') ) { |
2352
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2353
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'comment'} = sub { $method->($handler, @_) }; |
2354
|
|
|
|
|
|
|
return $method->($handler, @_); |
2355
|
|
|
|
|
|
|
} |
2356
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('comment') ) { |
2357
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
2358
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'comment'} = sub { $method->($handler, @_) }; |
2359
|
|
|
|
|
|
|
return $method->($handler, @_); |
2360
|
|
|
|
|
|
|
} |
2361
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('comment') ) { |
2362
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2363
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'comment'} = sub { $method->($handler, @_) }; |
2364
|
|
|
|
|
|
|
return $method->($handler, @_); |
2365
|
|
|
|
|
|
|
} |
2366
|
|
|
|
|
|
|
elsif (defined $callbacks->{'DocumentHandler'} |
2367
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') |
2368
|
|
|
|
|
|
|
and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2369
|
|
|
|
|
|
|
) |
2370
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2371
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'DocumentHandler'}->comment(@_) }; |
2372
|
0
|
|
|
|
|
0
|
if ($@) { |
2373
|
|
|
|
|
|
|
die $@; |
2374
|
|
|
|
|
|
|
} |
2375
|
|
|
|
|
|
|
else { |
2376
|
|
|
|
|
|
|
# I think there's a buggette here... |
2377
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2378
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2379
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'DocumentHandler'}; |
|
0
|
|
|
|
|
0
|
|
2380
|
|
|
|
|
|
|
$self->{Methods}->{'comment'} = sub { $handler->comment(@_) }; |
2381
|
0
|
|
|
|
|
0
|
} |
2382
|
|
|
|
|
|
|
return $res; |
2383
|
|
|
|
|
|
|
} |
2384
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
2385
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
2386
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2387
|
|
|
|
|
|
|
) |
2388
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2389
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->comment(@_) }; |
2390
|
0
|
|
|
|
|
0
|
if ($@) { |
2391
|
|
|
|
|
|
|
die $@; |
2392
|
|
|
|
|
|
|
} |
2393
|
|
|
|
|
|
|
else { |
2394
|
|
|
|
|
|
|
# I think there's a buggette here... |
2395
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2396
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2397
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
2398
|
|
|
|
|
|
|
$self->{Methods}->{'comment'} = sub { $handler->comment(@_) }; |
2399
|
0
|
|
|
|
|
0
|
} |
2400
|
|
|
|
|
|
|
return $res; |
2401
|
|
|
|
|
|
|
} |
2402
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2403
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2404
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2405
|
|
|
|
|
|
|
) |
2406
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2407
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->comment(@_) }; |
2408
|
0
|
|
|
|
|
0
|
if ($@) { |
2409
|
|
|
|
|
|
|
die $@; |
2410
|
|
|
|
|
|
|
} |
2411
|
|
|
|
|
|
|
else { |
2412
|
|
|
|
|
|
|
# I think there's a buggette here... |
2413
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2414
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2415
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2416
|
|
|
|
|
|
|
$self->{Methods}->{'comment'} = sub { $handler->comment(@_) }; |
2417
|
0
|
|
|
|
|
0
|
} |
2418
|
|
|
|
|
|
|
return $res; |
2419
|
|
|
|
|
|
|
} |
2420
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2421
|
|
|
|
|
|
|
$self->{Methods}->{'comment'} = sub { }; |
2422
|
|
|
|
|
|
|
} |
2423
|
|
|
|
|
|
|
} |
2424
|
|
|
|
|
|
|
|
2425
|
|
|
|
|
|
|
} |
2426
|
|
|
|
|
|
|
|
2427
|
0
|
|
|
0
|
1
|
0
|
sub end_entity { |
2428
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
2429
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'end_entity'}) { |
2430
|
|
|
|
|
|
|
$self->{Methods}->{'end_entity'}->(@_); |
2431
|
|
|
|
|
|
|
} |
2432
|
0
|
|
|
|
|
0
|
else { |
2433
|
|
|
|
|
|
|
my $method; |
2434
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
2435
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
2436
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2437
|
|
|
|
|
|
|
} |
2438
|
0
|
|
|
|
|
0
|
else { |
2439
|
|
|
|
|
|
|
$callbacks = $self; |
2440
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2441
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2442
|
0
|
0
|
|
|
|
0
|
} |
2443
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('end_entity') ) { |
2444
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
2445
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_entity'} = sub { $method->($handler, @_) }; |
2446
|
|
|
|
|
|
|
return $method->($handler, @_); |
2447
|
|
|
|
|
|
|
} |
2448
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_entity') ) { |
2449
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2450
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'end_entity'} = sub { $method->($handler, @_) }; |
2451
|
|
|
|
|
|
|
return $method->($handler, @_); |
2452
|
|
|
|
|
|
|
} |
2453
|
|
|
|
|
|
|
elsif (defined $callbacks->{'LexicalHandler'} |
2454
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') |
2455
|
|
|
|
|
|
|
and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2456
|
|
|
|
|
|
|
) |
2457
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2458
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'LexicalHandler'}->end_entity(@_) }; |
2459
|
0
|
|
|
|
|
0
|
if ($@) { |
2460
|
|
|
|
|
|
|
die $@; |
2461
|
|
|
|
|
|
|
} |
2462
|
|
|
|
|
|
|
else { |
2463
|
|
|
|
|
|
|
# I think there's a buggette here... |
2464
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2465
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2466
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'LexicalHandler'}; |
|
0
|
|
|
|
|
0
|
|
2467
|
|
|
|
|
|
|
$self->{Methods}->{'end_entity'} = sub { $handler->end_entity(@_) }; |
2468
|
0
|
|
|
|
|
0
|
} |
2469
|
|
|
|
|
|
|
return $res; |
2470
|
|
|
|
|
|
|
} |
2471
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2472
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2473
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2474
|
|
|
|
|
|
|
) |
2475
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2476
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->end_entity(@_) }; |
2477
|
0
|
|
|
|
|
0
|
if ($@) { |
2478
|
|
|
|
|
|
|
die $@; |
2479
|
|
|
|
|
|
|
} |
2480
|
|
|
|
|
|
|
else { |
2481
|
|
|
|
|
|
|
# I think there's a buggette here... |
2482
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2483
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2484
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2485
|
|
|
|
|
|
|
$self->{Methods}->{'end_entity'} = sub { $handler->end_entity(@_) }; |
2486
|
0
|
|
|
|
|
0
|
} |
2487
|
|
|
|
|
|
|
return $res; |
2488
|
|
|
|
|
|
|
} |
2489
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2490
|
|
|
|
|
|
|
$self->{Methods}->{'end_entity'} = sub { }; |
2491
|
|
|
|
|
|
|
} |
2492
|
|
|
|
|
|
|
} |
2493
|
|
|
|
|
|
|
|
2494
|
|
|
|
|
|
|
} |
2495
|
|
|
|
|
|
|
|
2496
|
0
|
|
|
0
|
1
|
0
|
sub warning { |
2497
|
0
|
0
|
|
|
|
0
|
my $self = shift; |
2498
|
0
|
|
|
|
|
0
|
if (defined $self->{Methods}->{'warning'}) { |
2499
|
|
|
|
|
|
|
$self->{Methods}->{'warning'}->(@_); |
2500
|
|
|
|
|
|
|
} |
2501
|
0
|
|
|
|
|
0
|
else { |
2502
|
|
|
|
|
|
|
my $method; |
2503
|
0
|
0
|
|
|
|
0
|
my $callbacks; |
2504
|
0
|
|
|
|
|
0
|
if (exists $self->{ParseOptions}) { |
2505
|
|
|
|
|
|
|
$callbacks = $self->{ParseOptions}; |
2506
|
|
|
|
|
|
|
} |
2507
|
0
|
|
|
|
|
0
|
else { |
2508
|
|
|
|
|
|
|
$callbacks = $self; |
2509
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2510
|
|
|
|
|
|
|
if (0) { # dummy to make elsif's below compile |
2511
|
0
|
0
|
|
|
|
0
|
} |
2512
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'ErrorHandler'} and $method = $callbacks->{'ErrorHandler'}->can('warning') ) { |
2513
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ErrorHandler'}; |
|
0
|
|
|
|
|
0
|
|
2514
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'warning'} = sub { $method->($handler, @_) }; |
2515
|
|
|
|
|
|
|
return $method->($handler, @_); |
2516
|
|
|
|
|
|
|
} |
2517
|
0
|
|
|
|
|
0
|
elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('warning') ) { |
2518
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2519
|
0
|
|
|
|
|
0
|
$self->{Methods}->{'warning'} = sub { $method->($handler, @_) }; |
2520
|
|
|
|
|
|
|
return $method->($handler, @_); |
2521
|
|
|
|
|
|
|
} |
2522
|
|
|
|
|
|
|
elsif (defined $callbacks->{'ErrorHandler'} |
2523
|
|
|
|
|
|
|
and $callbacks->{'ErrorHandler'}->can('AUTOLOAD') |
2524
|
|
|
|
|
|
|
and $callbacks->{'ErrorHandler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2525
|
|
|
|
|
|
|
) |
2526
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2527
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'ErrorHandler'}->warning(@_) }; |
2528
|
0
|
|
|
|
|
0
|
if ($@) { |
2529
|
|
|
|
|
|
|
die $@; |
2530
|
|
|
|
|
|
|
} |
2531
|
|
|
|
|
|
|
else { |
2532
|
|
|
|
|
|
|
# I think there's a buggette here... |
2533
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2534
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2535
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'ErrorHandler'}; |
|
0
|
|
|
|
|
0
|
|
2536
|
|
|
|
|
|
|
$self->{Methods}->{'warning'} = sub { $handler->warning(@_) }; |
2537
|
0
|
|
|
|
|
0
|
} |
2538
|
|
|
|
|
|
|
return $res; |
2539
|
|
|
|
|
|
|
} |
2540
|
|
|
|
|
|
|
elsif (defined $callbacks->{'Handler'} |
2541
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') |
2542
|
|
|
|
|
|
|
and $callbacks->{'Handler'}->can('AUTOLOAD') ne (UNIVERSAL->can('AUTOLOAD') || '') |
2543
|
|
|
|
|
|
|
) |
2544
|
0
|
|
|
|
|
0
|
{ |
|
0
|
|
|
|
|
0
|
|
2545
|
0
|
0
|
|
|
|
0
|
my $res = eval { $callbacks->{'Handler'}->warning(@_) }; |
2546
|
0
|
|
|
|
|
0
|
if ($@) { |
2547
|
|
|
|
|
|
|
die $@; |
2548
|
|
|
|
|
|
|
} |
2549
|
|
|
|
|
|
|
else { |
2550
|
|
|
|
|
|
|
# I think there's a buggette here... |
2551
|
|
|
|
|
|
|
# if the first call throws an exception, we don't set it up right. |
2552
|
0
|
|
|
|
|
0
|
# Not fatal, but we might want to address it. |
2553
|
0
|
|
|
0
|
|
0
|
my $handler = $callbacks->{'Handler'}; |
|
0
|
|
|
|
|
0
|
|
2554
|
|
|
|
|
|
|
$self->{Methods}->{'warning'} = sub { $handler->warning(@_) }; |
2555
|
0
|
|
|
|
|
0
|
} |
2556
|
|
|
|
|
|
|
return $res; |
2557
|
|
|
|
|
|
|
} |
2558
|
0
|
|
|
0
|
|
0
|
else { |
|
0
|
|
|
|
|
0
|
|
2559
|
|
|
|
|
|
|
$self->{Methods}->{'warning'} = sub { }; |
2560
|
|
|
|
|
|
|
} |
2561
|
|
|
|
|
|
|
} |
2562
|
|
|
|
|
|
|
|
2563
|
|
|
|
|
|
|
} |
2564
|
|
|
|
|
|
|
|
2565
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2566
|
|
|
|
|
|
|
# Class->new(%options) |
2567
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2568
|
1
|
|
|
1
|
0
|
4
|
sub new { |
2569
|
1
|
|
33
|
|
|
9
|
my $proto = shift; |
2570
|
1
|
50
|
|
|
|
18
|
my $class = ref($proto) || $proto; |
2571
|
|
|
|
|
|
|
my $options = ($#_ == 0) ? shift : { @_ }; |
2572
|
1
|
0
|
33
|
|
|
6
|
|
|
|
|
33
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2573
|
|
|
|
|
|
|
unless ( defined( $options->{Handler} ) or |
2574
|
|
|
|
|
|
|
defined( $options->{ContentHandler} ) or |
2575
|
|
|
|
|
|
|
defined( $options->{DTDHandler} ) or |
2576
|
|
|
|
|
|
|
defined( $options->{DocumentHandler} ) or |
2577
|
|
|
|
|
|
|
defined( $options->{LexicalHandler} ) or |
2578
|
|
|
|
|
|
|
defined( $options->{ErrorHandler} ) or |
2579
|
|
|
|
|
|
|
defined( $options->{DeclHandler} ) ) { |
2580
|
0
|
|
|
|
|
0
|
|
2581
|
|
|
|
|
|
|
$options->{Handler} = XML::SAX::Base::NoHandler->new; |
2582
|
|
|
|
|
|
|
} |
2583
|
1
|
|
|
|
|
4
|
|
2584
|
|
|
|
|
|
|
my $self = bless $options, $class; |
2585
|
1
|
|
|
|
|
8
|
# turn NS processing on by default |
2586
|
1
|
|
|
|
|
14
|
$self->set_feature('http://xml.org/sax/features/namespaces', 1); |
2587
|
|
|
|
|
|
|
return $self; |
2588
|
|
|
|
|
|
|
} |
2589
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2590
|
|
|
|
|
|
|
|
2591
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2592
|
|
|
|
|
|
|
# $p->parse(%options) |
2593
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2594
|
1
|
|
|
1
|
1
|
3
|
sub parse { |
2595
|
1
|
|
|
|
|
5
|
my $self = shift; |
2596
|
1
|
|
|
|
|
3
|
my $parse_options = $self->get_options(@_); |
2597
|
1
|
50
|
|
|
|
4
|
local $self->{ParseOptions} = $parse_options; |
2598
|
0
|
|
|
|
|
0
|
if ($self->{Parent}) { # calling parse on a filter for some reason |
2599
|
|
|
|
|
|
|
return $self->{Parent}->parse($parse_options); |
2600
|
|
|
|
|
|
|
} |
2601
|
1
|
|
|
|
|
2
|
else { |
2602
|
1
|
50
|
33
|
|
|
21
|
my $method; |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
0
|
0
|
|
|
|
|
2603
|
0
|
|
|
|
|
0
|
if (defined $parse_options->{Source}{CharacterStream} and $method = $self->can('_parse_characterstream')) { |
2604
|
0
|
|
|
|
|
0
|
warn("parse charstream???\n"); |
2605
|
|
|
|
|
|
|
return $method->($self, $parse_options->{Source}{CharacterStream}); |
2606
|
|
|
|
|
|
|
} |
2607
|
0
|
|
|
|
|
0
|
elsif (defined $parse_options->{Source}{ByteStream} and $method = $self->can('_parse_bytestream')) { |
2608
|
|
|
|
|
|
|
return $method->($self, $parse_options->{Source}{ByteStream}); |
2609
|
|
|
|
|
|
|
} |
2610
|
1
|
|
|
|
|
5
|
elsif (defined $parse_options->{Source}{String} and $method = $self->can('_parse_string')) { |
2611
|
|
|
|
|
|
|
return $method->($self, $parse_options->{Source}{String}); |
2612
|
|
|
|
|
|
|
} |
2613
|
0
|
|
|
|
|
0
|
elsif (defined $parse_options->{Source}{SystemId} and $method = $self->can('_parse_systemid')) { |
2614
|
|
|
|
|
|
|
return $method->($self, $parse_options->{Source}{SystemId}); |
2615
|
|
|
|
|
|
|
} |
2616
|
0
|
|
|
|
|
0
|
else { |
2617
|
|
|
|
|
|
|
die "No _parse_* routine defined on this driver (If it is a filter, remember to set the Parent property. If you call the parse() method, make sure to set a Source. You may want to call parse_uri, parse_string or parse_file instead.) [$self]"; |
2618
|
|
|
|
|
|
|
} |
2619
|
|
|
|
|
|
|
} |
2620
|
|
|
|
|
|
|
} |
2621
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2622
|
|
|
|
|
|
|
|
2623
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2624
|
|
|
|
|
|
|
# $p->parse_file(%options) |
2625
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2626
|
0
|
|
|
0
|
1
|
0
|
sub parse_file { |
2627
|
0
|
|
|
|
|
0
|
my $self = shift; |
2628
|
0
|
0
|
|
|
|
0
|
my $file = shift; |
2629
|
0
|
|
|
|
|
0
|
return $self->parse_uri($file, @_) if ref(\$file) eq 'SCALAR'; |
2630
|
0
|
|
|
|
|
0
|
my $parse_options = $self->get_options(@_); |
2631
|
0
|
|
|
|
|
0
|
$parse_options->{Source}{ByteStream} = $file; |
2632
|
|
|
|
|
|
|
return $self->parse($parse_options); |
2633
|
|
|
|
|
|
|
} |
2634
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2635
|
|
|
|
|
|
|
|
2636
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2637
|
|
|
|
|
|
|
# $p->parse_uri(%options) |
2638
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2639
|
0
|
|
|
0
|
1
|
0
|
sub parse_uri { |
2640
|
0
|
|
|
|
|
0
|
my $self = shift; |
2641
|
0
|
|
|
|
|
0
|
my $file = shift; |
2642
|
0
|
|
|
|
|
0
|
my $parse_options = $self->get_options(@_); |
2643
|
0
|
|
|
|
|
0
|
$parse_options->{Source}{SystemId} = $file; |
2644
|
|
|
|
|
|
|
return $self->parse($parse_options); |
2645
|
|
|
|
|
|
|
} |
2646
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2647
|
|
|
|
|
|
|
|
2648
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2649
|
|
|
|
|
|
|
# $p->parse_string(%options) |
2650
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2651
|
1
|
|
|
1
|
1
|
10
|
sub parse_string { |
2652
|
1
|
|
|
|
|
4
|
my $self = shift; |
2653
|
1
|
|
|
|
|
7
|
my $string = shift; |
2654
|
1
|
|
|
|
|
3
|
my $parse_options = $self->get_options(@_); |
2655
|
1
|
|
|
|
|
6
|
$parse_options->{Source}{String} = $string; |
2656
|
|
|
|
|
|
|
return $self->parse($parse_options); |
2657
|
|
|
|
|
|
|
} |
2658
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2659
|
|
|
|
|
|
|
|
2660
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2661
|
|
|
|
|
|
|
# get_options |
2662
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2663
|
2
|
|
|
2
|
1
|
3
|
sub get_options { |
2664
|
|
|
|
|
|
|
my $self = shift; |
2665
|
2
|
100
|
|
|
|
6
|
|
2666
|
1
|
|
|
|
|
2
|
if (@_ == 1) { |
|
1
|
|
|
|
|
6
|
|
2667
|
|
|
|
|
|
|
return { %$self, %{$_[0]} }; |
2668
|
1
|
|
|
|
|
6
|
} else { |
2669
|
|
|
|
|
|
|
return { %$self, @_ }; |
2670
|
|
|
|
|
|
|
} |
2671
|
|
|
|
|
|
|
} |
2672
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2673
|
|
|
|
|
|
|
|
2674
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2675
|
|
|
|
|
|
|
# get_features |
2676
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2677
|
|
|
|
|
|
|
sub get_features { |
2678
|
15
|
|
|
15
|
0
|
176
|
return ( |
2679
|
|
|
|
|
|
|
'http://xml.org/sax/features/external-general-entities' => undef, |
2680
|
|
|
|
|
|
|
'http://xml.org/sax/features/external-parameter-entities' => undef, |
2681
|
|
|
|
|
|
|
'http://xml.org/sax/features/is-standalone' => undef, |
2682
|
|
|
|
|
|
|
'http://xml.org/sax/features/lexical-handler' => undef, |
2683
|
|
|
|
|
|
|
'http://xml.org/sax/features/parameter-entities' => undef, |
2684
|
|
|
|
|
|
|
'http://xml.org/sax/features/namespaces' => 1, |
2685
|
|
|
|
|
|
|
'http://xml.org/sax/features/namespace-prefixes' => 0, |
2686
|
|
|
|
|
|
|
'http://xml.org/sax/features/string-interning' => undef, |
2687
|
|
|
|
|
|
|
'http://xml.org/sax/features/use-attributes2' => undef, |
2688
|
|
|
|
|
|
|
'http://xml.org/sax/features/use-locator2' => undef, |
2689
|
|
|
|
|
|
|
'http://xml.org/sax/features/validation' => undef, |
2690
|
|
|
|
|
|
|
|
2691
|
|
|
|
|
|
|
'http://xml.org/sax/properties/dom-node' => undef, |
2692
|
|
|
|
|
|
|
'http://xml.org/sax/properties/xml-string' => undef, |
2693
|
|
|
|
|
|
|
); |
2694
|
|
|
|
|
|
|
} |
2695
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2696
|
|
|
|
|
|
|
|
2697
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2698
|
|
|
|
|
|
|
# get_feature |
2699
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2700
|
14
|
|
|
14
|
1
|
1269
|
sub get_feature { |
2701
|
14
|
|
|
|
|
1110
|
my $self = shift; |
2702
|
|
|
|
|
|
|
my $feat = shift; |
2703
|
|
|
|
|
|
|
|
2704
|
|
|
|
|
|
|
# check %FEATURES to see if it's there, and return it if so |
2705
|
|
|
|
|
|
|
# throw XML::SAX::Exception::NotRecognized if it's not there |
2706
|
|
|
|
|
|
|
# throw XML::SAX::Exception::NotSupported if it's there but we |
2707
|
|
|
|
|
|
|
# don't support it |
2708
|
14
|
|
|
|
|
31
|
|
2709
|
14
|
50
|
|
|
|
57
|
my %features = $self->get_features(); |
2710
|
14
|
|
|
|
|
32
|
if (exists $features{$feat}) { |
|
14
|
|
|
|
|
62
|
|
2711
|
14
|
50
|
|
|
|
48
|
my %supported = map { $_ => 1 } $self->supported_features(); |
2712
|
14
|
|
|
|
|
145
|
if ($supported{$feat}) { |
2713
|
|
|
|
|
|
|
return $self->{__PACKAGE__ . "::Features"}{$feat}; |
2714
|
|
|
|
|
|
|
} |
2715
|
0
|
|
|
|
|
0
|
throw XML::SAX::Exception::NotSupported( |
2716
|
|
|
|
|
|
|
Message => "The feature '$feat' is not supported by " . ref($self), |
2717
|
|
|
|
|
|
|
Exception => undef, |
2718
|
|
|
|
|
|
|
); |
2719
|
|
|
|
|
|
|
} |
2720
|
0
|
|
|
|
|
0
|
throw XML::SAX::Exception::NotRecognized( |
2721
|
|
|
|
|
|
|
Message => "The feature '$feat' is not recognized by " . ref($self), |
2722
|
|
|
|
|
|
|
Exception => undef, |
2723
|
|
|
|
|
|
|
); |
2724
|
|
|
|
|
|
|
} |
2725
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2726
|
|
|
|
|
|
|
|
2727
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2728
|
|
|
|
|
|
|
# set_feature |
2729
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2730
|
1
|
|
|
1
|
1
|
3
|
sub set_feature { |
2731
|
1
|
|
|
|
|
2
|
my $self = shift; |
2732
|
1
|
|
|
|
|
2
|
my $feat = shift; |
2733
|
|
|
|
|
|
|
my $value = shift; |
2734
|
|
|
|
|
|
|
# check %FEATURES to see if it's there, and set it if so |
2735
|
|
|
|
|
|
|
# throw XML::SAX::Exception::NotRecognized if it's not there |
2736
|
|
|
|
|
|
|
# throw XML::SAX::Exception::NotSupported if it's there but we |
2737
|
|
|
|
|
|
|
# don't support it |
2738
|
1
|
|
|
|
|
9
|
|
2739
|
1
|
50
|
|
|
|
5
|
my %features = $self->get_features(); |
2740
|
1
|
|
|
|
|
19
|
if (exists $features{$feat}) { |
|
1
|
|
|
|
|
4
|
|
2741
|
1
|
50
|
|
|
|
5
|
my %supported = map { $_ => 1 } $self->supported_features(); |
2742
|
1
|
|
|
|
|
11
|
if ($supported{$feat}) { |
2743
|
|
|
|
|
|
|
return $self->{__PACKAGE__ . "::Features"}{$feat} = $value; |
2744
|
|
|
|
|
|
|
} |
2745
|
0
|
|
|
|
|
0
|
throw XML::SAX::Exception::NotSupported( |
2746
|
|
|
|
|
|
|
Message => "The feature '$feat' is not supported by " . ref($self), |
2747
|
|
|
|
|
|
|
Exception => undef, |
2748
|
|
|
|
|
|
|
); |
2749
|
|
|
|
|
|
|
} |
2750
|
0
|
|
|
|
|
0
|
throw XML::SAX::Exception::NotRecognized( |
2751
|
|
|
|
|
|
|
Message => "The feature '$feat' is not recognized by " . ref($self), |
2752
|
|
|
|
|
|
|
Exception => undef, |
2753
|
|
|
|
|
|
|
); |
2754
|
|
|
|
|
|
|
} |
2755
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2756
|
|
|
|
|
|
|
|
2757
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2758
|
|
|
|
|
|
|
# get_handler and friends |
2759
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2760
|
0
|
|
|
0
|
1
|
0
|
sub get_handler { |
2761
|
0
|
|
|
|
|
0
|
my $self = shift; |
2762
|
0
|
|
0
|
|
|
0
|
my $handler_type = shift; |
2763
|
0
|
0
|
|
|
|
0
|
$handler_type ||= 'Handler'; |
2764
|
|
|
|
|
|
|
return defined( $self->{$handler_type} ) ? $self->{$handler_type} : undef; |
2765
|
|
|
|
|
|
|
} |
2766
|
|
|
|
|
|
|
|
2767
|
0
|
|
|
0
|
1
|
0
|
sub get_document_handler { |
2768
|
0
|
|
|
|
|
0
|
my $self = shift; |
2769
|
|
|
|
|
|
|
return $self->get_handler('DocumentHandler', @_); |
2770
|
|
|
|
|
|
|
} |
2771
|
|
|
|
|
|
|
|
2772
|
0
|
|
|
0
|
1
|
0
|
sub get_content_handler { |
2773
|
0
|
|
|
|
|
0
|
my $self = shift; |
2774
|
|
|
|
|
|
|
return $self->get_handler('ContentHandler', @_); |
2775
|
|
|
|
|
|
|
} |
2776
|
|
|
|
|
|
|
|
2777
|
0
|
|
|
0
|
1
|
0
|
sub get_dtd_handler { |
2778
|
0
|
|
|
|
|
0
|
my $self = shift; |
2779
|
|
|
|
|
|
|
return $self->get_handler('DTDHandler', @_); |
2780
|
|
|
|
|
|
|
} |
2781
|
|
|
|
|
|
|
|
2782
|
0
|
|
|
0
|
1
|
0
|
sub get_lexical_handler { |
2783
|
0
|
|
|
|
|
0
|
my $self = shift; |
2784
|
|
|
|
|
|
|
return $self->get_handler('LexicalHandler', @_); |
2785
|
|
|
|
|
|
|
} |
2786
|
|
|
|
|
|
|
|
2787
|
0
|
|
|
0
|
1
|
0
|
sub get_decl_handler { |
2788
|
0
|
|
|
|
|
0
|
my $self = shift; |
2789
|
|
|
|
|
|
|
return $self->get_handler('DeclHandler', @_); |
2790
|
|
|
|
|
|
|
} |
2791
|
|
|
|
|
|
|
|
2792
|
0
|
|
|
0
|
1
|
0
|
sub get_error_handler { |
2793
|
0
|
|
|
|
|
0
|
my $self = shift; |
2794
|
|
|
|
|
|
|
return $self->get_handler('ErrorHandler', @_); |
2795
|
|
|
|
|
|
|
} |
2796
|
|
|
|
|
|
|
|
2797
|
0
|
|
|
0
|
1
|
0
|
sub get_entity_resolver { |
2798
|
0
|
|
|
|
|
0
|
my $self = shift; |
2799
|
|
|
|
|
|
|
return $self->get_handler('EntityResolver', @_); |
2800
|
|
|
|
|
|
|
} |
2801
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2802
|
|
|
|
|
|
|
|
2803
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2804
|
|
|
|
|
|
|
# set_handler and friends |
2805
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2806
|
0
|
|
|
0
|
1
|
0
|
sub set_handler { |
2807
|
0
|
|
|
|
|
0
|
my $self = shift; |
2808
|
0
|
|
0
|
|
|
0
|
my ($new_handler, $handler_type) = reverse @_; |
2809
|
0
|
0
|
|
|
|
0
|
$handler_type ||= 'Handler'; |
2810
|
0
|
|
|
|
|
0
|
$self->{Methods} = {} if $self->{Methods}; |
2811
|
0
|
|
|
|
|
0
|
$self->{$handler_type} = $new_handler; |
2812
|
0
|
|
|
|
|
0
|
$self->{ParseOptions}->{$handler_type} = $new_handler; |
2813
|
|
|
|
|
|
|
return 1; |
2814
|
|
|
|
|
|
|
} |
2815
|
|
|
|
|
|
|
|
2816
|
0
|
|
|
0
|
1
|
0
|
sub set_document_handler { |
2817
|
0
|
|
|
|
|
0
|
my $self = shift; |
2818
|
|
|
|
|
|
|
return $self->set_handler('DocumentHandler', @_); |
2819
|
|
|
|
|
|
|
} |
2820
|
|
|
|
|
|
|
|
2821
|
0
|
|
|
0
|
1
|
0
|
sub set_content_handler { |
2822
|
0
|
|
|
|
|
0
|
my $self = shift; |
2823
|
|
|
|
|
|
|
return $self->set_handler('ContentHandler', @_); |
2824
|
|
|
|
|
|
|
} |
2825
|
0
|
|
|
0
|
1
|
0
|
sub set_dtd_handler { |
2826
|
0
|
|
|
|
|
0
|
my $self = shift; |
2827
|
|
|
|
|
|
|
return $self->set_handler('DTDHandler', @_); |
2828
|
|
|
|
|
|
|
} |
2829
|
0
|
|
|
0
|
1
|
0
|
sub set_lexical_handler { |
2830
|
0
|
|
|
|
|
0
|
my $self = shift; |
2831
|
|
|
|
|
|
|
return $self->set_handler('LexicalHandler', @_); |
2832
|
|
|
|
|
|
|
} |
2833
|
0
|
|
|
0
|
1
|
0
|
sub set_decl_handler { |
2834
|
0
|
|
|
|
|
0
|
my $self = shift; |
2835
|
|
|
|
|
|
|
return $self->set_handler('DeclHandler', @_); |
2836
|
|
|
|
|
|
|
} |
2837
|
0
|
|
|
0
|
1
|
0
|
sub set_error_handler { |
2838
|
0
|
|
|
|
|
0
|
my $self = shift; |
2839
|
|
|
|
|
|
|
return $self->set_handler('ErrorHandler', @_); |
2840
|
|
|
|
|
|
|
} |
2841
|
0
|
|
|
0
|
1
|
0
|
sub set_entity_resolver { |
2842
|
0
|
|
|
|
|
0
|
my $self = shift; |
2843
|
|
|
|
|
|
|
return $self->set_handler('EntityResolver', @_); |
2844
|
|
|
|
|
|
|
} |
2845
|
|
|
|
|
|
|
|
2846
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2847
|
|
|
|
|
|
|
|
2848
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2849
|
|
|
|
|
|
|
# supported_features |
2850
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2851
|
15
|
|
|
15
|
0
|
20
|
sub supported_features { |
2852
|
|
|
|
|
|
|
my $self = shift; |
2853
|
|
|
|
|
|
|
# Only namespaces are required by all parsers |
2854
|
15
|
|
|
|
|
3992
|
return ( |
2855
|
|
|
|
|
|
|
'http://xml.org/sax/features/namespaces', |
2856
|
|
|
|
|
|
|
); |
2857
|
|
|
|
|
|
|
} |
2858
|
|
|
|
|
|
|
#-------------------------------------------------------------------# |
2859
|
0
|
|
|
0
|
0
|
|
|
2860
|
|
|
|
|
|
|
sub no_op { |
2861
|
|
|
|
|
|
|
# this space intentionally blank |
2862
|
|
|
|
|
|
|
} |
2863
|
|
|
|
|
|
|
|
2864
|
|
|
|
|
|
|
|
2865
|
|
|
|
|
|
|
package XML::SAX::Base::NoHandler; |
2866
|
|
|
|
|
|
|
|
2867
|
|
|
|
|
|
|
# we need a fake handler that doesn't implement anything, this |
2868
|
|
|
|
|
|
|
# simplifies the code a lot (though given the recent changes, |
2869
|
|
|
|
|
|
|
# it may be better to do without) |
2870
|
|
|
|
|
|
|
sub new { |
2871
|
0
|
|
|
0
|
|
|
#warn "no handler called\n"; |
2872
|
|
|
|
|
|
|
return bless {}; |
2873
|
|
|
|
|
|
|
} |
2874
|
|
|
|
|
|
|
|
2875
|
|
|
|
|
|
|
1; |
2876
|
|
|
|
|
|
|
|
2877
|
|
|
|
|
|
|
__END__ |