| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | ## XML::Generator::RSS10::lgcl | 
| 2 |  |  |  |  |  |  | ## An extension to Dave Rolsky's XML::Generator::RSS10 to handle categories in the UK Local 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: Monday, 6 December 2004 | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | package XML::Generator::RSS10::lgcl; | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | $VERSION = '0.02'; | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 1 |  |  | 1 |  | 32371 | use strict; | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 43 |  | 
| 13 | 1 |  |  | 1 |  | 6 | use Carp; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 106 |  | 
| 14 |  |  |  |  |  |  |  | 
| 15 | 1 |  |  | 1 |  | 5 | use base 'XML::Generator::RSS10::Module'; | 
|  | 1 |  |  |  |  | 7 |  | 
|  | 1 |  |  |  |  | 1232 |  | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | 1; | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | #### | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | sub NamespaceURI { | 
| 22 |  |  |  |  |  |  |  | 
| 23 | 0 |  |  | 0 | 0 |  | 'http://www.esd.org.uk/standards/lgcl/1.03/lgcl-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('lgcl',$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('lgcl',$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__ |