XML_Feed_Parser
[ class tree: XML_Feed_Parser ] [ index: XML_Feed_Parser ] [ all elements ]

Class: XML_Feed_Parser_RSS2Element

Source Location: /XML_Feed_Parser-1.0.5/XML/Feed/Parser/RSS2Element.php

Class Overview

XML_Feed_Parser_Type
   |
   --XML_Feed_Parser_RSS2
      |
      --XML_Feed_Parser_RSS2Element

This class provides support for RSS 2.0 entries. It will usually be called by XML_Feed_Parser_RSS2 with which it shares many methods.


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods

Class: XML_Feed_Parser_RSS2

XML_Feed_Parser_RSS2::__construct()
Our constructor does nothing more than its parent.
XML_Feed_Parser_RSS2::getCategory()
Get a category from the element
XML_Feed_Parser_RSS2::getCloud()
Return content of the little-used 'cloud' element
XML_Feed_Parser_RSS2::getEntryById()
Retrieves an entry by ID, if the ID is specified with the guid element
XML_Feed_Parser_RSS2::getImage()
Get details of the image associated with the feed.
XML_Feed_Parser_RSS2::getLink()
Get link URL
XML_Feed_Parser_RSS2::getSkipDays()
Retrieve skipDays data
XML_Feed_Parser_RSS2::getSkipHours()
Retrieve skipHours data
XML_Feed_Parser_RSS2::getSkips()
Utility function for getSkipDays and getSkipHours
XML_Feed_Parser_RSS2::getTextInput()
The textinput element is little used, but in the interests of completeness...

Class: XML_Feed_Parser_Type

XML_Feed_Parser_Type::addBase()
Determine whether we need to apply our xml:base rules
XML_Feed_Parser_Type::combineBases()
Utility function to help us resolve xml:base values
XML_Feed_Parser_Type::count()
Count occurrences of an element
XML_Feed_Parser_Type::getCategory()
Apply various rules to retrieve category data.
XML_Feed_Parser_Type::getContent()
Get content from RSS feeds (atom has its own implementation)
XML_Feed_Parser_Type::getDate()
Return a date in seconds since epoch.
XML_Feed_Parser_Type::getEntryByOffset()
Get an entry by its position in the feed, starting from zero
XML_Feed_Parser_Type::getSanitizer()
XML_Feed_Parser_Type::getSchemaDir()
Get directory holding RNG schemas. Method is based on that found in Contact_AddressBook.
XML_Feed_Parser_Type::getText()
Get a text construct.
XML_Feed_Parser_Type::hasKey()
Checks if this element has a particular child element.
XML_Feed_Parser_Type::processEntitiesForNodeValue()
Convert HTML entities based on the current character set.
XML_Feed_Parser_Type::processXHTMLAttributes()
Part of our xml:base processing code
XML_Feed_Parser_Type::relaxNGValidate()
XML_Feed_Parser_Type::setSanitizer()
XML_Feed_Parser_Type::traverseNode()
Part of our xml:base processing code
XML_Feed_Parser_Type::__call()
Proxy to allow use of element names as method names
XML_Feed_Parser_Type::__get()
Proxy to allow use of element names as attribute names
XML_Feed_Parser_Type::__toString()
Return an XML serialization of the feed, should it be required. Most users however, will already have a serialization that they used when instantiating the object.

Class Details

[line 32]
This class provides support for RSS 2.0 entries. It will usually be called by XML_Feed_Parser_RSS2 with which it shares many methods.


[ Top ]


Class Variables

$compatMap = array(
        'id' => array('guid'),'updated'=>array('lastBuildDate'),'published'=>array('pubdate'),'guidislink'=>array('guid','ispermalink'),'summary'=>array('description'))

[line 63]

Here we map some elements to their atom equivalents. This is going to be quite tricky to pull off effectively (and some users' methods may vary) but is worth trying. The key is the atom version, the value is RSS2.
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$map = array(
        'title' => array('Text'),'guid'=>array('Guid'),'description'=>array('Text'),'author'=>array('Text'),'comments'=>array('Text'),'enclosure'=>array('Enclosure'),'pubDate'=>array('Date'),'source'=>array('Source'),'link'=>array('Text'),'content'=>array('Content'))

[line 45]

Our specific element map
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$parent =

[line 39]

This will be a reference to the parent object for when we want

to use a 'fallback' rule

  • Access: protected



[ Top ]



Method Detail

__construct (Constructor)   [line 76]

XML_Feed_Parser_RSS2Element __construct( DOMElement $element, XML_Feed_Parser_RSS2 $parent, [ $xmlBase = ''])

Store useful information for later.

Overrides XML_Feed_Parser_RSS2::__construct() (Our constructor does nothing more than its parent.)

Parameters:

DOMElement   $element   —  - this item as a DOM element
XML_Feed_Parser_RSS2   $parent   —  - the feed of which this is a member
   $xmlBase   — 

[ Top ]

getEnclosure   [line 124]

array|false getEnclosure( string $method, array $parameters)

Access details of file enclosures

The RSS2 spec is ambiguous as to whether an enclosure element must be unique in a given entry. For now we will assume it needn't, and allow for an offset.

  • Access: protected

Parameters:

string   $method   —  - the method being called
array   $parameters   —  - we expect the first of these to be our offset

[ Top ]

getGuid   [line 97]

string getGuid( string $method, array $params)

Get the value of the guid element, if specified

guid is the closest RSS2 has to atom's ID. It is usually but not always a URI. The one attribute that RSS2 can posess is 'ispermalink' which specifies whether the guid is itself dereferencable. Use of guid is not obligatory, but is advisable. To get the guid you would call $item->id() (for atom compatibility) or $item->guid(). To check if this guid is a permalink call $item->guid("ispermalink").

  • Return: the guid or value of ispermalink
  • Access: protected

Parameters:

string   $method   —  - the method name being called
array   $params   —  - parameters required

[ Top ]

getSource   [line 156]

array|false getSource( )

Get the entry source if specified

source is an optional sub-element of item. Like atom:source it tells us about where the entry came from (eg. if it's been copied from another feed). It is not a rich source of metadata in the same way as atom:source and while it would be good to maintain compatibility by returning an XML_Feed_Parser_RSS2 element, it makes a lot more sense to return an array.

  • Access: protected

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:47:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.