line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################## |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This library is free software; you can redistribute it and/or |
4
|
|
|
|
|
|
|
# modify it under the terms of the GNU Library General Public |
5
|
|
|
|
|
|
|
# License as published by the Free Software Foundation; either |
6
|
|
|
|
|
|
|
# version 2 of the License, or (at your option) any later version. |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# This library is distributed in the hope that it will be useful, |
9
|
|
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11
|
|
|
|
|
|
|
# Library General Public License for more details. |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# You should have received a copy of the GNU Library General Public |
14
|
|
|
|
|
|
|
# License along with this library; if not, write to the |
15
|
|
|
|
|
|
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
16
|
|
|
|
|
|
|
# Boston, MA 02111-1307, USA. |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# Jabber |
19
|
|
|
|
|
|
|
# Copyright (C) 1998-2004 Jabber Software Foundation http://jabber.org/ |
20
|
|
|
|
|
|
|
# |
21
|
|
|
|
|
|
|
############################################################################## |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
package XML::Stream::XPath::Value; |
24
|
|
|
|
|
|
|
|
25
|
12
|
|
|
12
|
|
178
|
use 5.008; |
|
12
|
|
|
|
|
32
|
|
|
12
|
|
|
|
|
431
|
|
26
|
12
|
|
|
12
|
|
55
|
use strict; |
|
12
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
317
|
|
27
|
12
|
|
|
12
|
|
46
|
use warnings; |
|
12
|
|
|
|
|
21
|
|
|
12
|
|
|
|
|
342
|
|
28
|
12
|
|
|
12
|
|
53
|
use vars qw( $VERSION ); |
|
12
|
|
|
|
|
26
|
|
|
12
|
|
|
|
|
7557
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$VERSION = "1.24"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub new |
33
|
|
|
|
|
|
|
{ |
34
|
577
|
|
|
577
|
0
|
621
|
my $proto = shift; |
35
|
577
|
|
|
|
|
679
|
my $self = { }; |
36
|
|
|
|
|
|
|
|
37
|
577
|
|
|
|
|
1153
|
bless($self,$proto); |
38
|
|
|
|
|
|
|
|
39
|
577
|
|
|
|
|
1026
|
$self->setList(@_); |
40
|
577
|
|
|
|
|
957
|
$self->setValues(); |
41
|
577
|
|
|
|
|
868
|
$self->setAttribs(); |
42
|
577
|
|
|
|
|
910
|
$self->setValid(0); |
43
|
577
|
|
|
|
|
928
|
$self->in_context(0); |
44
|
|
|
|
|
|
|
|
45
|
577
|
|
|
|
|
1115
|
return $self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub setList |
50
|
|
|
|
|
|
|
{ |
51
|
1273
|
|
|
1273
|
0
|
1218
|
my $self = shift; |
52
|
1273
|
|
|
|
|
1576
|
my (@values) = @_; |
53
|
1273
|
|
|
|
|
2683
|
$self->{LIST} = \@values; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub getList |
58
|
|
|
|
|
|
|
{ |
59
|
736
|
|
|
736
|
0
|
671
|
my $self = shift; |
60
|
736
|
100
|
|
|
|
598
|
return unless ($#{$self->{LIST}} > -1); |
|
736
|
|
|
|
|
1616
|
|
61
|
720
|
|
|
|
|
648
|
return @{$self->{LIST}}; |
|
720
|
|
|
|
|
1648
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub getFirstElem |
66
|
|
|
|
|
|
|
{ |
67
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
68
|
0
|
0
|
|
|
|
0
|
return unless ($#{$self->{LIST}} > -1); |
|
0
|
|
|
|
|
0
|
|
69
|
0
|
|
|
|
|
0
|
return $self->{LIST}->[0]; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub setValues |
74
|
|
|
|
|
|
|
{ |
75
|
796
|
|
|
796
|
0
|
726
|
my $self = shift; |
76
|
796
|
|
|
|
|
815
|
my (@values) = @_; |
77
|
796
|
|
|
|
|
1312
|
$self->{VALUES} = \@values; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub getValues |
82
|
|
|
|
|
|
|
{ |
83
|
46
|
|
|
46
|
0
|
62
|
my $self = shift; |
84
|
46
|
100
|
|
|
|
45
|
return unless ($#{$self->{VALUES}} > -1); |
|
46
|
|
|
|
|
143
|
|
85
|
19
|
50
|
|
|
|
45
|
return $self->{VALUES}->[0] if !wantarray; |
86
|
19
|
|
|
|
|
19
|
return @{$self->{VALUES}}; |
|
19
|
|
|
|
|
54
|
|
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub setAttribs |
91
|
|
|
|
|
|
|
{ |
92
|
775
|
|
|
775
|
0
|
689
|
my $self = shift; |
93
|
775
|
|
|
|
|
905
|
my (%attribs) = @_; |
94
|
775
|
|
|
|
|
1305
|
$self->{ATTRIBS} = \%attribs; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub getAttribs |
99
|
|
|
|
|
|
|
{ |
100
|
48
|
|
|
48
|
0
|
68
|
my $self = shift; |
101
|
48
|
100
|
|
|
|
41
|
return unless (scalar(keys(%{$self->{ATTRIBS}})) > 0); |
|
48
|
|
|
|
|
302
|
|
102
|
2
|
|
|
|
|
4
|
return %{$self->{ATTRIBS}}; |
|
2
|
|
|
|
|
6
|
|
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub setValid |
107
|
|
|
|
|
|
|
{ |
108
|
700
|
|
|
700
|
0
|
646
|
my $self = shift; |
109
|
700
|
|
|
|
|
577
|
my $valid = shift; |
110
|
700
|
|
|
|
|
1034
|
$self->{VALID} = $valid; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub check |
115
|
|
|
|
|
|
|
{ |
116
|
123
|
|
|
123
|
0
|
161
|
my $self = shift; |
117
|
123
|
|
|
|
|
371
|
return $self->{VALID}; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub in_context |
122
|
|
|
|
|
|
|
{ |
123
|
1139
|
|
|
1139
|
0
|
1061
|
my $self = shift; |
124
|
1139
|
|
|
|
|
914
|
my $in_context = shift; |
125
|
|
|
|
|
|
|
|
126
|
1139
|
100
|
|
|
|
1856
|
if (defined($in_context)) |
127
|
|
|
|
|
|
|
{ |
128
|
1031
|
|
|
|
|
1171
|
$self->{INCONTEXT} = $in_context; |
129
|
|
|
|
|
|
|
} |
130
|
1139
|
|
|
|
|
1506
|
return $self->{INCONTEXT}; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub display |
135
|
|
|
|
|
|
|
{ |
136
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
137
|
0
|
|
|
|
|
|
if (0) |
138
|
|
|
|
|
|
|
{ |
139
|
|
|
|
|
|
|
print "VALUE: list(",join(",",@{$self->{LIST}}),")\n"; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
else |
142
|
|
|
|
|
|
|
{ |
143
|
0
|
|
|
|
|
|
print "VALUE: list(\n"; |
144
|
0
|
|
|
|
|
|
foreach my $elem (@{$self->{LIST}}) |
|
0
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
{ |
146
|
0
|
|
|
|
|
|
print "VALUE: ",$elem->GetXML(),"\n"; |
147
|
|
|
|
|
|
|
} |
148
|
0
|
|
|
|
|
|
print "VALUE: )\n"; |
149
|
|
|
|
|
|
|
} |
150
|
0
|
|
|
|
|
|
print "VALUE: values(",join(",",@{$self->{VALUES}}),")\n"; |
|
0
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
1; |
154
|
|
|
|
|
|
|
|