line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
require 5; |
3
|
|
|
|
|
|
|
package Pod::Simple::DumpAsXML; |
4
|
|
|
|
|
|
|
$VERSION = '3.42'; |
5
|
29
|
|
|
29
|
|
236505
|
use Pod::Simple (); |
|
29
|
|
|
|
|
94
|
|
|
29
|
|
|
|
|
916
|
|
6
|
29
|
|
|
29
|
|
1092
|
BEGIN {@ISA = ('Pod::Simple')} |
7
|
|
|
|
|
|
|
|
8
|
29
|
|
|
29
|
|
185
|
use strict; |
|
29
|
|
|
|
|
54
|
|
|
29
|
|
|
|
|
535
|
|
9
|
|
|
|
|
|
|
|
10
|
29
|
|
|
29
|
|
157
|
use Carp (); |
|
29
|
|
|
|
|
53
|
|
|
29
|
|
|
|
|
494
|
|
11
|
29
|
|
|
29
|
|
14374
|
use Text::Wrap qw(wrap); |
|
29
|
|
|
|
|
67637
|
|
|
29
|
|
|
|
|
1963
|
|
12
|
|
|
|
|
|
|
|
13
|
29
|
50
|
|
29
|
|
17131
|
BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
149
|
|
|
149
|
1
|
20276
|
my $self = shift; |
17
|
149
|
|
|
|
|
505
|
my $new = $self->SUPER::new(@_); |
18
|
149
|
|
50
|
|
|
1073
|
$new->{'output_fh'} ||= *STDOUT{IO}; |
19
|
149
|
|
|
|
|
467
|
$new->accept_codes('VerbatimFormatted'); |
20
|
149
|
|
|
|
|
486
|
$new->keep_encoding_directive(1); |
21
|
149
|
|
|
|
|
289
|
return $new; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _handle_element_start { |
27
|
|
|
|
|
|
|
# ($self, $element_name, $attr_hash_r) |
28
|
801
|
|
|
801
|
|
1319
|
my $fh = $_[0]{'output_fh'}; |
29
|
801
|
|
|
|
|
1143
|
my($key, $value); |
30
|
801
|
|
|
|
|
993
|
DEBUG and print STDERR "++ $_[1]\n"; |
31
|
|
|
|
|
|
|
|
32
|
801
|
|
100
|
|
|
3987
|
print $fh ' ' x ($_[0]{'indent'} || 0), "<", $_[1]; |
33
|
|
|
|
|
|
|
|
34
|
801
|
|
|
|
|
1394
|
foreach my $key (sort keys %{$_[2]}) { |
|
801
|
|
|
|
|
3224
|
|
35
|
1050
|
100
|
|
|
|
2765
|
unless($key =~ m/^~/s) { |
36
|
921
|
100
|
100
|
|
|
3156
|
next if $key eq 'start_line' and $_[0]{'hide_line_numbers'}; |
37
|
647
|
|
|
|
|
1681
|
_xml_escape($value = $_[2]{$key}); |
38
|
647
|
|
|
|
|
1697
|
print $fh ' ', $key, '="', $value, '"'; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
801
|
|
|
|
|
2010
|
print $fh ">\n"; |
44
|
801
|
|
|
|
|
1372
|
$_[0]{'indent'}++; |
45
|
801
|
|
|
|
|
1472
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _handle_text { |
49
|
625
|
|
|
625
|
|
779
|
DEBUG and print STDERR "== \"$_[1]\"\n"; |
50
|
625
|
100
|
|
|
|
1507
|
if(length $_[1]) { |
51
|
624
|
|
|
|
|
1347
|
my $indent = ' ' x $_[0]{'indent'}; |
52
|
624
|
|
|
|
|
1034
|
my $text = $_[1]; |
53
|
624
|
|
|
|
|
1300
|
_xml_escape($text); |
54
|
624
|
|
|
|
|
1080
|
local $Text::Wrap::huge = 'overflow'; |
55
|
624
|
|
|
|
|
1598
|
$text = wrap('', $indent, $text); |
56
|
624
|
|
|
|
|
252330
|
print {$_[0]{'output_fh'}} $indent, $text, "\n"; |
|
624
|
|
|
|
|
2484
|
|
57
|
|
|
|
|
|
|
} |
58
|
625
|
|
|
|
|
2166
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _handle_element_end { |
62
|
801
|
|
|
801
|
|
1013
|
DEBUG and print STDERR "-- $_[1]\n"; |
63
|
801
|
|
|
|
|
2680
|
print {$_[0]{'output_fh'}} |
64
|
801
|
|
|
|
|
1049
|
' ' x --$_[0]{'indent'}, "", $_[1], ">\n"; |
65
|
801
|
|
|
|
|
1611
|
return; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub _xml_escape { |
71
|
1271
|
|
|
1271
|
|
1907
|
foreach my $x (@_) { |
72
|
|
|
|
|
|
|
# Escape things very cautiously: |
73
|
1271
|
50
|
|
|
|
5096
|
if ($] ge 5.007_003) { |
74
|
1271
|
|
|
|
|
3763
|
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/''.(utf8::native_to_unicode(ord($1))).';'/eg; |
|
6872
|
|
|
|
|
16212
|
|
75
|
|
|
|
|
|
|
} else { # Is broken for non-ASCII platforms on early perls |
76
|
0
|
|
|
|
|
0
|
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/''.(ord($1)).';'/eg; |
|
0
|
|
|
|
|
0
|
|
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
# Yes, stipulate the list without a range, so that this can work right on |
79
|
|
|
|
|
|
|
# all charsets that this module happens to run under. |
80
|
|
|
|
|
|
|
} |
81
|
1271
|
|
|
|
|
2074
|
return; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |