| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Pod::Simple::DumpAsXML; |
|
2
|
30
|
|
|
30
|
|
2389075
|
use strict; |
|
|
30
|
|
|
|
|
72
|
|
|
|
30
|
|
|
|
|
1332
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '3.48'; |
|
4
|
30
|
|
|
30
|
|
13305
|
use Pod::Simple (); |
|
|
30
|
|
|
|
|
91
|
|
|
|
30
|
|
|
|
|
1286
|
|
|
5
|
30
|
|
|
30
|
|
969
|
BEGIN {our @ISA = ('Pod::Simple')} |
|
6
|
|
|
|
|
|
|
|
|
7
|
30
|
|
|
30
|
|
174
|
use Carp (); |
|
|
30
|
|
|
|
|
98
|
|
|
|
30
|
|
|
|
|
550
|
|
|
8
|
30
|
|
|
30
|
|
13975
|
use Text::Wrap qw(wrap); |
|
|
30
|
|
|
|
|
71338
|
|
|
|
30
|
|
|
|
|
2132
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
30
|
50
|
|
30
|
|
18806
|
BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
|
13
|
150
|
|
|
150
|
1
|
528802
|
my $self = shift; |
|
14
|
150
|
|
|
|
|
582
|
my $new = $self->SUPER::new(@_); |
|
15
|
150
|
|
50
|
|
|
764
|
$new->{'output_fh'} ||= *STDOUT{IO}; |
|
16
|
150
|
|
|
|
|
481
|
$new->accept_codes('VerbatimFormatted'); |
|
17
|
150
|
|
|
|
|
497
|
$new->keep_encoding_directive(1); |
|
18
|
150
|
|
|
|
|
286
|
return $new; |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _handle_element_start { |
|
24
|
|
|
|
|
|
|
# ($self, $element_name, $attr_hash_r) |
|
25
|
804
|
|
|
804
|
|
1141
|
my $fh = $_[0]{'output_fh'}; |
|
26
|
804
|
|
|
|
|
944
|
my($key, $value); |
|
27
|
804
|
|
|
|
|
760
|
DEBUG and print STDERR "++ $_[1]\n"; |
|
28
|
|
|
|
|
|
|
|
|
29
|
804
|
|
100
|
|
|
3451
|
print $fh ' ' x ($_[0]{'indent'} || 0), "<", $_[1]; |
|
30
|
|
|
|
|
|
|
|
|
31
|
804
|
|
|
|
|
1065
|
foreach my $key (sort keys %{$_[2]}) { |
|
|
804
|
|
|
|
|
2163
|
|
|
32
|
1054
|
100
|
|
|
|
1953
|
unless($key =~ m/^~/s) { |
|
33
|
925
|
100
|
100
|
|
|
2656
|
next if $key eq 'start_line' and $_[0]{'hide_line_numbers'}; |
|
34
|
651
|
|
|
|
|
1363
|
_xml_escape($value = $_[2]{$key}); |
|
35
|
651
|
|
|
|
|
1254
|
print $fh ' ', $key, '="', $value, '"'; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
804
|
|
|
|
|
1428
|
print $fh ">\n"; |
|
41
|
804
|
|
|
|
|
1093
|
$_[0]{'indent'}++; |
|
42
|
804
|
|
|
|
|
1327
|
return; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _handle_text { |
|
46
|
627
|
|
|
627
|
|
676
|
DEBUG and print STDERR "== \"$_[1]\"\n"; |
|
47
|
627
|
100
|
|
|
|
980
|
if(length $_[1]) { |
|
48
|
626
|
|
|
|
|
1140
|
my $indent = ' ' x $_[0]{'indent'}; |
|
49
|
626
|
|
|
|
|
904
|
my $text = $_[1]; |
|
50
|
626
|
|
|
|
|
1080
|
_xml_escape($text); |
|
51
|
626
|
|
|
|
|
930
|
local $Text::Wrap::huge = 'overflow'; |
|
52
|
626
|
|
|
|
|
1384
|
$text = wrap('', $indent, $text); |
|
53
|
626
|
|
|
|
|
303503
|
print {$_[0]{'output_fh'}} $indent, $text, "\n"; |
|
|
626
|
|
|
|
|
2286
|
|
|
54
|
|
|
|
|
|
|
} |
|
55
|
627
|
|
|
|
|
1905
|
return; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _handle_element_end { |
|
59
|
804
|
|
|
804
|
|
930
|
DEBUG and print STDERR "-- $_[1]\n"; |
|
60
|
804
|
|
|
|
|
2268
|
print {$_[0]{'output_fh'}} |
|
61
|
804
|
|
|
|
|
849
|
' ' x --$_[0]{'indent'}, "", $_[1], ">\n"; |
|
62
|
804
|
|
|
|
|
1255
|
return; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub _xml_escape { |
|
68
|
1277
|
|
|
1277
|
|
1482
|
foreach my $x (@_) { |
|
69
|
|
|
|
|
|
|
# Escape things very cautiously: |
|
70
|
1277
|
50
|
|
|
|
4158
|
if ("$]" >= 5.007_003) { |
|
71
|
1277
|
|
|
|
|
3006
|
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/''.(utf8::native_to_unicode(ord($1))).';'/eg; |
|
|
6872
|
|
|
|
|
11866
|
|
|
72
|
|
|
|
|
|
|
} else { # Is broken for non-ASCII platforms on early perls |
|
73
|
0
|
|
|
|
|
0
|
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/''.(ord($1)).';'/eg; |
|
|
0
|
|
|
|
|
0
|
|
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
# Yes, stipulate the list without a range, so that this can work right on |
|
76
|
|
|
|
|
|
|
# all charsets that this module happens to run under. |
|
77
|
|
|
|
|
|
|
} |
|
78
|
1277
|
|
|
|
|
1514
|
return; |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
82
|
|
|
|
|
|
|
1; |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |