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

Class: XML_Feed_Parser_AtomElement

Source Location: /XML_Feed_Parser-1.0.5/XML/Feed/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:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods

Class: XML_Feed_Parser_Atom

XML_Feed_Parser_Atom::__construct()
Our constructor does nothing more than its parent.
XML_Feed_Parser_Atom::getCategory()
Get a category from the entry.
XML_Feed_Parser_Atom::getEntryById()
Implement retrieval of an entry based on its ID for atom feeds.
XML_Feed_Parser_Atom::getLink()
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'.
XML_Feed_Parser_Atom::getPerson()
Retrieves data from a person construct.
XML_Feed_Parser_Atom::getText()
Retrieves an element's content where that content is a text construct.
XML_Feed_Parser_Atom::parseTextConstruct()
Extract content appropriately from atom text constructs

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 atom entries. It will usually be called by XML_Feed_Parser_Atom with which it shares many methods.


[ Top ]


Class Variables

$compatMap = array(
        'guid' => array('id'),'links'=>array('link'),'tags'=>array('category'),'contributors'=>array('contributor'))

[line 61]

Here we provide a few mappings for those very special circumstances in

which it makes sense to map back to the RSS2 spec or to manage other compatibilities (eg. with the Univeral Feed Parser). Key is the other version's name for the command, value is an array consisting of the equivalent in our atom api and any attributes needed to make the mapping.

  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$map = array(
        'author' => array('Person', 'fallback'),'contributor'=>array('Person'),'id'=>array('Text','fail'),'published'=>array('Date'),'updated'=>array('Date','fail'),'title'=>array('Text','fail'),'rights'=>array('Text','fallback'),'summary'=>array('Text'),'content'=>array('Content'),'link'=>array('Link'),'enclosure'=>array('Enclosure'),'category'=>array('Category'))

[line 71]

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 ]

$xmlBase =

[line 51]

xml:base values inherited by the element
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 91]

XML_Feed_Parser_AtomElement __construct( DOMElement $element, XML_Feed_Parser_Atom $parent, [ $xmlBase = ''])

Store useful information for later.

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

Parameters:

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

[ Top ]

getAuthor   [line 115]

string getAuthor( array $arguments)

Provides access to specific aspects of the author data for an atom entry

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 158]

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

Returns the content of the content element or info on a specific attribute

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. The method can take an 'attribute' argument, in which case we return the value of that attribute if present. eg. $item->content("type") will return the type of the content. It is recommended that all users check the type before getting the content to ensure that their script is capable of handling the type of returned data. (data carried in the content element can be either 'text', 'html', 'xhtml', or any standard MIME type).

  • Access: protected

Overrides XML_Feed_Parser_Type::getContent() (Get content from RSS feeds (atom has its own implementation))

Parameters:

   $method   — 
   $arguments   — 

[ Top ]

getEnclosure   [line 203]

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

For compatibility, this method provides a mapping to access enclosures.

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 241]

XML_Feed_Parser_Atom|false getSource( )

Get details of this entry's source, if available/relevant

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 ]

__toString   [line 259]

string __toString( )

Get the entry as an XML string

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.

  • Return: XML serialization of element

Overrides 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.)
[ Top ]


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