You are here

public function csl_name::__construct in Bibliography Module 7

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

Overrides csl_format::__construct

File

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

Class

csl_name

Code

public function __construct($dom_node, $citeproc = NULL) {
  $tags = $dom_node
    ->getElementsByTagName('name-part');
  if ($tags) {
    foreach ($tags as $tag) {
      $name_part = $tag
        ->getAttribute('name');
      $tag
        ->removeAttribute('name');
      for ($i = 0; $i < $tag->attributes->length; $i++) {
        $value = $tag->attributes
          ->item($i)->value;
        $name = str_replace(' ', '_', $tag->attributes
          ->item($i)->name);
        $this->name_parts[$name_part][$name] = $value;
      }
    }
  }
  parent::__construct($dom_node, $citeproc);
}