line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Handler::ExtOn::TieAttrsName; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#$id$ |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
41
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
255
|
|
6
|
7
|
|
|
7
|
|
36
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
183
|
|
7
|
7
|
|
|
7
|
|
36
|
use XML::Handler::ExtOn::TieAttrs; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
172
|
|
8
|
7
|
|
|
7
|
|
47
|
use base 'XML::Handler::ExtOn::TieAttrs'; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
3456
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub GetKeys { |
11
|
3
|
|
|
3
|
0
|
4
|
my $self = shift; |
12
|
3
|
|
|
|
|
5
|
return [ map { $_->{Name} } values %{ $self->get_by_filter } ]; |
|
13
|
|
|
|
|
33
|
|
|
3
|
|
|
|
|
7
|
|
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub create_attr { |
16
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
17
|
1
|
|
|
|
|
3
|
my $key = shift; |
18
|
1
|
|
|
|
|
5
|
my %template = |
19
|
1
|
|
|
|
|
11
|
( %{ $self->_template() }, @{ $self->_default() }, LocalName => $key ); |
|
1
|
|
|
|
|
21
|
|
20
|
1
|
|
|
|
|
4
|
my ( $prefix ) = $key =~ /([^:]+):/; |
21
|
1
|
|
|
|
|
2
|
my $local_name = $key; |
22
|
1
|
50
|
|
|
|
5
|
$template{Name} = $prefix ? "$prefix:$local_name" : $local_name; |
23
|
1
|
|
|
|
|
6
|
$template{NamespaceURI} = $self->{context}->get_uri($prefix); |
24
|
1
|
|
|
|
|
70
|
return &XML::Handler::ExtOn::TieAttrs::attr_from_sax2( { 1 => \%template } ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_by_filter { |
28
|
32
|
|
|
32
|
0
|
44
|
my $self = shift; |
29
|
32
|
|
|
|
|
37
|
my $flocal_name = shift; |
30
|
32
|
|
|
|
|
65
|
my $ahash = $self->_orig_hash; |
31
|
32
|
|
|
|
|
46
|
my %res = (); |
32
|
32
|
|
|
|
|
31
|
my ( $field_name, $value ) = @{ $self->_default() }; |
|
32
|
|
|
|
|
69
|
|
33
|
32
|
|
|
|
|
36
|
my $i = -1; |
34
|
32
|
|
|
|
|
43
|
foreach my $val (@$ahash) { |
35
|
141
|
|
|
|
|
116
|
$i++; |
36
|
141
|
100
|
|
|
|
221
|
if ( defined $flocal_name ) { |
37
|
128
|
100
|
|
|
|
291
|
next unless $val->{Name} eq $flocal_name; |
38
|
|
|
|
|
|
|
} |
39
|
41
|
|
|
|
|
81
|
$res{$i} = $val; |
40
|
|
|
|
|
|
|
} |
41
|
32
|
|
|
|
|
130
|
return \%res; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
1; |