File Coverage

lib/XML/Filter/XML_Directory_2RSS/Items.pm
Criterion Covered Total %
statement 6 30 20.0
branch 0 12 0.0
condition 0 3 0.0
subroutine 2 7 28.5
pod 5 5 100.0
total 13 57 22.8


line stmt bran cond sub pod time code
1             {
2              
3             =head1 NAME
4              
5             XML::Filter::XML_Directory_2RSS::Items - SAX2 filter for adding channel items for XML::Filter::XML_Directory_2RSS
6              
7             =head1 SYNOPSIS
8              
9             There is none.
10              
11             =head1 DESCRIPTION
12              
13             SAX2 filter for adding channel items for XML::Filter::XML_Directory_2RSS.
14              
15             This is used internally by XML::Filter::XML_Directory_2RSS.
16              
17             =cut
18              
19             package XML::Filter::XML_Directory_2RSS::Items;
20 1     1   6 use strict;
  1         2  
  1         48  
21              
22 1     1   5 use base qw (XML::Filter::XML_Directory_2RSS::Base);
  1         3  
  1         405  
23              
24             $XML::Filter::XML_Directory_2RSS::Items::VERSION = 1.0;
25              
26 0     0 1   sub start_document {}
27 0     0 1   sub end_document {}
28              
29             sub start_element {
30 0     0 1   my $self = shift;
31 0           my $data = shift;
32              
33 0 0         $self->on_enter_start_element($data) || return;
34              
35 0 0         if ($data->{Name} =~ /^(file|directory)$/) {
36              
37 0           $self->{'__dlevel'} ++;
38              
39 0 0         if ($self->{'__dlevel'} == 1) {
40 0           $self->SUPER::start_element({
41             Name => "rdf:li",
42             Attributes => $self->rdf_resource($self->make_link($data)),
43             });
44 0           $self->SUPER::end_element({Name=>"rdf:li"});
45             }
46             }
47              
48 0           return 1;
49             }
50              
51             sub end_element {
52 0     0 1   my $self = shift;
53 0           my $data = shift;
54              
55 0           $self->on_enter_end_element($data);
56              
57 0 0 0       if (($self->{'__start'}) && (! $self->{'__skip'})) {
58 0 0         if ($data->{Name} =~ /^(file|directory)$/) {
59              
60 0           $self->prune_cwd($data);
61              
62 0 0         if ($self->{'__dlevel'}) {
63 0           $self->{'__dlevel'} --;
64             }
65             }
66             }
67              
68 0           $self->on_exit_end_element();
69 0           return 1;
70             }
71              
72             sub characters {
73 0     0 1   my $self = shift;
74 0           my $data = shift;
75 0           $self->on_characters($data);
76             }
77              
78             =head1 VERSION
79              
80             1.0
81              
82             =head1 DATE
83              
84             May 13, 2002
85              
86             =head1 AUTHOR
87              
88             Aaron Straup Cope
89              
90             =head1 SEE ALSO
91              
92             L
93              
94             =head1 LICENSE
95              
96             Copyright (c) 2002, Aaron Straup Cope. All Rights Reserved.
97              
98             This is free software, you may use it and distribute it under the same terms as Perl itself.
99              
100             =cut
101              
102             return 1;
103              
104             }