You are here

function en8_characterData in Bibliography Module 6

Same name and namespace in other branches
  1. 5 endnote8_parser.inc \en8_characterData()
2 calls to en8_characterData()
en8_endElement in ./endnote8_parser.inc
en8_startElement in ./endnote8_parser.inc

File

./endnote8_parser.inc, line 133

Code

function en8_characterData($parser, $data) {
  global $node, $element, $contributors, $contrib_count, $dates, $urls, $keyword_count;
  if (trim(htmlspecialchars_decode($data))) {
    switch ($element) {

      //Author information
      case 'author':
        switch ($contributors) {
          case 'authors':
            $node['biblio_contributors'][1][$contrib_count]['name'] .= $data;
            $node['biblio_contributors'][1][$contrib_count]['auth_type'] = _biblio_get_auth_type(1, $node['biblio_type']);
            break;
          case 'secondary-authors':
            $node['biblio_contributors'][2][$contrib_count]['name'] .= $data;
            $node['biblio_contributors'][2][$contrib_count]['auth_type'] = _biblio_get_auth_type(2, $node['biblio_type']);
            break;
          case 'tertiary-authors':
            $node['biblio_contributors'][3][$contrib_count]['name'] .= $data;
            $node['biblio_contributors'][3][$contrib_count]['auth_type'] = _biblio_get_auth_type(3, $node['biblio_type']);
            break;
          case 'subsidiary-authors':
            $node['biblio_contributors'][4][$contrib_count]['name'] .= $data;
            $node['biblio_contributors'][4][$contrib_count]['auth_type'] = _biblio_get_auth_type(4, $node['biblio_type']);
            break;
          case 'translated-authors':
            $node['biblio_contributors'][5][$contrib_count]['name'] .= $data;
            $node['biblio_contributors'][5][$contrib_count]['auth_type'] = _biblio_get_auth_type(5, $node['biblio_type']);
            break;
        }
        break;
      case 'keyword':
        $node['biblio_keywords'][$keyword_count] .= $data;
        break;
      case 'dates':
        switch ($dates) {
          case 'year':
            $node['biblio_year'] .= $data;
            break;
        }
        break;
      case 'date':
        switch ($dates) {
          case 'pub-dates':
            $node['biblio_date'] .= $data;
            break;
          case 'copyright-dates':
            break;
        }
        break;
      case 'urls':
      case 'url':
        switch ($urls) {
          case 'web-urls':
          case 'pdf-urls':
          case 'text-urls':
          case 'image-urls':
            break;
          case 'related-urls':
            $node['biblio_url'] .= $data;
            break;
        }
        break;
      case 'title':
        $node['title'] .= $data;
        break;
      default:
        if ($field = en8_parser_field_map(trim($element))) {
          $node[$field] .= $data;
        }
    }
  }
}