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