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

Class: XML_Feed_Parser_AtomElement

Source Location: /XML_Feed_Parser-0.2.4alpha/Parser/AtomElement.php

Class Overview

XML_Feed_Parser_Type
   |
   --XML_Feed_Parser_Atom
      |
      --XML_Feed_Parser_AtomElement

This class provides support for atom entries. It will usually be called by XML_Feed_Parser_Atom with which it shares many methods.


Author(s):

Version:

  • 0.2.2 22nd September 2005

Methods


Inherited Variables

Inherited Methods

Class: XML_Feed_Parser_Atom

XML_Feed_Parser_Atom::getEntryById()
This function uses XPath to get the entry based on its ID. Ideally we would also use XPath to find the offset of that node and therefore cache it, but the necessary XPath support isn't coming until at least PHP5.1.

Class: XML_Feed_Parser_Type

XML_Feed_Parser_Type::addBase()
getBase gets us the xml:base data. We then need to process that with regard to our current link. This function does that and returns the link in as complete a form as possible.
XML_Feed_Parser_Type::count()
This function will tell us how many times the element $type appears at this level of the feed.
XML_Feed_Parser_Type::getBase()
We will often need to extract the xml:base values that apply to a link. This method iterates through the heirarchy and extracts the relevant attributes, and then combines them.
XML_Feed_Parser_Type::getCategory()
There is no single way of declaring a category in RSS1 or Atom as there is in RSS2.
XML_Feed_Parser_Type::getDate()
Get a date construct. We use PHP's strtotime to return it as a unix datetime
XML_Feed_Parser_Type::getEntryByOffset()
Pretty fundamental!
XML_Feed_Parser_Type::getText()
Get a text construct.

Class Details

[line 33]
This class provides support for atom entries. It will usually be called by XML_Feed_Parser_Atom with which it shares many methods.


[ Top ]


Method Detail

getAuthor   [line 103]

string getAuthor( array $arguments)

author data at the entry level is more complex than at the feed level.

If atom:author is not present for the entry we need to look for it in an atom:source child of the atom:entry. If it's not there either, then we look to the parent for data.


Parameters:

array   $arguments     

[ Top ]

getContent   [line 139]

string|false getContent( )

This element may or may not be present. It cannot be present more than once. It may have a 'src' attribute, in which case there's no content If not present, then the entry must have link with rel="alternate".

If there is content we return it, if not and there's a 'src' attribute we return the value of that instead.

  • Todo: Be clearer about content types

[ Top ]

getEnclosure   [line 172]

array|false getEnclosure( string $method, [array $arguments = array()])

The Atom spec doesn't provide for an enclosure element, but it is generally supported using the link element with rel='enclosure'.

Parameters:

string   $method     - for compatibility with our __call usage
array   $arguments     - for compatibility with our __call usage

[ Top ]

getSource   [line 200]

XML_Feed_Parser_Atom|false getSource( )

Where an atom:entry is taken from another feed then the aggregator

is supposed to include an atom:source element which replicates at least the atom:id, atom:title, and atom:updated metadata from the original feed. Atom:source therefore has a very similar structure to atom:feed and if we find it we will return it as an XML_Feed_Parser_Atom object.


[ Top ]


Documentation generated on Tue, 11 Oct 2005 11:05:25 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.