line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::POM::View::XML; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
3
|
|
|
3
|
|
134474
|
$Pod::POM::View::XML::AUTHORITY = 'cpan:YANICK'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: XML view of a Pod Object Model |
6
|
|
|
|
|
|
|
$Pod::POM::View::XML::VERSION = '0.0.1'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
60
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
86
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
12
|
use Pod::POM::View; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
48
|
|
12
|
3
|
|
|
3
|
|
10
|
use parent qw( Pod::POM::View ); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
14
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
169
|
use vars qw( $VERSION $DEBUG $ERROR $AUTOLOAD ); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
170
|
|
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
3
|
|
1276
|
use PerlX::Maybe; |
|
3
|
|
|
|
|
4286
|
|
|
3
|
|
|
|
|
198
|
|
17
|
3
|
|
|
3
|
|
1646
|
use XML::Writer; |
|
3
|
|
|
|
|
32734
|
|
|
3
|
|
|
|
|
99
|
|
18
|
3
|
|
|
3
|
|
1540
|
use Escape::Houdini qw/ escape_xml /; |
|
3
|
|
|
|
|
1841
|
|
|
3
|
|
|
|
|
4776
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$DEBUG = 0 unless defined $DEBUG; |
22
|
|
|
|
|
|
|
my $HTML_PROTECT = 0; |
23
|
|
|
|
|
|
|
my @OVER; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $TAG_PREFIX = 'pod'; |
26
|
|
|
|
|
|
|
our %TAGS = qw/ |
27
|
|
|
|
|
|
|
pod pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
head1 section |
30
|
|
|
|
|
|
|
head1_title title |
31
|
|
|
|
|
|
|
head2 section |
32
|
|
|
|
|
|
|
head2_title title |
33
|
|
|
|
|
|
|
head3 section |
34
|
|
|
|
|
|
|
head3_title title |
35
|
|
|
|
|
|
|
head4 section |
36
|
|
|
|
|
|
|
head4_title title |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
over over |
39
|
|
|
|
|
|
|
item item |
40
|
|
|
|
|
|
|
item_title title |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
for div |
43
|
|
|
|
|
|
|
begin div |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
textblock para |
46
|
|
|
|
|
|
|
verbatim preformated |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
b bold |
49
|
|
|
|
|
|
|
i italic |
50
|
|
|
|
|
|
|
c code |
51
|
|
|
|
|
|
|
f file |
52
|
|
|
|
|
|
|
l link |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
index index |
55
|
|
|
|
|
|
|
/; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub new { |
58
|
3
|
|
|
3
|
1
|
1672
|
my $class = shift; |
59
|
3
|
|
50
|
|
|
24
|
my $self = $class->SUPER::new(@_) |
60
|
|
|
|
|
|
|
|| return; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# initalise stack for maintaining info for nested lists |
63
|
3
|
|
|
|
|
56
|
my %args = @_; |
64
|
|
|
|
|
|
|
|
65
|
3
|
|
|
|
|
9
|
$self->{ OVER } = []; |
66
|
3
|
100
|
|
|
|
13
|
$self->{tag_prefix} = exists $args{tag_prefix} ? $args{tag_prefix} : $TAG_PREFIX; |
67
|
3
|
100
|
|
|
|
62
|
$self->{tags} = { |
68
|
|
|
|
|
|
|
%TAGS, |
69
|
3
|
|
|
|
|
24
|
%{ $args{tags} || {} }, |
70
|
|
|
|
|
|
|
}; |
71
|
|
|
|
|
|
|
|
72
|
3
|
|
|
|
|
12
|
return $self; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub tag { |
76
|
42
|
|
|
42
|
0
|
70
|
my( $self, $pod ) = @_; |
77
|
|
|
|
|
|
|
|
78
|
42
|
100
|
|
|
|
146
|
return join '_', grep { $_ } |
|
84
|
100
|
|
|
|
237
|
|
79
|
|
|
|
|
|
|
( ref $self ? $self->{tag_prefix} : $TAG_PREFIX ), |
80
|
|
|
|
|
|
|
( ref $self ? $self->{tags}{$pod} : $TAGS{$pod} ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub xml { |
84
|
34
|
|
|
34
|
0
|
124
|
XML::Writer->new( OUTPUT => 'self', NEWLINES => 1, UNSAFE => 1 ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub view { |
88
|
0
|
|
|
0
|
1
|
0
|
my ($self, $type, $item) = @_; |
89
|
|
|
|
|
|
|
|
90
|
0
|
0
|
|
|
|
0
|
if ($type =~ s/^seq_//) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
91
|
0
|
|
|
|
|
0
|
return $item; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
elsif (UNIVERSAL::isa($item, 'HASH')) { |
94
|
0
|
0
|
|
|
|
0
|
if (defined $item->{ content }) { |
|
|
0
|
|
|
|
|
|
95
|
0
|
|
|
|
|
0
|
return $item->{ content }->present($self); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
elsif (defined $item->{ text }) { |
98
|
0
|
|
|
|
|
0
|
my $text = $item->{ text }; |
99
|
0
|
0
|
|
|
|
0
|
return ref $text ? $text->present($self) : $text; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
else { |
102
|
0
|
|
|
|
|
0
|
return ''; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
elsif (! ref $item) { |
106
|
0
|
|
|
|
|
0
|
return $item; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
else { |
109
|
0
|
|
|
|
|
0
|
return ''; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub view_pod { |
114
|
8
|
|
|
8
|
0
|
7811
|
my ($self, $pod) = @_; |
115
|
|
|
|
|
|
|
|
116
|
8
|
|
|
|
|
23
|
my $xml = xml(); |
117
|
|
|
|
|
|
|
|
118
|
8
|
|
|
|
|
1597
|
$xml->startTag( $self->tag('pod') ); |
119
|
8
|
|
|
|
|
319
|
$xml->raw( $pod->content->present($self) ); |
120
|
8
|
|
|
|
|
895
|
$xml->endTag; |
121
|
|
|
|
|
|
|
|
122
|
8
|
|
|
|
|
143
|
$xml; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub view_headn { |
127
|
8
|
|
|
8
|
0
|
17
|
my ($self, $head, $level) = @_; |
128
|
|
|
|
|
|
|
|
129
|
8
|
|
|
|
|
16
|
my $xml = xml(); |
130
|
8
|
|
|
|
|
1083
|
$xml->startTag( $self->tag( 'head'.$level ), head_level => $level ); |
131
|
8
|
|
|
|
|
265
|
$xml->startTag( $self->tag( 'head'.$level.'_title') ); |
132
|
8
|
|
|
|
|
166
|
$xml->raw( $head->title->present($self) ); |
133
|
8
|
|
|
|
|
115
|
$xml->endTag; |
134
|
|
|
|
|
|
|
|
135
|
8
|
|
|
|
|
125
|
$xml->raw( $head->content->present($self) ); |
136
|
|
|
|
|
|
|
|
137
|
8
|
|
|
|
|
583
|
$xml->endTag; |
138
|
|
|
|
|
|
|
|
139
|
8
|
|
|
|
|
97
|
$xml; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
5
|
|
|
5
|
0
|
207
|
sub view_head1 { $_[0]->view_headn( $_[1], 1 ) } |
143
|
1
|
|
|
1
|
0
|
29
|
sub view_head2 { $_[0]->view_headn( $_[1], 2 ) } |
144
|
1
|
|
|
1
|
0
|
27
|
sub view_head3 { $_[0]->view_headn( $_[1], 3 ) } |
145
|
1
|
|
|
1
|
0
|
28
|
sub view_head4 { $_[0]->view_headn( $_[1], 4 ) } |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub view_over { |
149
|
0
|
|
|
0
|
0
|
0
|
my( $self, $over ) = @_; |
150
|
|
|
|
|
|
|
|
151
|
0
|
0
|
|
|
|
0
|
if( my $items = $over->item() ) { |
152
|
0
|
|
|
|
|
0
|
return $self->view_over_items( $over, $items ); |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
else { |
155
|
0
|
|
|
|
|
0
|
return $self->view_over_no_items( $over ); |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub view_over_items { |
161
|
0
|
|
|
0
|
0
|
0
|
my ($self, $over, $items) = @_; |
162
|
0
|
|
|
|
|
0
|
my ($strip, $type); |
163
|
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
0
|
my $first_title = $items->[0]->title(); |
165
|
|
|
|
|
|
|
|
166
|
0
|
0
|
|
|
|
0
|
if ($first_title =~ /^\s*\*\s*/) { |
|
|
0
|
|
|
|
|
|
167
|
|
|
|
|
|
|
# '=item *' => |
168
|
0
|
|
|
|
|
0
|
$strip = qr/^\s*\*\s*/; |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
elsif ($first_title =~ /^\s*\d+\.?\s*/) { |
171
|
|
|
|
|
|
|
# '=item 1.' or '=item 1 ' => |
172
|
0
|
|
|
|
|
0
|
$strip = qr/^\s*\d+\.?\s*/; |
173
|
0
|
|
|
|
|
0
|
$type = 'numerical'; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
0
|
0
|
|
|
|
0
|
my $overstack = ref $self ? $self->{ OVER } : \@OVER; |
177
|
0
|
|
|
|
|
0
|
push @$overstack, $strip; |
178
|
|
|
|
|
|
|
|
179
|
0
|
|
|
|
|
0
|
my $xml = xml(); |
180
|
|
|
|
|
|
|
|
181
|
0
|
|
|
|
|
0
|
$xml->startTag( $self->tag('over'), maybe 'type' => $type ); |
182
|
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
0
|
$xml->raw( $over->content->present($self) ); |
184
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
0
|
$xml->endTag; |
186
|
|
|
|
|
|
|
|
187
|
0
|
|
|
|
|
0
|
pop @$overstack; |
188
|
|
|
|
|
|
|
|
189
|
0
|
|
|
|
|
0
|
$xml; |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub view_over_no_items { |
193
|
0
|
|
|
0
|
0
|
0
|
my( $self, $over ) = @_; |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
0
|
my $xml = xml(); |
196
|
0
|
|
|
|
|
0
|
$xml->raw( $over->content->present($self) ); |
197
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
0
|
$xml; |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
sub view_item { |
203
|
0
|
|
|
0
|
0
|
0
|
my ($self, $item) = @_; |
204
|
|
|
|
|
|
|
|
205
|
0
|
0
|
|
|
|
0
|
my $over = ref $self ? $self->{ OVER } : \@OVER; |
206
|
0
|
|
|
|
|
0
|
my $title = $item->title(); |
207
|
0
|
|
|
|
|
0
|
my $strip = $over->[-1]; |
208
|
|
|
|
|
|
|
|
209
|
0
|
0
|
|
|
|
0
|
if (defined $title) { |
210
|
0
|
0
|
|
|
|
0
|
$title = $title->present($self) if ref $title; |
211
|
0
|
0
|
|
|
|
0
|
$title =~ s/$strip// if $strip; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
0
|
|
|
|
|
0
|
my $xml = xml(); |
215
|
0
|
|
|
|
|
0
|
$xml->startTag($self->tag('item')); |
216
|
0
|
0
|
|
|
|
0
|
if( $title ) { |
217
|
0
|
|
|
|
|
0
|
$xml->startTag($self->tag('title')); |
218
|
0
|
|
|
|
|
0
|
$xml->raw($title); |
219
|
0
|
|
|
|
|
0
|
$xml->endTag; |
220
|
|
|
|
|
|
|
} |
221
|
0
|
|
|
|
|
0
|
$xml->raw($item->content->present($self)); |
222
|
0
|
|
|
|
|
0
|
$xml->endTag; |
223
|
|
|
|
|
|
|
|
224
|
0
|
|
|
|
|
0
|
$xml; |
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub view_for { |
229
|
0
|
|
|
0
|
0
|
0
|
my ($self, $for) = @_; |
230
|
|
|
|
|
|
|
|
231
|
0
|
|
|
|
|
0
|
my $xml = xml(); |
232
|
|
|
|
|
|
|
|
233
|
0
|
|
|
|
|
0
|
$xml->startTag($self->tag('for'), 'for' => $for->format ); |
234
|
0
|
0
|
|
|
|
0
|
if( $for->format =~ /(ht|x)ml/ ) { |
235
|
0
|
|
|
|
|
0
|
$xml->raw($for->text); |
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
else { |
238
|
0
|
|
|
|
|
0
|
$xml->characters($for->text); |
239
|
|
|
|
|
|
|
} |
240
|
0
|
|
|
|
|
0
|
$xml->endTag; |
241
|
|
|
|
|
|
|
|
242
|
0
|
|
|
|
|
0
|
$xml; |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
sub view_begin { |
246
|
0
|
|
|
0
|
0
|
0
|
my ($self, $begin) = @_; |
247
|
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
0
|
my $xml = xml(); |
249
|
|
|
|
|
|
|
|
250
|
0
|
|
|
|
|
0
|
$xml->startTag($self->tag('begin'), for => $begin->format ); |
251
|
|
|
|
|
|
|
|
252
|
0
|
0
|
|
|
|
0
|
$HTML_PROTECT++ if $begin->format =~ /\b(x|ht)ml\b/; |
253
|
0
|
|
|
|
|
0
|
$xml->raw( $begin->content->present($self) ); |
254
|
0
|
0
|
|
|
|
0
|
$HTML_PROTECT-- if $begin->format =~ /\b(x|ht)ml\b/; |
255
|
|
|
|
|
|
|
|
256
|
0
|
|
|
|
|
0
|
$xml->endTag; |
257
|
|
|
|
|
|
|
|
258
|
0
|
|
|
|
|
0
|
$xml; |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
sub view_textblock { |
262
|
8
|
|
|
8
|
0
|
322
|
my ($self, $text) = @_; |
263
|
|
|
|
|
|
|
|
264
|
8
|
50
|
|
|
|
20
|
if( $HTML_PROTECT ) { |
265
|
0
|
|
|
|
|
0
|
return $text . "\n"; |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
8
|
|
|
|
|
66
|
my $xml = xml(); |
269
|
|
|
|
|
|
|
|
270
|
8
|
|
|
|
|
1011
|
$xml->startTag($self->tag('textblock')); |
271
|
8
|
|
|
|
|
147
|
$xml->raw( $text ); |
272
|
8
|
|
|
|
|
61
|
$xml->endTag; |
273
|
|
|
|
|
|
|
|
274
|
8
|
|
|
|
|
106
|
$xml; |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
sub view_verbatim { |
279
|
2
|
|
|
2
|
0
|
23
|
my ($self, $text) = @_; |
280
|
|
|
|
|
|
|
|
281
|
2
|
|
|
|
|
6
|
my $xml = xml(); |
282
|
|
|
|
|
|
|
|
283
|
2
|
|
|
|
|
244
|
$xml->startTag($self->tag('verbatim')); |
284
|
2
|
|
|
|
|
39
|
$xml->characters($text); |
285
|
2
|
|
|
|
|
36
|
$xml->endTag; |
286
|
|
|
|
|
|
|
|
287
|
2
|
|
|
|
|
27
|
$xml; |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
sub view_seq_bold { |
293
|
2
|
|
|
2
|
0
|
55
|
my ($self, $text) = @_; |
294
|
|
|
|
|
|
|
|
295
|
2
|
|
|
|
|
5
|
my $xml = xml(); |
296
|
|
|
|
|
|
|
|
297
|
2
|
|
|
|
|
229
|
$xml->startTag( $self->tag('b') ); |
298
|
2
|
|
|
|
|
36
|
$xml->raw( $text ); |
299
|
2
|
|
|
|
|
15
|
$xml->endTag; |
300
|
|
|
|
|
|
|
|
301
|
2
|
|
|
|
|
23
|
$xml; |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
sub view_seq_italic { |
306
|
2
|
|
|
2
|
0
|
17
|
my ($self, $text) = @_; |
307
|
|
|
|
|
|
|
|
308
|
2
|
|
|
|
|
4
|
my $xml = xml(); |
309
|
|
|
|
|
|
|
|
310
|
2
|
|
|
|
|
232
|
$xml->startTag( $self->tag('i') ); |
311
|
2
|
|
|
|
|
36
|
$xml->raw( $text ); |
312
|
2
|
|
|
|
|
15
|
$xml->endTag; |
313
|
|
|
|
|
|
|
|
314
|
2
|
|
|
|
|
24
|
$xml; |
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
sub view_seq_code { |
319
|
1
|
|
|
1
|
0
|
8
|
my ($self, $text) = @_; |
320
|
|
|
|
|
|
|
|
321
|
1
|
|
|
|
|
3
|
my $xml = xml(); |
322
|
|
|
|
|
|
|
|
323
|
1
|
|
|
|
|
178
|
$xml->startTag( $self->tag('c') ); |
324
|
1
|
|
|
|
|
24
|
$xml->raw( $text ); |
325
|
1
|
|
|
|
|
10
|
$xml->endTag; |
326
|
|
|
|
|
|
|
|
327
|
1
|
|
|
|
|
18
|
$xml; |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
sub view_seq_file { |
331
|
1
|
|
|
1
|
0
|
8
|
my ($self, $text) = @_; |
332
|
1
|
|
|
|
|
2
|
my $xml = xml(); |
333
|
1
|
|
|
|
|
132
|
$xml->startTag( $self->tag('f') ); |
334
|
1
|
|
|
|
|
18
|
$xml->raw( $text ); |
335
|
1
|
|
|
|
|
7
|
$xml->endTag; |
336
|
|
|
|
|
|
|
|
337
|
1
|
|
|
|
|
12
|
$xml; |
338
|
|
|
|
|
|
|
} |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
sub view_seq_space { |
341
|
0
|
|
|
0
|
0
|
0
|
my ($self, $text) = @_; |
342
|
0
|
|
|
|
|
0
|
$text =~ s/\s/ /g; |
343
|
|
|
|
|
|
|
|
344
|
0
|
|
|
|
|
0
|
$text; |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
} |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
sub view_seq_entity { |
350
|
0
|
|
|
0
|
0
|
0
|
my ($self, $entity) = @_; |
351
|
|
|
|
|
|
|
|
352
|
0
|
|
|
|
|
0
|
"&$entity;"; |
353
|
|
|
|
|
|
|
} |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
sub view_seq_index { |
357
|
1
|
|
|
1
|
0
|
9
|
my( $self, $index ) = @_; |
358
|
|
|
|
|
|
|
|
359
|
1
|
|
|
|
|
2
|
my $xml = xml(); |
360
|
1
|
|
|
|
|
135
|
$xml->startTag( $self->tag('index') ); |
361
|
1
|
|
|
|
|
19
|
$xml->raw( $index ); |
362
|
1
|
|
|
|
|
8
|
$xml->endTag; |
363
|
|
|
|
|
|
|
|
364
|
1
|
|
|
|
|
12
|
$xml; |
365
|
|
|
|
|
|
|
} |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
sub view_seq_link { |
369
|
1
|
|
|
1
|
0
|
8
|
my ($self, $link) = @_; |
370
|
|
|
|
|
|
|
|
371
|
1
|
|
|
|
|
3
|
my $xml = xml(); |
372
|
|
|
|
|
|
|
|
373
|
1
|
|
|
|
|
166
|
$xml->dataElement( $self->tag('l') => $link ); |
374
|
|
|
|
|
|
|
|
375
|
1
|
|
|
|
|
44
|
$xml; |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
sub view_seq_text { |
379
|
30
|
|
|
30
|
0
|
496
|
my ($self, $text) = @_; |
380
|
|
|
|
|
|
|
|
381
|
30
|
50
|
|
|
|
59
|
if( $HTML_PROTECT ) { |
382
|
0
|
|
|
|
|
0
|
return $text; |
383
|
|
|
|
|
|
|
} |
384
|
|
|
|
|
|
|
|
385
|
30
|
|
|
|
|
132
|
return escape_xml( $text ); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
sub encode { |
389
|
16
|
|
|
16
|
0
|
136
|
my($self,$text) = @_; |
390
|
16
|
|
|
|
|
2066
|
require Encode; |
391
|
16
|
|
|
|
|
23236
|
return Encode::encode("ascii",$text,Encode::FB_XMLCREF()); |
392
|
|
|
|
|
|
|
} |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
1; |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
__END__ |