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

Class: XML_Feed_Parser_Atom

Source Location: /XML_Feed_Parser-1.0.0RC1/Parser/Atom.php

Class Overview

XML_Feed_Parser_Type
   |
   --XML_Feed_Parser_Atom

This is the class that determines how we manage Atom 1.0 feeds


Author(s):

Version:

  • Release: @package_version@

Methods


Child classes:

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.

Inherited Variables

Inherited Methods

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::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::processXHTMLAttributes()
Part of our xml:base processing code
XML_Feed_Parser_Type::traverseNode()
Part of our xml:base processing code

Class Details

[line 36]
This is the class that determines how we manage Atom 1.0 feeds

How we deal with constructs: date - return as unix datetime for use with the 'date' function unless specified otherwise text - return as is. optional parameter will give access to attributes person - defaults to name, but parameter based access



[ Top ]


Method Detail

getCategory   [line 294]

string getCategory( string $method, array $arguments)

Get a category from the entry.

A feed or entry can have any number of categories. A category can have the attributes term, scheme and label.


Overrides XML_Feed_Parser_Type::getCategory() (Apply various rules to retrieve category data.)

Parameters:

string   $method     The name of the text construct we want
array   $arguments     An array which we hope gives a 'param'

[ Top ]

getEntryById   [line 141]

XML_Feed_Parser_AtomElement getEntryById( string $id)

Implement retrieval of an entry based on its ID for atom feeds.

This function uses XPath to get the entry based on its ID. If DOMXPath::evaluate is available, we also use that to store a reference to the entry in the array used by getEntryByOffset so that method does not have to seek out the entry if it's requested that way.


Parameters:

string   $id     any valid Atom ID.

[ Top ]

getLink   [line 319]

string getLink( [int $offset = 0], [string $attribute = 'href'], [array $params = false])

This element must be present at least once with rel="feed". This element may be present any number of further times so long as there is no clash. If no 'rel' is present and we're asked for one, we follow the example of the Universal Feed Parser and presume 'alternate'.
  • Return: the value of the attribute

Parameters:

int   $offset     the position of the link within the container
string   $attribute     the attribute name required
array   $params     an array of attributes to search by

[ Top ]

getPerson   [line 175]

string|false getPerson( string $method, array $arguments)

Retrieves data from a person construct.

Get a person construct. We default to the 'name' element but allow access to any of the elements.


Parameters:

string   $method     The name of the person construct we want
array   $arguments     An array which we hope gives a 'param'

[ Top ]

getText   [line 209]

string getText( string $method, array $arguments)

Retrieves an element's content where that content is a text construct.

Get a text construct. When calling this method, the two arguments allowed are 'offset' and 'attribute', so $parser->subtitle() would return the content of the element, while $parser->subtitle(false, 'type') would return the value of the type attribute.

  • Todo: Clarify overlap with getContent()

Overrides XML_Feed_Parser_Type::getText() (Get a text construct.)

Parameters:

string   $method     The name of the text construct we want
array   $arguments     An array which we hope gives a 'param'

[ Top ]

parseTextConstruct   [line 250]

String parseTextConstruct( mixed DOMNode$content, DOMNode $content)

Extract content appropriately from atom text constructs

Because of different rules applied to the content element and other text constructs, they are deployed as separate functions, but they share quite a bit of processing. This method performs the core common process, which is to apply the rules for different mime types in order to extract the content.

  • Author: James Stewart

Parameters:

DOMNode   $content     the text construct node to be parsed

[ Top ]


Documentation generated on Thu, 27 Jul 2006 10:11:51 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.