29,8 → 29,7 |
* @package XML_Feed_Parser |
* @todo Find a Relax NG URI we can use |
*/ |
class XML_Feed_Parser_RSS1 extends XML_Feed_Parser_Type |
{ |
class XmlFeedParserRss1 extends XmlFeedParserType { |
/** |
* The URI of the RelaxNG schema used to (optionally) validate the feed |
* @var string |
53,7 → 52,7 |
* The class used to represent individual items |
* @var string |
*/ |
protected $itemClass = 'XML_Feed_Parser_RSS1Element'; |
protected $itemClass = 'XmlFeedParserRss1Element'; |
|
/** |
* The element containing entries |
117,8 → 116,7 |
* @param DOMDocument $xml A DOM object representing the feed |
* @param bool (optional) $string Whether or not to validate this feed |
*/ |
function __construct(DOMDocument $model, $strict = false) |
{ |
function __construct(DOMDocument $model, $strict = false) { |
$this->model = $model; |
if ($strict) { |
if (! $this->relaxNGValidate()) { |
146,8 → 144,7 |
* @param string $id any valid ID. |
* @return XML_Feed_Parser_RSS1Element |
*/ |
function getEntryById($id) |
{ |
function getEntryById($id) { |
if (isset($this->idMappings[$id])) { |
return $this->entries[$this->idMappings[$id]]; |
} |
171,8 → 168,7 |
* |
* @return array|false an array simply containing the child elements |
*/ |
protected function getImage() |
{ |
protected function getImage() { |
$images = $this->model->getElementsByTagName('image'); |
if ($images->length > 0) { |
$image = $images->item(0); |
201,8 → 197,7 |
* |
* @return array|false |
*/ |
protected function getTextInput() |
{ |
protected function getTextInput() { |
$inputs = $this->model->getElementsByTagName('textinput'); |
if ($inputs->length > 0) { |
$input = $inputs->item(0); |
241,8 → 236,7 |
* |
* @return array|false |
*/ |
function getAuthor() |
{ |
function getAuthor() { |
$options = array('creator', 'contributor', 'publisher'); |
foreach ($options as $element) { |
$test = $this->model->getElementsByTagName($element); |
261,8 → 255,7 |
* |
* @return string |
*/ |
function getLink($offset = 0, $attribute = 'href', $params = false) |
{ |
function getLink($offset = 0, $attribute = 'href', $params = false) { |
$links = $this->model->getElementsByTagName('link'); |
if ($links->length <= $offset) { |
return false; |
271,5 → 264,4 |
return $this->addBase($link->nodeValue, $link); |
} |
} |
|
?> |
?> |