line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Mini::Element::Entity; |
2
|
10
|
|
|
10
|
|
52
|
use strict; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
383
|
|
3
|
|
|
|
|
|
|
$^W = 1; |
4
|
|
|
|
|
|
|
|
5
|
10
|
|
|
10
|
|
48
|
use XML::Mini; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
214
|
|
6
|
10
|
|
|
10
|
|
59
|
use XML::Mini::Element; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
251
|
|
7
|
|
|
|
|
|
|
|
8
|
10
|
|
|
10
|
|
47
|
use vars qw ( $VERSION @ISA ); |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
4885
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.24'; |
10
|
|
|
|
|
|
|
push @ISA, qw ( XML::Mini::Element ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $name = shift; |
16
|
0
|
|
|
|
|
|
my $value = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $self = {}; |
19
|
0
|
|
0
|
|
|
|
bless $self, ref $class || $class; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$self->{'_attributes'} = {}; |
22
|
0
|
|
|
|
|
|
$self->{'_numChildren'} = 0; |
23
|
0
|
|
|
|
|
|
$self->{'_numElementChildren'} = 0; |
24
|
0
|
|
|
|
|
|
$self->{'_children'} = []; |
25
|
0
|
|
|
|
|
|
$self->{'_avoidLoops'} = $XML::Mini::AvoidLoops; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
$self->name($name); |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $oldAutoEscape = $XML::Mini::AutoEscapeEntities; |
30
|
0
|
|
|
|
|
|
$XML::Mini::AutoEscapeEntities = 0; |
31
|
0
|
0
|
|
|
|
|
$self->createNode($value) if (defined $value); |
32
|
0
|
|
|
|
|
|
$XML::Mini::AutoEscapeEntities = $oldAutoEscape; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub toString |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
40
|
0
|
|
|
|
|
|
my $depth = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $spaces; |
43
|
0
|
0
|
|
|
|
|
if ($depth == $XML::Mini::NoWhiteSpaces) |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
|
$spaces = ''; |
46
|
|
|
|
|
|
|
} else { |
47
|
0
|
|
|
|
|
|
$spaces = $self->_spaceStr($depth); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $retString = "$spacesname(); |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
if (! $self->{'_numChildren'}) |
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
|
|
|
$retString .= ">\n"; |
55
|
0
|
|
|
|
|
|
return $retString; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
my $nextDepth = ($depth == $XML::Mini::NoWhiteSpaces) ? $XML::Mini::NoWhiteSpaces |
59
|
|
|
|
|
|
|
: $depth + 1; |
60
|
0
|
|
|
|
|
|
$retString .= '"'; |
61
|
0
|
|
|
|
|
|
for (my $i=0; $i < $self->{'_numChildren'}; $i++) |
62
|
|
|
|
|
|
|
{ |
63
|
0
|
|
|
|
|
|
$retString .= $self->{'_children'}->[$i]->toString($XML::Mini::NoWhiteSpaces); |
64
|
|
|
|
|
|
|
} |
65
|
0
|
|
|
|
|
|
$retString .= '"'; |
66
|
|
|
|
|
|
|
#$retString =~ s/\n//g; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
$retString .= " >\n"; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
return $retString; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub toStringNoWhiteSpaces |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
77
|
0
|
|
|
|
|
|
my $depth = shift; |
78
|
0
|
|
|
|
|
|
return $self->toString($depth); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |