line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Lingua::YaTeA::XMLEntities; |
4
|
5
|
|
|
5
|
|
33
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
141
|
|
5
|
5
|
|
|
5
|
|
51
|
use warnings; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1381
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub encode |
10
|
|
|
|
|
|
|
{ |
11
|
736
|
|
|
736
|
1
|
1200
|
$_[0]=~s/&/&/go; |
12
|
736
|
|
|
|
|
1118
|
$_[0]=~s/\"/"/go; |
13
|
736
|
|
|
|
|
1092
|
$_[0]=~s/\'/'/go; |
14
|
736
|
|
|
|
|
1059
|
$_[0]=~s/</go; |
15
|
736
|
|
|
|
|
1054
|
$_[0]=~s/>/>/go; |
16
|
|
|
|
|
|
|
|
17
|
736
|
|
|
|
|
1189
|
return($_[0]); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 decode($line) |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
This method decodes XML entities corresponding to special XML characters in the line C<$line> . |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub decode |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
1
|
|
$_[0]=~s/"/\"/go; |
31
|
0
|
|
|
|
|
|
$_[0]=~s/'/\'/go; |
32
|
0
|
|
|
|
|
|
$_[0]=~s/&/&/go; |
33
|
0
|
|
|
|
|
|
$_[0]=~s/</
|
34
|
0
|
|
|
|
|
|
$_[0]=~s/>/>/go; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return($_[0]); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |