XML::Atom::Ext::OpenSearch - XML::Atom extension for OpenSearch data


XML-Atom-Ext-OpenSearch documentation Contained in the XML-Atom-Ext-OpenSearch distribution.

Index


Code Index:

NAME

Top

XML::Atom::Ext::OpenSearch - XML::Atom extension for OpenSearch data

SYNOPSIS

Top

    use XML::Atom::Feed;
    use XML::Atom::Ext::OpenSearch;

    my $feed = XML::Atom::Feed->new;
    $feed->totalResults( $total );

DESCRIPTION

Top

This module is an extension to XML::Atom which will let you read and write feeds that use OpenSearch data. OpenSearch provides some extra elements to serialize search results as an Atom feed. See the specification (http://www.opensearch.org/Specifications/OpenSearch/1.1) for more information.

METHODS

Top

totalResults( $results )

startIndex( $index )

itemsPerPage( $items )

Query( )

In list context, returns all query elements in the document. In scalar context, returns the first query element found.

add_Query( $object )

element_ns( )

Returns the opensearch namespace, http://a9.com/-/spec/opensearch/1.1.

AUTHOR

Top

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE

Top

SEE ALSO

Top

* XML::Atom

XML-Atom-Ext-OpenSearch documentation Contained in the XML-Atom-Ext-OpenSearch distribution.
package XML::Atom::Ext::OpenSearch;

use strict;
use warnings;

use base qw( XML::Atom::Base );
use XML::Atom::Feed;

use XML::Atom::Ext::OpenSearch::Query;

our $VERSION = '0.02';

BEGIN {
    XML::Atom::Feed->mk_elem_accessors(
        qw(totalResults startIndex itemsPerPage),
        [   XML::Atom::Namespace->new(
                "opensearch" => q{http://a9.com/-/spec/opensearch/1.1/}
            )
        ]
    );

    XML::Atom::Feed->mk_object_list_accessor(
        Query => 'XML::Atom::Ext::OpenSearch::Query' );
}

sub element_ns {
    return XML::Atom::Namespace->new(
        "opensearch" => q{http://a9.com/-/spec/opensearch/1.1/} );
}

1;