# Copyright (c) 2004-2005 Timothy Appnel # http://www.timaoutloud.org/ # This code is released under the Artistic License. # # XML::RAI::Image - An interface to the image elements of a RSS feed. # package XML::RAI::Image; use strict; use vars qw(@ISA $XMap); @ISA = qw( XML::RAI::Object ); $XMap = { url=>['/channel/image[0]/@rdf:resource','/channel/image[0]/url'], height=>['/channel/image[0]/height','/channel/image[0]/rss091:height'], width=>['/channel/image[0]/width','/channel/image[0]/rss091:width'] }; 1; __END__ =begin =head1 NAME XML::RAI::Image - An interface to the image elements of a RSS feed. =head1 DESCRIPTION A subclass of L, XML::RAI::Image handles the mapping function and retrieval of RSS channel elements. =head1 METHODS =item $image->src Returns the L that the object is using as its source. =item $image->parent Returns the parent of the RAI object. =head2 META DATA ACCESSORS These accessor methods attempt to retrieve meta data from the source L element by checking a list of potential tag names until one returns a value. They are generally based on Dublin Core terminology and RSS elements that are common across the many formats. If called in a SCALAR context, the value of the first element of the tag being matched is returned. If called in an ARRAY context it will return all of the values to the tag being matched -- it does not return all of the values for all of the tags that have been mapped to the method. (Note that some mappings only allow one value to be returned.) Returns C if nothing could be found. The following are the tags (listed in XPath notation) mapped to each method and the order in which they are checked. =item $image->height =over 4 =item * /channel/image[0]/height =item * /channel/image[0]/rss091:height =back =item $image->url =over 4 =item * /channel/image[0]/url =back =item $image->width =over 4 =item * /channel/image[0]/width =item * /channel/image[0]/rss091:width =back =head1 AUTHOR & COPYRIGHT Please see the XML::RAI manpage for author, copyright, and license information. =cut =end