Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
32 changes: 16 additions & 16 deletions src/Reader/Extension/DublinCore/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public function getAuthors()
}

$authors = array();
$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc11:creator');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:creator');

if (!$list->length) {
$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc10:creator');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:creator');
}
if (!$list->length) {
$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc11:publisher');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:publisher');

if (!$list->length) {
$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc10:publisher');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:publisher');
}
}

Expand Down Expand Up @@ -92,10 +92,10 @@ public function getCategories()
return $this->data['categories'];
}

$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc11:subject');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:subject');

if (!$list->length) {
$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc10:subject');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:subject');
}

if ($list->length) {
Expand Down Expand Up @@ -138,10 +138,10 @@ public function getDescription()
}

$description = null;
$description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)');
$description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)');

if (!$description) {
$description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)');
$description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)');
}

if (!$description) {
Expand All @@ -165,10 +165,10 @@ public function getId()
}

$id = null;
$id = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)');
$id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)');

if (!$id) {
$id = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)');
$id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)');
}

$this->data['id'] = $id;
Expand All @@ -188,10 +188,10 @@ public function getTitle()
}

$title = null;
$title = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)');
$title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)');

if (!$title) {
$title = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)');
$title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)');
}

if (!$title) {
Expand All @@ -215,10 +215,10 @@ public function getDate()
}

$d = null;
$date = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)');
$date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)');

if (!$date) {
$date = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)');
$date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)');
}

if ($date) {
Expand All @@ -237,7 +237,7 @@ public function getDate()
*/
protected function registerNamespaces()
{
$this->xpath->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/');
$this->xpath->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/');
$this->getXpath()->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/');
$this->getXpath()->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/');
}
}
40 changes: 20 additions & 20 deletions src/Reader/Extension/DublinCore/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public function getAuthors()
}

$authors = array();
$list = $this->xpath->query('//dc11:creator');
$list = $this->getXpath()->query('//dc11:creator');

if (!$list->length) {
$list = $this->xpath->query('//dc10:creator');
$list = $this->getXpath()->query('//dc10:creator');
}
if (!$list->length) {
$list = $this->xpath->query('//dc11:publisher');
$list = $this->getXpath()->query('//dc11:publisher');

if (!$list->length) {
$list = $this->xpath->query('//dc10:publisher');
$list = $this->getXpath()->query('//dc10:publisher');
}
}

Expand Down Expand Up @@ -93,10 +93,10 @@ public function getCopyright()
}

$copyright = null;
$copyright = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:rights)');
$copyright = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:rights)');

if (!$copyright) {
$copyright = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:rights)');
$copyright = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:rights)');
}

if (!$copyright) {
Expand All @@ -120,10 +120,10 @@ public function getDescription()
}

$description = null;
$description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)');
$description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)');

if (!$description) {
$description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)');
$description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)');
}

if (!$description) {
Expand All @@ -147,10 +147,10 @@ public function getId()
}

$id = null;
$id = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)');
$id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)');

if (!$id) {
$id = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)');
$id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)');
}

$this->data['id'] = $id;
Expand All @@ -170,10 +170,10 @@ public function getLanguage()
}

$language = null;
$language = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:language)');
$language = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:language)');

if (!$language) {
$language = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:language)');
$language = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:language)');
}

if (!$language) {
Expand All @@ -197,10 +197,10 @@ public function getTitle()
}

$title = null;
$title = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)');
$title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)');

if (!$title) {
$title = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)');
$title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)');
}

if (!$title) {
Expand All @@ -224,10 +224,10 @@ public function getDate()
}

$d = null;
$date = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)');
$date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)');

if (!$date) {
$date = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)');
$date = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)');
}

if ($date) {
Expand All @@ -250,10 +250,10 @@ public function getCategories()
return $this->data['categories'];
}

$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc11:subject');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc11:subject');

if (!$list->length) {
$list = $this->xpath->evaluate($this->getXpathPrefix() . '//dc10:subject');
$list = $this->getXpath()->evaluate($this->getXpathPrefix() . '//dc10:subject');
}

if ($list->length) {
Expand All @@ -280,7 +280,7 @@ public function getCategories()
*/
protected function registerNamespaces()
{
$this->xpath->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/');
$this->xpath->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/');
$this->getXpath()->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/');
$this->getXpath()->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/');
}
}

0 comments on commit 007ee1a

Please sign in to comment.