You are here

public function csl_info::__construct in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/CSL.inc \csl_info::__construct()
  2. 7.2 modules/CiteProc/CSL.inc \csl_info::__construct()

File

modules/CiteProc/CSL.inc, line 489
CiteProc-PHP.

Class

csl_info

Code

public function __construct($dom_node) {
  $name = array();
  foreach ($dom_node->childNodes as $node) {
    if ($node->nodeType == 1) {
      switch ($node->nodeName) {
        case 'author':
        case 'contributor':
          foreach ($node->childNodes as $authnode) {
            if ($node->nodeType == 1) {
              $name[$authnode->nodeName] = $authnode->nodeValue;
            }
          }
          $this->authors[] = $name;
          break;
        case 'link':
          foreach ($node->attributes as $attribute) {
            $this->links[] = $attribute->value;
          }
          break;
        default:
          $this->{$node->nodeName} = $node->nodeValue;
      }
    }
  }
}