← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:47 2015

Filename/usr/share/perl5/XML/SAX/Expat.pm
StatementsExecuted 4416 statements in 10.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.98ms3.46msXML::SAX::Expat::::BEGIN@10XML::SAX::Expat::BEGIN@10
1112.00ms7.69msXML::SAX::Expat::::BEGIN@11XML::SAX::Expat::BEGIN@11
142111.84ms4.64msXML::SAX::Expat::::_handle_startXML::SAX::Expat::_handle_start
478111.14ms3.91msXML::SAX::Expat::::_handle_charXML::SAX::Expat::_handle_char
142111.10ms2.02msXML::SAX::Expat::::_handle_endXML::SAX::Expat::_handle_end
4611123µs281µsXML::SAX::Expat::::_handle_commentXML::SAX::Expat::_handle_comment
21154µs236µsXML::SAX::Expat::::_create_parserXML::SAX::Expat::_create_parser
21130µs16.5msXML::SAX::Expat::::_parse_systemidXML::SAX::Expat::_parse_systemid
62121µs27µsXML::SAX::Expat::::supported_featuresXML::SAX::Expat::supported_features
81119µs19µsXML::SAX::Expat::::CORE:matchXML::SAX::Expat::CORE:match (opcode)
21112µs69µsXML::SAX::Expat::::_handle_start_documentXML::SAX::Expat::_handle_start_document
11112µs22µsXML::SAX::Expat::::BEGIN@8XML::SAX::Expat::BEGIN@8
21111µs52µsXML::SAX::Expat::::_handle_finalXML::SAX::Expat::_handle_final
1118µs13.0msXML::SAX::Expat::::BEGIN@9XML::SAX::Expat::BEGIN@9
1118µs25µsXML::SAX::Expat::::BEGIN@13XML::SAX::Expat::BEGIN@13
2114µs4µsXML::SAX::Expat::::_cleanupXML::SAX::Expat::_cleanup
2113µs3µsXML::SAX::Expat::::_handle_initXML::SAX::Expat::_handle_init
0000s0sXML::SAX::Expat::::_handle_attr_declXML::SAX::Expat::_handle_attr_decl
0000s0sXML::SAX::Expat::::_handle_element_declXML::SAX::Expat::_handle_element_decl
0000s0sXML::SAX::Expat::::_handle_end_cdataXML::SAX::Expat::_handle_end_cdata
0000s0sXML::SAX::Expat::::_handle_end_doctypeXML::SAX::Expat::_handle_end_doctype
0000s0sXML::SAX::Expat::::_handle_entity_declXML::SAX::Expat::_handle_entity_decl
0000s0sXML::SAX::Expat::::_handle_notation_declXML::SAX::Expat::_handle_notation_decl
0000s0sXML::SAX::Expat::::_handle_procXML::SAX::Expat::_handle_proc
0000s0sXML::SAX::Expat::::_handle_start_cdataXML::SAX::Expat::_handle_start_cdata
0000s0sXML::SAX::Expat::::_handle_start_doctypeXML::SAX::Expat::_handle_start_doctype
0000s0sXML::SAX::Expat::::_handle_unparsed_entityXML::SAX::Expat::_handle_unparsed_entity
0000s0sXML::SAX::Expat::::_handle_xml_declXML::SAX::Expat::_handle_xml_decl
0000s0sXML::SAX::Expat::::_parse_bytestreamXML::SAX::Expat::_parse_bytestream
0000s0sXML::SAX::Expat::::_parse_characterstreamXML::SAX::Expat::_parse_characterstream
0000s0sXML::SAX::Expat::::_parse_stringXML::SAX::Expat::_parse_string
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2###
3# XML::SAX::Expat - SAX2 Driver for Expat (XML::Parser)
4# Originally by Robin Berjon
5###
6
7package XML::SAX::Expat;
8231µs233µs
# spent 22µs (12+11) within XML::SAX::Expat::BEGIN@8 which was called: # once (12µs+11µs) by XML::SAX::ParserFactory::parser at line 8
use strict;
# spent 22µs making 1 call to XML::SAX::Expat::BEGIN@8 # spent 11µs making 1 call to strict::import
9244µs226.0ms
# spent 13.0ms (8µs+13.0) within XML::SAX::Expat::BEGIN@9 which was called: # once (8µs+13.0ms) by XML::SAX::ParserFactory::parser at line 9
use base qw(XML::SAX::Base);
# spent 13.0ms making 1 call to XML::SAX::Expat::BEGIN@9 # spent 13.0ms making 1 call to base::import
1021.45ms13.46ms
# spent 3.46ms (2.98+483µs) within XML::SAX::Expat::BEGIN@10 which was called: # once (2.98ms+483µs) by XML::SAX::ParserFactory::parser at line 10
use XML::NamespaceSupport qw();
# spent 3.46ms making 1 call to XML::SAX::Expat::BEGIN@10
112845µs17.69ms
# spent 7.69ms (2.00+5.69) within XML::SAX::Expat::BEGIN@11 which was called: # once (2.00ms+5.69ms) by XML::SAX::ParserFactory::parser at line 11
use XML::Parser qw();
# spent 7.69ms making 1 call to XML::SAX::Expat::BEGIN@11
12
1321.35ms242µs
# spent 25µs (8+17) within XML::SAX::Expat::BEGIN@13 which was called: # once (8µs+17µs) by XML::SAX::ParserFactory::parser at line 13
use vars qw($VERSION);
# spent 25µs making 1 call to XML::SAX::Expat::BEGIN@13 # spent 17µs making 1 call to vars::import
141400ns$VERSION = '0.40';
15
16
17#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#
18#`,`, Variations on parse `,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,#
19#```````````````````````````````````````````````````````````````````#
20
21#-------------------------------------------------------------------#
22# CharacterStream
23#-------------------------------------------------------------------#
24sub _parse_characterstream {
25 my $p = shift;
26 my $xml = shift;
27 my $opt = shift;
28
29 my $expat = $p->_create_parser($opt);
30 my $result = $expat->parse($xml);
31 $p->_cleanup;
32 return $result;
33}
34#-------------------------------------------------------------------#
35
36#-------------------------------------------------------------------#
37# ByteStream
38#-------------------------------------------------------------------#
39sub _parse_bytestream {
40 my $p = shift;
41 my $xml = shift;
42 my $opt = shift;
43
44 my $expat = $p->_create_parser($opt);
45 my $result = $expat->parse($xml);
46 $p->_cleanup;
47 return $result;
48}
49#-------------------------------------------------------------------#
50
51#-------------------------------------------------------------------#
52# String
53#-------------------------------------------------------------------#
54sub _parse_string {
55 my $p = shift;
56 my $xml = shift;
57 my $opt = shift;
58
59 my $expat = $p->_create_parser($opt);
60 my $result = $expat->parse($xml);
61 $p->_cleanup;
62 return $result;
63}
64#-------------------------------------------------------------------#
65
66#-------------------------------------------------------------------#
67# SystemId
68#-------------------------------------------------------------------#
69
# spent 16.5ms (30µs+16.5) within XML::SAX::Expat::_parse_systemid which was called 2 times, avg 8.27ms/call: # 2 times (30µs+16.5ms) by XML::SAX::Base::parse at line 2608 of XML/SAX/Base.pm, avg 8.27ms/call
sub _parse_systemid {
702600ns my $p = shift;
712700ns my $xml = shift;
722300ns my $opt = shift;
73
7423µs2236µs my $expat = $p->_create_parser($opt);
# spent 236µs making 2 calls to XML::SAX::Expat::_create_parser, avg 118µs/call
7524µs216.3ms my $result = $expat->parsefile($xml);
# spent 16.3ms making 2 calls to XML::Parser::parsefile, avg 8.14ms/call
7623µs24µs $p->_cleanup;
# spent 4µs making 2 calls to XML::SAX::Expat::_cleanup, avg 2µs/call
77214µs return $result;
78}
79#-------------------------------------------------------------------#
80
81
82#-------------------------------------------------------------------#
83# $p->_create_parser(\%options)
84#-------------------------------------------------------------------#
85
# spent 236µs (54+182) within XML::SAX::Expat::_create_parser which was called 2 times, avg 118µs/call: # 2 times (54µs+182µs) by XML::SAX::Expat::_parse_systemid at line 74, avg 118µs/call
sub _create_parser {
862300ns my $self = shift;
872400ns my $opt = shift;
88
892600ns die "ParserReference: parser instance ($self) already parsing\n"
90 if $self->{_InParse};
91
922400ns my $featUri = 'http://xml.org/sax/features/';
9328µs468µs my $ppe = ($self->get_feature($featUri . 'external-general-entities') or
# spent 68µs making 4 calls to XML::SAX::Base::get_feature, avg 17µs/call
94 $self->get_feature($featUri . 'external-parameter-entities') ) ? 1 : 0;
95
9626µs240µs my $expat = XML::Parser->new( ParseParamEnt => $ppe );
# spent 40µs making 2 calls to XML::Parser::new, avg 20µs/call
9723µs $expat->{__XSE} = $self;
9829µs258µs $expat->setHandlers(
# spent 58µs making 2 calls to XML::Parser::setHandlers, avg 29µs/call
99 Init => \&_handle_init,
100 Final => \&_handle_final,
101 Start => \&_handle_start,
102 End => \&_handle_end,
103 Char => \&_handle_char,
104 Comment => \&_handle_comment,
105 Proc => \&_handle_proc,
106 CdataStart => \&_handle_start_cdata,
107 CdataEnd => \&_handle_end_cdata,
108 Unparsed => \&_handle_unparsed_entity,
109 Notation => \&_handle_notation_decl,
110 #ExternEnt
111 #ExternEntFin
112 Entity => \&_handle_entity_decl,
113 Element => \&_handle_element_decl,
114 Attlist => \&_handle_attr_decl,
115 Doctype => \&_handle_start_doctype,
116 DoctypeFin => \&_handle_end_doctype,
117 XMLDecl => \&_handle_xml_decl,
118 );
119
1202800ns $self->{_InParse} = 1;
12121µs $self->{_NodeStack} = [];
12221µs $self->{_NSStack} = [];
12329µs216µs $self->{_NSHelper} = XML::NamespaceSupport->new({xmlns => 1});
# spent 16µs making 2 calls to XML::NamespaceSupport::new, avg 8µs/call
12422µs $self->{_started} = 0;
125
12625µs return $expat;
127}
128#-------------------------------------------------------------------#
129
130
131#-------------------------------------------------------------------#
132# $p->_cleanup
133#-------------------------------------------------------------------#
134
# spent 4µs within XML::SAX::Expat::_cleanup which was called 2 times, avg 2µs/call: # 2 times (4µs+0s) by XML::SAX::Expat::_parse_systemid at line 76, avg 2µs/call
sub _cleanup {
1352500ns my $self = shift;
136
13721µs $self->{_InParse} = 0;
13825µs delete $self->{_NodeStack};
139}
140#-------------------------------------------------------------------#
141
142
143
144#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#
145#`,`, Expat Handlers ,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,#
146#```````````````````````````````````````````````````````````````````#
147
148#-------------------------------------------------------------------#
149# _handle_init
150#-------------------------------------------------------------------#
15126µs
# spent 3µs within XML::SAX::Expat::_handle_init which was called 2 times, avg 1µs/call: # 2 times (3µs+0s) by XML::Parser::parse at line 181 of XML/Parser.pm, avg 1µs/call
sub _handle_init {
152 #my $self = shift()->{__XSE};
153
154 #my $document = {};
155 #push @{$self->{_NodeStack}}, $document;
156 #$self->SUPER::start_document($document);
157}
158#-------------------------------------------------------------------#
159
160#-------------------------------------------------------------------#
161# _handle_final
162#-------------------------------------------------------------------#
163
# spent 52µs (11+42) within XML::SAX::Expat::_handle_final which was called 2 times, avg 26µs/call: # 2 times (11µs+42µs) by XML::Parser::parse at line 200 of XML/Parser.pm, avg 26µs/call
sub _handle_final {
1642900ns my $self = shift()->{__XSE};
165
166 #my $document = pop @{$self->{_NodeStack}};
167211µs242µs return $self->SUPER::end_document({});
# spent 42µs making 2 calls to XML::SAX::Base::end_document, avg 21µs/call
168}
169#-------------------------------------------------------------------#
170
171#-------------------------------------------------------------------#
172# _handle_start
173#-------------------------------------------------------------------#
174
# spent 4.64ms (1.84+2.80) within XML::SAX::Expat::_handle_start which was called 142 times, avg 33µs/call: # 142 times (1.84ms+2.80ms) by XML::Parser::Expat::ParseStream at line 470 of XML/Parser/Expat.pm, avg 33µs/call
sub _handle_start {
17514243µs my $self = shift()->{__XSE};
17614220µs my $e_name = shift;
17714279µs my %attr = @_;
178
179 # start_document data
18014227µs269µs $self->_handle_start_document({}) unless $self->{_started};
# spent 69µs making 2 calls to XML::SAX::Expat::_handle_start_document, avg 34µs/call
181
182 # take care of namespaces
18314219µs my $nsh = $self->{_NSHelper};
184142123µs142335µs $nsh->push_context;
# spent 335µs making 142 calls to XML::NamespaceSupport::push_context, avg 2µs/call
18514214µs my @new_ns;
186142176µs for my $k (grep !index($_, 'xmlns'), keys %attr) {
187832µs819µs $k =~ m/^xmlns(:(.*))?$/;
# spent 19µs making 8 calls to XML::SAX::Expat::CORE:match, avg 2µs/call
18889µs my $prefix = $2 || '';
189812µs849µs $nsh->declare_prefix($prefix, $attr{$k});
# spent 49µs making 8 calls to XML::NamespaceSupport::declare_prefix, avg 6µs/call
190812µs my $ns = {
191 Prefix => $prefix,
192 NamespaceURI => $attr{$k},
193 };
19483µs push @new_ns, $ns;
195819µs853µs $self->SUPER::start_prefix_mapping($ns);
# spent 53µs making 8 calls to XML::SAX::Base::start_prefix_mapping, avg 7µs/call
196 }
19714290µs push @{$self->{_NSStack}}, \@new_ns;
198
199
200 # create the attributes
20114213µs my %saxattr;
2025655µs56322µs map {
# spent 322µs making 56 calls to XML::NamespaceSupport::process_attribute_name, avg 6µs/call
20314260µs my ($ns,$prefix,$lname) = $nsh->process_attribute_name($_);
20456142µs $saxattr{'{' . ($ns || '') . '}' . $lname} = {
205 Name => $_,
206 LocalName => $lname || '',
207 Prefix => $prefix || '',
208 Value => $attr{$_},
209 NamespaceURI => $ns || '',
210 };
211 } keys %attr;
212
213
214 # now the element
215142132µs142756µs my ($ns,$prefix,$lname) = $nsh->process_element_name($e_name);
# spent 756µs making 142 calls to XML::NamespaceSupport::process_element_name, avg 5µs/call
216142191µs my $element = {
217 Name => $e_name,
218 LocalName => $lname || '',
219 Prefix => $prefix || '',
220 NamespaceURI => $ns || '',
221 Attributes => \%saxattr,
222 };
223
22414237µs push @{$self->{_NodeStack}}, $element;
225142377µs1421.20ms $self->SUPER::start_element($element);
# spent 1.20ms making 142 calls to XML::SAX::Base::start_element, avg 8µs/call
226}
227#-------------------------------------------------------------------#
228
229#-------------------------------------------------------------------#
230# _handle_end
231#-------------------------------------------------------------------#
232
# spent 2.02ms (1.10+914µs) within XML::SAX::Expat::_handle_end which was called 142 times, avg 14µs/call: # 142 times (1.10ms+914µs) by XML::Parser::Expat::ParseStream at line 470 of XML/Parser/Expat.pm, avg 14µs/call
sub _handle_end {
23314244µs my $self = shift()->{__XSE};
234
235142308µs my %element = %{pop @{$self->{_NodeStack}}};
23614278µs delete $element{Attributes};
237142147µs142696µs $self->SUPER::end_element(\%element);
# spent 696µs making 142 calls to XML::SAX::Base::end_element, avg 5µs/call
238
23914236µs my $prev_ns = pop @{$self->{_NSStack}};
24014263µs for my $ns (@$prev_ns) {
241825µs847µs $self->SUPER::end_prefix_mapping( { %$ns } );
# spent 47µs making 8 calls to XML::SAX::Base::end_prefix_mapping, avg 6µs/call
242 }
243142334µs142171µs $self->{_NSHelper}->pop_context;
# spent 171µs making 142 calls to XML::NamespaceSupport::pop_context, avg 1µs/call
244}
245#-------------------------------------------------------------------#
246
247#-------------------------------------------------------------------#
248# _handle_char
249#-------------------------------------------------------------------#
250
# spent 3.91ms (1.14+2.77) within XML::SAX::Expat::_handle_char which was called 478 times, avg 8µs/call: # 478 times (1.14ms+2.77ms) by XML::Parser::Expat::ParseStream at line 470 of XML/Parser/Expat.pm, avg 8µs/call
sub _handle_char {
251478154µs $_[0]->{__XSE}->_handle_start_document({}) unless $_[0]->{__XSE}->{_started};
2524783.97ms4782.77ms $_[0]->{__XSE}->SUPER::characters({ Data => $_[1] });
# spent 2.77ms making 478 calls to XML::SAX::Base::characters, avg 6µs/call
253}
254#-------------------------------------------------------------------#
255
256#-------------------------------------------------------------------#
257# _handle_comment
258#-------------------------------------------------------------------#
259
# spent 281µs (123+158) within XML::SAX::Expat::_handle_comment which was called 46 times, avg 6µs/call: # 46 times (123µs+158µs) by XML::Parser::Expat::ParseStream at line 470 of XML/Parser/Expat.pm, avg 6µs/call
sub _handle_comment {
2604616µs $_[0]->{__XSE}->_handle_start_document({}) unless $_[0]->{__XSE}->{_started};
2614693µs46158µs $_[0]->{__XSE}->SUPER::comment({ Data => $_[1] });
# spent 158µs making 46 calls to XML::SAX::Base::comment, avg 3µs/call
262}
263#-------------------------------------------------------------------#
264
265#-------------------------------------------------------------------#
266# _handle_proc
267#-------------------------------------------------------------------#
268sub _handle_proc {
269 $_[0]->{__XSE}->_handle_start_document({}) unless $_[0]->{__XSE}->{_started};
270 $_[0]->{__XSE}->SUPER::processing_instruction({ Target => $_[1], Data => $_[2] });
271}
272#-------------------------------------------------------------------#
273
274#-------------------------------------------------------------------#
275# _handle_start_cdata
276#-------------------------------------------------------------------#
277sub _handle_start_cdata {
278 $_[0]->{__XSE}->SUPER::start_cdata( {} );
279}
280#-------------------------------------------------------------------#
281
282#-------------------------------------------------------------------#
283# _handle_end_cdata
284#-------------------------------------------------------------------#
285sub _handle_end_cdata {
286 $_[0]->{__XSE}->SUPER::end_cdata( {} );
287}
288#-------------------------------------------------------------------#
289
290#-------------------------------------------------------------------#
291# _handle_xml_decl
292#-------------------------------------------------------------------#
293sub _handle_xml_decl {
294 my $self = shift()->{__XSE};
295 my $version = shift;
296 my $encoding = shift;
297 my $standalone = shift;
298
299 if (not defined $standalone) { $standalone = ''; }
300 elsif ($standalone) { $standalone = 'yes'; }
301 else { $standalone = 'no'; }
302 my $xd = {
303 Version => $version,
304 Encoding => $encoding,
305 Standalone => $standalone,
306 };
307 #$self->SUPER::xml_decl($xd);
308 $self->_handle_start_document($xd);
309}
310#-------------------------------------------------------------------#
311
312#-------------------------------------------------------------------#
313# _handle_notation_decl
314#-------------------------------------------------------------------#
315sub _handle_notation_decl {
316 my $self = shift()->{__XSE};
317 my $notation = shift;
318 shift;
319 my $system = shift;
320 my $public = shift;
321
322 my $not = {
323 Name => $notation,
324 PublicId => $public,
325 SystemId => $system,
326 };
327 $self->SUPER::notation_decl($not);
328}
329#-------------------------------------------------------------------#
330
331#-------------------------------------------------------------------#
332# _handle_unparsed_entity
333#-------------------------------------------------------------------#
334sub _handle_unparsed_entity {
335 my $self = shift()->{__XSE};
336 my $name = shift;
337 my $system = shift;
338 my $public = shift;
339 my $notation = shift;
340
341 my $ue = {
342 Name => $name,
343 PublicId => $public,
344 SystemId => $system,
345 Notation => $notation,
346 };
347 $self->SUPER::unparsed_entity_decl($ue);
348}
349#-------------------------------------------------------------------#
350
351#-------------------------------------------------------------------#
352# _handle_element_decl
353#-------------------------------------------------------------------#
354sub _handle_element_decl {
355 $_[0]->{__XSE}->SUPER::element_decl({ Name => $_[1], Model => "$_[2]" });
356}
357#-------------------------------------------------------------------#
358
359
360#-------------------------------------------------------------------#
361# _handle_attr_decl
362#-------------------------------------------------------------------#
363sub _handle_attr_decl {
364 my $self = shift()->{__XSE};
365 my $ename = shift;
366 my $aname = shift;
367 my $type = shift;
368 my $default = shift;
369 my $fixed = shift;
370
371 my ($vd, $value);
372 if ($fixed) {
373 $vd = '#FIXED';
374 $default =~ s/^(?:"|')//; #"
375 $default =~ s/(?:"|')$//; #"
376 $value = $default;
377 }
378 else {
379 if ($default =~ m/^#/) {
380 $vd = $default;
381 $value = '';
382 }
383 else {
384 $vd = ''; # maybe there's a default ?
385 $default =~ s/^(?:"|')//; #"
386 $default =~ s/(?:"|')$//; #"
387 $value = $default;
388 }
389 }
390
391 my $at = {
392 eName => $ename,
393 aName => $aname,
394 Type => $type,
395 ValueDefault => $vd,
396 Value => $value,
397 };
398 $self->SUPER::attribute_decl($at);
399}
400#-------------------------------------------------------------------#
401
402#-------------------------------------------------------------------#
403# _handle_entity_decl
404#-------------------------------------------------------------------#
405sub _handle_entity_decl {
406 my $self = shift()->{__XSE};
407 my $name = shift;
408 my $val = shift;
409 my $sys = shift;
410 my $pub = shift;
411 my $ndata = shift;
412 my $isprm = shift;
413
414 # deal with param ents
415 if ($isprm) {
416 $name = '%' . $name;
417 }
418
419 # int vs ext
420 if ($val) {
421 my $ent = {
422 Name => $name,
423 Value => $val,
424 };
425 $self->SUPER::internal_entity_decl($ent);
426 }
427 else {
428 my $ent = {
429 Name => $name,
430 PublicId => $pub || '',
431 SystemId => $sys,
432 };
433 $self->SUPER::external_entity_decl($ent);
434 }
435}
436#-------------------------------------------------------------------#
437
438
439#-------------------------------------------------------------------#
440# _handle_start_doctype
441#-------------------------------------------------------------------#
442sub _handle_start_doctype {
443 my $self = shift()->{__XSE};
444 my $name = shift;
445 my $sys = shift;
446 my $pub = shift;
447
448 $self->_handle_start_document({}) unless $self->{_started};
449
450 my $dtd = {
451 Name => $name,
452 SystemId => $sys,
453 PublicId => $pub,
454 };
455 $self->SUPER::start_dtd($dtd);
456}
457#-------------------------------------------------------------------#
458
459#-------------------------------------------------------------------#
460# _handle_end_doctype
461#-------------------------------------------------------------------#
462sub _handle_end_doctype {
463 $_[0]->{__XSE}->SUPER::end_dtd( {} );
464}
465#-------------------------------------------------------------------#
466
467
468#-------------------------------------------------------------------#
469# _handle_start_document
470#-------------------------------------------------------------------#
471
# spent 69µs (12+56) within XML::SAX::Expat::_handle_start_document which was called 2 times, avg 34µs/call: # 2 times (12µs+56µs) by XML::SAX::Expat::_handle_start at line 180, avg 34µs/call
sub _handle_start_document {
472212µs256µs $_[0]->SUPER::start_document($_[1]);
# spent 56µs making 2 calls to XML::SAX::Base::start_document, avg 28µs/call
47325µs $_[0]->{_started} = 1;
474}
475#-------------------------------------------------------------------#
476
477
478#-------------------------------------------------------------------#
479# supported_features
480#-------------------------------------------------------------------#
481
# spent 27µs (21+6) within XML::SAX::Expat::supported_features which was called 6 times, avg 4µs/call: # 4 times (10µs+3µs) by XML::SAX::Base::get_feature at line 2716 of XML/SAX/Base.pm, avg 3µs/call # 2 times (11µs+3µs) by XML::SAX::Base::set_feature at line 2746 of XML/SAX/Base.pm, avg 7µs/call
sub supported_features {
482 return (
483620µs66µs $_[0]->SUPER::supported_features,
# spent 6µs making 6 calls to XML::SAX::Base::supported_features, avg 1µs/call
484 'http://xml.org/sax/features/external-general-entities',
485 'http://xml.org/sax/features/external-parameter-entities',
486 );
487}
488#-------------------------------------------------------------------#
489
490
491
492
493
494#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#
495#`,`, Private Helpers `,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,#
496#```````````````````````````````````````````````````````````````````#
497
498#-------------------------------------------------------------------#
499# _create_node
500#-------------------------------------------------------------------#
501#sub _create_node {
502# shift;
503# # this may check for a factory later
504# return {@_};
505#}
506#-------------------------------------------------------------------#
507
508
50912µs1;
510#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#
511#`,`, Documentation `,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,#
512#```````````````````````````````````````````````````````````````````#
513
514=pod
515
516=head1 NAME
517
518XML::SAX::Expat - SAX2 Driver for Expat (XML::Parser)
519
520=head1 SYNOPSIS
521
522 use XML::SAX::Expat;
523 use XML::SAX::MyFooHandler;
524 my $h = XML::SAX::MyFooHandler->new;
525 my $p = XML::SAX::Expat->new(Handler => $h);
526 $p->parse_file('/path/to/foo.xml');
527
528=head1 DESCRIPTION
529
530This is an implementation of a SAX2 driver sitting on top of Expat
531(XML::Parser) which Ken MacLeod posted to perl-xml and which I have
532updated.
533
534It is still incomplete, though most of the basic SAX2 events should be
535available. The SAX2 spec is currently available from
536http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/perl-xml/libxml-perl/doc/sax-2.0.html?rev=HEAD&content-type=text/html
537
538A more friendly URL as well as a PODification of the spec are in the
539works.
540
541=head1 METHODS
542
543The methods defined in this class correspond to those listed in the
544PerlSAX2 specification, available above.
545
546=head1 FEATURES AND CAVEATS
547
548=over 2
549
550=item supported_features
551
552Returns:
553
554 * http://xml.org/sax/features/external-general-entities
555 * http://xml.org/sax/features/external-parameter-entities
556 * [ Features supported by ancestors ]
557
558Turning one of the first two on also turns the other on (this maps
559to the XML::Parser ParseParamEnts option). This may be fixed in the
560future, so don't rely on this behaviour.
561
562=back
563
564=head1 MISSING PARTS
565
566XML::Parser has no listed callbacks for the following events, which
567are therefore not presently generated (ways may be found in the
568future):
569
570 * ignorable_whitespace
571 * skipped_entity
572 * start_entity / end_entity
573 * resolve_entity
574
575Ways of signalling them are welcome. In addition to those,
576set_document_locator is not yet called.
577
578=head1 TODO
579
580 - reuse Ken's tests and add more
581
582=head1 AUTHOR
583
584Robin Berjon; stolen from Ken Macleod, ken@bitsko.slc.ut.us, and with
585suggestions and feedback from perl-xml. Currently maintained by Bjoern
586Hoehrmann L<http://bjoern.hoehrmann.de/>.
587
588=head1 COPYRIGHT AND LICENSE
589
590Copyright (c) 2001-2008 Robin Berjon. All rights reserved. This program is
591free software; you can redistribute it and/or modify it under the same
592terms as Perl itself.
593
594=head1 SEE ALSO
595
596XML::Parser::PerlSAX
597
598=cut
 
# spent 19µs within XML::SAX::Expat::CORE:match which was called 8 times, avg 2µs/call: # 8 times (19µs+0s) by XML::SAX::Expat::_handle_start at line 187, avg 2µs/call
sub XML::SAX::Expat::CORE:match; # opcode