You are here

protected function EasyRdf_Parser_Rdfa::getUriAttribute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php \EasyRdf_Parser_Rdfa::getUriAttribute()
1 call to EasyRdf_Parser_Rdfa::getUriAttribute()
EasyRdf_Parser_Rdfa::processNode in vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Parser/Rdfa.php, line 280

Class

EasyRdf_Parser_Rdfa
Class to parse RDFa 1.1 with no external dependancies.

Code

protected function getUriAttribute($node, &$context, $attributes) {
  if (!is_array($attributes)) {
    $attributes = array(
      $attributes,
    );
  }

  // Find the first attribute that returns a valid URI
  foreach ($attributes as $attribute) {
    if ($node
      ->hasAttribute($attribute)) {
      $value = $node
        ->getAttribute($attribute);
      $uri = $this
        ->processUri($node, $context, $value);
      if ($uri) {
        return $uri;
      }
    }
  }
}