Dave Rolsky > XML-Generator-RSS10 > XML::Generator::RSS10

Download:
XML-Generator-RSS10-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

XML::Generator::RSS10 - Generate SAX events for RSS

VERSION ^

version 0.02

SYNOPSIS ^

    use XML::Generator::RSS10;

    my $rss = XML::Generator::RSS10->new( Handler => $sax_handler );

    $rss->item( title => 'Exciting News About my Pants!',
                link  => 'http://pants.example.com/my/news.html',
                description => 'My pants are full of ants!',
              );

    $rss->channel( title => 'Pants',
                   link  => 'http://pants.example.com/',
                   description => 'A fascinating pants site',
                 );

DESCRIPTION ^

This module generates SAX events which will create an RSS 1.0 document, based on easy to use RSS-related methods like item() and channel().

METHODS ^

new

This is the constructor for this class.

It takes several parameters, though only one, "Handler", is required:

The constructor begins the RSS document and returns a new XML::Generator::RSS10 object.

item

This method is used to add item elements to the document. It accepts the following parameters:

image

This method is used to add an image element to the document. It may only be called once. It accepts the following parameters:

textinput

This method is used to add an textinput element to the document. It may only be called once. It accepts the following parameters:

channel

This method is used add the channel element to the document. It also finishes the document. You must have added at least one item to the document prior to calling this method.

You may not call any other methods after this one is called.

RSS 1.0 MODULES ^

To add module output to a document, you can pass extra hash keys when calling any of the output-generating methods. The extra keys should be the module prefixes, and the values should be something expected by the relevant module.

For example, to add some Dublin Core elements to the channel element, you can write this:

    $rss->channel( title => 'Pants',
                   link  => 'http://pants.example.com/',
                   description => 'A fascinating pants site',
                   dc    => { publisher => 'The Pants People',
                              rights    => 'Mine, all mine!',
                              date      => $date,
                            },
                 );

The values for the "dc" key will be passed to XML::Generator::RSS10::dc, which will add them to the output stream appropriately.

XML::Generator::RSS10 VERSUS XML::RSS ^

This module is less flexible than XML::RSS in many ways. However, it does have two features that XML::RSS does not provide:

However, if you don't need any of these features you may be better off using XML::RSS instead.

BUGS ^

Please report any bugs or feature requests to bug-xml-generator-rss10@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: