line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## XML::Generator::RSS10::gcl |
2
|
|
|
|
|
|
|
## An extension to Dave Rolsky's XML::Generator::RSS10 to handle categories in the UK Government Category List |
3
|
|
|
|
|
|
|
## To be used in conjunction with XML::Generator::RSS10::egms |
4
|
|
|
|
|
|
|
## Written by Andrew Green, Article Seven, http://www.article7.co.uk/ |
5
|
|
|
|
|
|
|
## Sponsored by Woking Borough Council, http://www.woking.gov.uk/ |
6
|
|
|
|
|
|
|
## Last updated: Wednesday, 8 September 2004 |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package XML::Generator::RSS10::gcl; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.01'; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
27330
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
13
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
93
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
6
|
use base 'XML::Generator::RSS10::Module'; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
1257
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#### |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub NamespaceURI { |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
0
|
|
'http://www.esd.org.uk/standards/gcl/2.00/gcl-schema#' |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#### |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub category { |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
0
|
|
my ($self,$rss,$category_value) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $camelcategory = $self->_camelcase($category_value); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$rss->_start_element('gcl',$camelcategory); |
36
|
0
|
|
|
|
|
|
$rss->_newline_if_pretty; |
37
|
0
|
|
|
|
|
|
$rss->_element_with_data('rdf','value',$category_value); |
38
|
0
|
|
|
|
|
|
$rss->_newline_if_pretty; |
39
|
0
|
|
|
|
|
|
$rss->_end_element('gcl',$camelcategory); |
40
|
0
|
|
|
|
|
|
$rss->_newline_if_pretty; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
#### |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _camelcase { |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
|
|
my ($self,$cat) = @_; |
49
|
0
|
|
|
|
|
|
$cat =~ s/\s*(\w+)\s*/\u\L$1/g; |
50
|
0
|
|
|
|
|
|
$cat =~ s/[^A-Za-z]//g; |
51
|
0
|
|
|
|
|
|
return $cat; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
#### |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |