View on
MetaCPAN
Andrew Green > XML-Generator-RSS10-egms-0.01 > XML::Generator::RSS10::egms

Download:
XML-Generator-RSS10-egms-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source   Latest Release: XML-Generator-RSS10-egms-0.02

NAME ^

XML::Generator::RSS10::egms - Support for the UK e-Government Metadata Standard (egms) RSS 1.0 specfication

SYNOPSIS ^

    use XML::Generator::RSS10;
    
    my $rss = XML::Generator::RSS10->new( Handler => $sax_handler, modules => [ qw(dc egms gcl lgcl) ] );
    
    $rss->item(
                title => '2004 Council By-Election Results',
                link  => 'http://www.example.gov.uk/news/elections.html',
                description => 'Results for the 2004 Council by-elections',
                dc => {
                   date    => '2004-05-01',
                   creator => 'J. Random Reporter, Example Borough Council, j.r.reporter@example.gov.uk',
                },
                egms => {
                   SubjectCategory => [
                                         ['GCL','Local government'],
                                         ['LGCL','Elections'],
                                         ['LGCL','News announcements']
                                      ]
                }
              );
    
    $rss->channel(
                   title => 'Example Borough Council News',
                   link  => 'http://www.example.gov.uk/news/',
                   description => 'News releases from Example Borough Council',
                   dc => {
                      date       => '2004-05-01',
                      creator    => 'J. Random Administrator, Example Borough Council, j.r.administrator@example.gov.uk',
                      publisher  => 'Example Borough Council',
                      rights     => 'Copyright (c) Example Borough Council',
                      language   => 'en',
                      coverage   => 'Example, County, UK'
                   },
                   egms => {
                      SubjectCategory => [
                                            ['GCL','Local government'],
                                            ['LGCL','News announcements']
                                         ]
                   }
                 );

DESCRIPTION ^

This module extends Dave Rolsky's XML::Generator::RSS10 to provide support for the UK e-Government Metadata Standard (egms) RSS 1.0 specfication.

For UK government RSS feeds, much of the mandatory eGMS metadata is provided through the standard Dublin Core module. However, the subject category metadata is mandatory, and uses rather more complicated RDF XML notation than regular Dublin Core, principally because you're encouraged to pass more than one category for each item.

I've taken the specification for using eGMS metadata in RSS feeds from the LAWS Syndication Guidelines, at http://www.esd-toolkit.org/laws/.

eGMS category metadata is mandated at both the item and channel levels.

For the SubjectCategory element, this module expects to receive an array of categories, where each category is itself an array comprising the name of the controlled list from which the category was taken, and then the category value.

You may pass as many categories as you wish. For each, the module will assess whether the category is taken from the GCL or LGCL lists and build the RSS code appropriately. If your category is taken from a different list, such as the APLAWS list, the module will treat the category in a generic way, as per the guidelines.

    $rss->item(
                # title, link, description, dc, etc...
                egms => {
                   SubjectCategory => [
                                         ['APLAWS','Council and democracy']
                                      ]
                }
              );

    $rss->item(
                # title, link, description, dc, etc...
                egms => {
                   SubjectCategory => [
                                         [undef,'Pants']
                                      ]
                }
              );

Alternatively, you may choose to pass a scalar SubjectCategory, which will be handled as a single, generic category.

    $rss->item(
                # title, link, description, dc, etc...
                egms => {
                   SubjectCategory => 'news'
                }
              );

CAVEAT ^

If your category metadata is taken from either the GCL or the LGCL, you must remember to pass the relevant modules to the XML::Generator::RSS10 constructor, like so:

    my $rss = XML::Generator::RSS10->new( Handler => $sax_handler, modules => [ qw(dc egms gcl lgcl) ] );

This is because the specification demands that references to categories in the GCL or LGCL must use the correct XML namespace.

BUGS ^

Please let me know of any you find. You can use the CPAN bug tracker for this by emailing bug-XML-Generator-RSS10-egms@rt.cpan.org.

TO DO ^

The syndication guidelines also note the optional eGMS elements and their refinements that aren't expressed in Dublin Core. Nothing is yet done in this module to specifically support those elements.

SEE ALSO ^

XML::Generator::RSS10

AUTHOR ^

Andrew Green, <andrew@article7.co.uk>.

Sponsored by Woking Borough Council, http://www.woking.gov.uk/.

LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: