You are here

function en8_startElement in Bibliography Module 6

Same name and namespace in other branches
  1. 5 endnote8_parser.inc \en8_startElement()

File

./endnote8_parser.inc, line 2

Code

function en8_startElement($parser, $name, $attrs) {
  global $node, $element, $contributors, $contrib_count, $titles, $periodical, $dates, $urls, $keyword_count, $font_attr;
  switch ($name) {
    case 'record':
      $node = array();
      break;
    case 'style':
      $font_attr = explode(' ', $attrs['face']);
      foreach ($font_attr as $fatt) {
        switch ($fatt) {
          case 'normal':
            break;
          case 'bold':
            en8_characterData(NULL, '<b>');
            break;
          case 'italic':
            en8_characterData(NULL, '<i>');
            break;
          case 'underline':
            en8_characterData(NULL, '<u>');
            break;
          case 'superscript':
            en8_characterData(NULL, '<sup>');
            break;
          case 'subscript':
            en8_characterData(NULL, '<sub>');
            break;
        }
      }
      break;
    case 'keywords':
      $keyword_count = 0;
      break;
    case 'authors':
    case 'secondary-authors':
    case 'tertiary-authors':
    case 'subsidiary-authors':
    case 'translated-authors':
      $contributors = $name;
      if (!isset($contrib_count)) {
        $contrib_count = 0;
      }
      break;
    case 'year':
    case 'pub-dates':
    case 'copyright-dates':
      $dates = $name;
      break;
    case 'web-urls':
    case 'pdf-urls':
    case 'text-urls':
    case 'related-urls':
    case 'image-urls':
      $urls = $name;
      break;
    default:
      $element = $name;
  }
}