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

Class: XML_Feed_Parser_RSS11Element

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

Class Overview

XML_Feed_Parser_Type
   |
   --XML_Feed_Parser_RSS11
      |
      --XML_Feed_Parser_RSS11Element

RSS1 Element class for XML_Feed_Parser


Author(s):

Version:

  • CVS: $Id$

Copyright:

  • 2005 James Stewart <james@jystewart.net>

Variables

Methods


Inherited Variables

Inherited Methods

Class: XML_Feed_Parser_RSS11

XML_Feed_Parser_RSS11::__construct()
Our constructor does nothing more than its parent.
XML_Feed_Parser_RSS11::getAuthor()
Attempts to discern authorship
XML_Feed_Parser_RSS11::getEntryById()
Attempts to identify an element by ID given by the rdf:about attribute
XML_Feed_Parser_RSS11::getImage()
Get details of the image associated with the feed.
XML_Feed_Parser_RSS11::getLink()
Retrieve a link
XML_Feed_Parser_RSS11::getTextInput()
The textinput element is little used, but in the interests of completeness we will support it.

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]
RSS1 Element class for XML_Feed_Parser

PHP versions 5

LICENSE: This source file is subject to version 3.0 of the PHP license that is available through the world-wide-web at the following URI: http://www.php.net/license/3_0.txt. If you did not receive a copy of the PHP License and are unable to obtain it through the web, please send a note to license@php.net so we can mail you a copy immediately.



[ Top ]


Class Variables

$compatMap = array(
        'content' => array('content'),'updated'=>array('lastBuildDate'),'published'=>array('date'),'subtitle'=>array('description'),'updated'=>array('date'),'author'=>array('creator'),'contributor'=>array('contributor'))

[line 65]

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 RSS1.
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$map = array(
        'id' => array('Id'),'title'=>array('Text'),'link'=>array('Link'),'description'=>array('Text'),# or dc:description
'category'=>array('Category'),'rights'=>array('Text'),# dc:rights
'creator'=>array('Text'),# dc:creator
'publisher'=>array('Text'),# dc:publisher
'contributor'=>array('Text'),# dc:contributor
'date'=>array('Date'),# dc:date
'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 81]

XML_Feed_Parser_RSS11Element __construct( DOMElement $element, XML_Feed_Parser_RSS1 $parent, [ $xmlBase = ''])

Store useful information for later.

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

Parameters:

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

[ Top ]

getContent   [line 114]

string|false getContent( )

Return the entry's content

The official way to include full content in an RSS1 entry is to use the content module's element 'encoded'. Often, however, the 'description' element is used instead. We will offer that as a fallback.


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

getEnclosure   [line 146]

false getEnclosure( )

How RSS1.1 should support for enclosures is not clear. For now we will return false.

[ Top ]

getId   [line 97]

string|false getId( )

If an rdf:about attribute is specified, return that as an ID

There is no established way of showing an ID for an RSS1 entry. We will simulate it using the rdf:about attribute of the entry element. This cannot be relied upon for unique IDs but may prove useful.


[ Top ]


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